Module: Quickery::ActiveRecordExtensions::DSL::ClassMethods
- Defined in:
- lib/quickery/active_record_extensions/dsl.rb
Instance Attribute Summary collapse
-
#quickery_association_chain_dependees ⇒ Object
Returns the value of attribute quickery_association_chain_dependees.
-
#quickery_association_chain_dependers ⇒ Object
Returns the value of attribute quickery_association_chain_dependers.
-
#quickery_association_chain_intermediaries ⇒ Object
Returns the value of attribute quickery_association_chain_intermediaries.
-
#quickery_builders ⇒ Object
Returns the value of attribute quickery_builders.
Instance Method Summary collapse
- #quickery(mappings) ⇒ Object
-
#quickery_before_association_destroy(dependent_records, record_to_be_destroyed, new_values) ⇒ Object
subclass overrideable.
-
#quickery_before_association_update(dependent_records, record_to_be_updated, new_values) ⇒ Object
subclass overrideable.
-
#quickery_before_create_or_update(dependent_record, new_values) ⇒ Object
subclass overrideable.
Instance Attribute Details
#quickery_association_chain_dependees ⇒ Object
Returns the value of attribute quickery_association_chain_dependees.
13 14 15 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 13 def quickery_association_chain_dependees @quickery_association_chain_dependees end |
#quickery_association_chain_dependers ⇒ Object
Returns the value of attribute quickery_association_chain_dependers.
12 13 14 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 12 def quickery_association_chain_dependers @quickery_association_chain_dependers end |
#quickery_association_chain_intermediaries ⇒ Object
Returns the value of attribute quickery_association_chain_intermediaries.
14 15 16 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 14 def quickery_association_chain_intermediaries @quickery_association_chain_intermediaries end |
#quickery_builders ⇒ Object
Returns the value of attribute quickery_builders.
15 16 17 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 15 def quickery_builders @quickery_builders end |
Instance Method Details
#quickery(mappings) ⇒ Object
17 18 19 20 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 17 def quickery(mappings) mappings_builder = MappingsBuilder.new(model: self, mappings: mappings.with_indifferent_access) mappings_builder.map_attributes end |
#quickery_before_association_destroy(dependent_records, record_to_be_destroyed, new_values) ⇒ Object
subclass overrideable
33 34 35 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 33 def quickery_before_association_destroy(dependent_records, record_to_be_destroyed, new_values) dependent_records.update_all(new_values) end |
#quickery_before_association_update(dependent_records, record_to_be_updated, new_values) ⇒ Object
subclass overrideable
28 29 30 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 28 def quickery_before_association_update(dependent_records, record_to_be_updated, new_values) dependent_records.update_all(new_values) end |
#quickery_before_create_or_update(dependent_record, new_values) ⇒ Object
subclass overrideable
23 24 25 |
# File 'lib/quickery/active_record_extensions/dsl.rb', line 23 def quickery_before_create_or_update(dependent_record, new_values) dependent_record.assign_attributes(new_values) end |