Module: TwoFaced::ModelExtensions::ClassMethods
- Defined in:
- lib/two_faced/model_extensions.rb
Instance Method Summary collapse
- #context ⇒ Object
- #for_context(context, options = {}) ⇒ Object
- #overwrite_attribute_prefix ⇒ Object
- #overwrite_attributes? ⇒ Boolean
Instance Method Details
#context ⇒ Object
17 18 19 |
# File 'lib/two_faced/model_extensions.rb', line 17 def context @context end |
#for_context(context, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/two_faced/model_extensions.rb', line 29 def for_context(context, = {}) = { :attribute_prefix => "overridden", :overwrite => false }.merge() @context = context includes(:overrides) @overwrite_attributes = [:overwrite] @overwrite_attribute_prefix = [:attribute_prefix] self end |
#overwrite_attribute_prefix ⇒ Object
21 22 23 |
# File 'lib/two_faced/model_extensions.rb', line 21 def overwrite_attribute_prefix @overwrite_attribute_prefix end |
#overwrite_attributes? ⇒ Boolean
25 26 27 |
# File 'lib/two_faced/model_extensions.rb', line 25 def overwrite_attributes? @overwrite_attributes end |