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.
255 256 257 258 259 260 261 262 |
# File 'lib/custom_fields/source.rb', line 255 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
232 233 234 |
# File 'lib/custom_fields/source.rb', line 232 def custom_fields_for?(name) self._custom_fields_for.include?(name.to_s) end |