This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.for_user(user_id, filter = {}) | |
filter = { | |
:amount => nil, | |
:src_users => [], | |
:trg_users => [] | |
}.merge(filter) | |
transaction = Transaction.arel_table | |
operation = Operation.arel_table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class @UserTypeAhead extends AngularDirective | |
link: (scope, element, attrs, controller) => | |
@$log.debug('hello from child'); | |
console.log('element: ',element); | |
App.directive 'userTypeahead', new UserTypeAhead('$log') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope.acl = {} | |
return unless @user? | |
scope.is_authenticated = @isLogged() | |
scope.user = @user | |
for key,role of @user.roles | |
for resource_key, resource of window.Acl[@user.company_namespace].acl | |
for action_key, action of resource | |
if action[role]? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
require 'controllers/api/speakphone/test_helper' | |
class Api::Speakphone::CompaniesControllerTest < ActionController::TestCase | |
@acl_hash = { | |
admin: { index: :success , update: :success , create: :success , destroy: :success }, | |
content_manager:{ index: :success , update: :success , create: :success , destroy: :success }, | |
device_manager:{ index: :success , update: :unauthorized , create: :unauthorized , destroy: :unauthorized } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SignUpType < BaseType | |
attribute :email, String | |
attribute :password, String | |
attribute :password_confirmation, String | |
attribute :name, String | |
attribute :surname, String | |
validates :email, email: true, :presence => { :message => "sign_up_type.email.presense" } | |
validates :password, :presence => { :message => "sign_up_type.password.presense" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rescue_from TypeExceptions::InvalidParamsError, with: :handle_invalid_params | |
def handle_invalid_params e | |
render json: e.message, status: :unprocessable_entity | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.get_geo_object(fias_object) | |
address_encoded = URI.encode fias_object.address.strip | |
url = "http://geocode-maps.yandex.ru/1.x/?geocode=#{address_encoded}" | |
xml = Hash.from_xml(RestClient.get(url)) | |
count = xml["ymaps"]["GeoObjectCollection"]["metaDataProperty"]["GeocoderResponseMetaData"]["found"].to_i | |
p url | |
p count | |
if (count > 1) | |
pos = xml["ymaps"]["GeoObjectCollection"]["featureMember"][0]["GeoObject"]["Point"]["pos"] | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto | |
[diff] | |
renamelimit = 0 | |
[merge] | |
summary = true | |
[alias] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChatApp = angular.module('ChatApp', []); | |
ChatApp.config(function ($httpProvider) { | |
$httpProvider.defaults.headers.common['X-CSRF-TOKEN'] = $("meta[name=\"csrf-token\"]").attr("content"); | |
}); | |
ChatApp.controller('ChatController', function ($scope, $http) { | |
$scope.messages = []; | |
$scope.send = function () { | |
var message = $scope.new_message; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-09-23 10:45:18.710 [error] <0.149.0> Supervisor riak_cs_sup had child riak_cs_gc_d started with riak_cs_gc_d:start_link() at <0.24099.126> exit with reason no match of right hand value {error,all_workers_busy} in riak_cs_gc_key_list:gc_index_query/5 line 153 in context child_terminated | |
2014-09-23 11:00:18.710 [error] <0.27448.126> gen_fsm riak_cs_gc_d in state fetching_next_batch terminated with reason: no match of right hand value {error,all_workers_busy} in riak_cs_gc_key_list:gc_index_query/5 line 153 | |
2014-09-23 11:00:18.710 [error] <0.27448.126> CRASH REPORT Process riak_cs_gc_d with 1 neighbours exited with reason: no match of right hand value {error,all_workers_busy} in riak_cs_gc_key_list:gc_index_query/5 line 153 in gen_fsm:terminate/7 line 611 | |
2014-09-23 11:00:18.711 [error] <0.149.0> Supervisor riak_cs_sup had child riak_cs_gc_d started with riak_cs_gc_d:start_link() at <0.27448.126> exit with reason no match of right hand value {error,all_workers_busy} in riak_cs_gc_key_list:gc_index_query/5 l |
OlderNewer