Class: Lockstep::ServiceFabricPayment
- Defined in:
- app/models/lockstep/service_fabric_payment.rb
Constant Summary
Constants inherited from ApiRecord
ApiRecord::HashWithIndifferentAccess
Instance Attribute Summary
Attributes inherited from ApiRecord
Instance Method Summary collapse
-
#attributes_for_saving ⇒ Object
Preventing deletion of id_ref from puts_attrs because id_ref column is required to send in body in case of create ServiceFabricPayment TODO: Make it generic.
-
#create ⇒ Object
Overriding This method to not send body inside an Array.
Methods inherited from ApiRecord
#==, #_read_attribute, additional_query_params, alias_attribute, #as_json, #attributes, #attributes=, belongs_to, #belongs_to_relations, belongs_to_relations, bulk_import, chunk, class_attributes, #clean?, config, create, #create_getters!, #create_setters!, #create_setters_and_getters!, #created_at, #destroy, destroy_all, #dirty?, enum, enum_config, #enum_config, execute, field, fields, find, find_by, #get_attribute, has_many, #has_many_relations, has_many_relations, #id, #id_ref, included, #initialize, #instance_resource, #load_association, load_schema, lockstep_belongs_to_relations, lockstep_has_many_relations, merge_all_attributes, #merge_attributes, #merge_relations, #method_missing, method_missing, #model_base_uri, model_base_uri, #new?, #objectId, #persisted?, #pointerize, #post_result, #primary_key, primary_key, #relations_for_saving, #reload, #resource, resource, #save, schema, #schema, #set_attribute, single_record!, to_date_object, #to_json, #to_pointer, #update, #update_attribute, #update_attributes, #updated_at, valid_attribute?, #validate_enum, where
Methods included from QueryMethods
Constructor Details
This class inherits a constructor from Lockstep::ApiRecord
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Lockstep::ApiRecord
Instance Method Details
#attributes_for_saving ⇒ Object
Preventing deletion of id_ref from puts_attrs because id_ref column is required to send in body in case of create ServiceFabricPayment TODO: Make it generic
11 12 13 14 15 16 17 18 19 |
# File 'app/models/lockstep/service_fabric_payment.rb', line 11 def attributes_for_saving @unsaved_attributes = pointerize(@unsaved_attributes) put_attrs = @unsaved_attributes put_attrs = relations_for_saving(put_attrs) put_attrs.delete('created') put_attrs.delete('modified') put_attrs end |
#create ⇒ Object
Overriding This method to not send body inside an Array
22 23 24 25 26 |
# File 'app/models/lockstep/service_fabric_payment.rb', line 22 def create attrs = attributes_for_saving.transform_keys { |key| key.camelize(:lower) } resp = resource.post(attrs['creditorAccount']['companyId'], body: attrs) result = post_result(resp) end |