Module: Composable::Core::ComposableDSL
- Extended by:
- ActiveSupport::Concern
- Includes:
- InheritableAttributes, RecordInvalid
- Defined in:
- lib/composable/core/composable_dsl.rb
Defined Under Namespace
Modules: ClassMethods Classes: Composable
Instance Method Summary collapse
- #composables ⇒ Object
-
#initialize(options = {}) ⇒ Object
In order to prevent attribute values passed in at initialize from being overridden by composable_record values, composable_record mapping methods have to be synced first.
- #save_composables ⇒ Object
Instance Method Details
#composables ⇒ Object
45 46 47 |
# File 'lib/composable/core/composable_dsl.rb', line 45 def composables self.class.composables end |
#initialize(options = {}) ⇒ Object
In order to prevent attribute values passed in at initialize from being overridden by composable_record values, composable_record mapping methods have to be synced first.
36 37 38 39 40 41 42 43 |
# File 'lib/composable/core/composable_dsl.rb', line 36 def initialize( = {}) composable_keys.each do |attribute| value = .delete(attribute) || .delete(attribute.to_s) send("#{attribute}=", value) if value end super end |
#save_composables ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/composable/core/composable_dsl.rb', line 49 def save_composables multi_db_transaction do sync_composable_records save_composable_records yield if block_given? end end |