Module: CustomFields::Source::ClassMethods
- Defined in:
- lib/custom_fields/source.rb
Instance Method Summary collapse
-
#custom_fields_for(name) ⇒ Object
Enhance a referenced collection OR the instance itself (by passing self) by providing methods to manage custom fields.
-
#custom_fields_for?(name) ⇒ true, false
Determines if the relation is enhanced by the custom fields.
Instance Method Details
#custom_fields_for(name) ⇒ Object
Enhance a referenced collection OR the instance itself (by passing self) by providing methods to manage custom fields.
256 257 258 259 260 261 262 263 |
# File 'lib/custom_fields/source.rb', line 256 def custom_fields_for(name) (name) # stores the relation name _custom_fields_for << name.to_s extend_for_custom_fields(name) end |
#custom_fields_for?(name) ⇒ true, false
Determines if the relation is enhanced by the custom fields
233 234 235 |
# File 'lib/custom_fields/source.rb', line 233 def custom_fields_for?(name) _custom_fields_for.include?(name.to_s) end |