lib/finapps/rest/operators.rb in finapps-5.0.32 vs lib/finapps/rest/operators.rb in finapps-5.0.33

- old
+ new

@@ -7,11 +7,11 @@ class Operators < FinAppsCore::REST::Resources include FinApps::Utils::QueryBuilder def list(params = nil) return super if params.nil? - raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash + fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params' unless params.is_a? Hash super build_query_path(end_point, params) end def show(id) @@ -34,11 +34,11 @@ end def update_password(params) # update password for current operator, need authorization session in header not_blank(params, :params) - raise FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless validates params + fail FinAppsCore::InvalidArgumentsError, 'Invalid argument: params.' unless validates params path = "#{end_point}/password/change" create params, path end @@ -62,17 +62,17 @@ filter.merge!(role_query(params[:role])) if params[:role] filter end def search_query(term) - { "last_name": term } + {"last_name": term} end def role_query(role) if role.is_a?(Array) - { "role": { "$in": role.map(&:to_i) } } + {"role": {"$in": role.map(&:to_i)}} else - { "role": role.to_i } + {"role": role.to_i} end end end end end