Module: ActiveRecordMask::ClassMethods
- Defined in:
- lib/active_record_mask/active_record_mask.rb
Instance Attribute Summary collapse
-
#allowed_associations ⇒ Object
readonly
Returns the value of attribute allowed_associations.
-
#allowed_attributes ⇒ Object
readonly
Returns the value of attribute allowed_attributes.
Instance Method Summary collapse
- #allow_associations(value = nil) ⇒ Object
- #allow_attributes(value = nil) ⇒ Object
- #configure_active_record_mask {|_self| ... } ⇒ Object
- #revealed_defaults(value = nil) ⇒ Object
- #show_real_data_by_default(value = nil) ⇒ Object
Instance Attribute Details
#allowed_associations ⇒ Object (readonly)
Returns the value of attribute allowed_associations.
29 30 31 |
# File 'lib/active_record_mask/active_record_mask.rb', line 29 def allowed_associations @allowed_associations end |
#allowed_attributes ⇒ Object (readonly)
Returns the value of attribute allowed_attributes.
29 30 31 |
# File 'lib/active_record_mask/active_record_mask.rb', line 29 def allowed_attributes @allowed_attributes end |
Instance Method Details
#allow_associations(value = nil) ⇒ Object
20 21 22 |
# File 'lib/active_record_mask/active_record_mask.rb', line 20 def allow_associations(value = nil) @allowed_associations = value if value end |
#allow_attributes(value = nil) ⇒ Object
16 17 18 |
# File 'lib/active_record_mask/active_record_mask.rb', line 16 def allow_attributes(value = nil) @allowed_attributes = value if value end |
#configure_active_record_mask {|_self| ... } ⇒ Object
5 6 7 8 9 |
# File 'lib/active_record_mask/active_record_mask.rb', line 5 def configure_active_record_mask yield self if block_given? @allowed_attributes ||= [:id] @allowed_associations ||= [] end |
#revealed_defaults(value = nil) ⇒ Object
11 12 13 14 |
# File 'lib/active_record_mask/active_record_mask.rb', line 11 def revealed_defaults(value = nil) @revealed_defaults = value if value @revealed_defaults ||= {} end |
#show_real_data_by_default(value = nil) ⇒ Object
24 25 26 27 |
# File 'lib/active_record_mask/active_record_mask.rb', line 24 def show_real_data_by_default(value = nil) @show_real_data_by_default = value if value @show_real_data_by_default ||= false end |