Module: CustomFieldsRelatableExtension
- Defined in:
- lib/custom_fields/extensions/mongoid/association/relatable.rb
Instance Method Summary collapse
Instance Method Details
#resolve_name(mod, name) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/custom_fields/extensions/mongoid/association/relatable.rb', line 4 def resolve_name(mod, name) super rescue NameError => e return name.constantize if name =~ CustomFields::KLASS_REGEXP raise e end |
#validate! ⇒ Object
12 13 14 15 16 17 |
# File 'lib/custom_fields/extensions/mongoid/association/relatable.rb', line 12 def validate! option = @options.delete(:custom_fields_parent_klass) super.tap do @options[:custom_fields_parent_klass] = option if option end end |