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.
248 249 250 251 252 253 254 255 |
# File 'lib/custom_fields/source.rb', line 248 def custom_fields_for(name) self.(name) # stores the relation name self._custom_fields_for << name.to_s self.extend_for_custom_fields(name) end |
#custom_fields_for?(name) ⇒ true, false
Determines if the relation is enhanced by the custom fields
225 226 227 |
# File 'lib/custom_fields/source.rb', line 225 def custom_fields_for?(name) self._custom_fields_for.include?(name.to_s) end |