Module: PopulateMe::DocumentMixins::Schema
- Included in:
- PopulateMe::Document
- Defined in:
- lib/populate_me/document_mixins/schema.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#field_applicable?(f) ⇒ Boolean
Instance methods.
- #relationship_applicable?(f) ⇒ Boolean
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/populate_me/document_mixins/schema.rb', line 5 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#field_applicable?(f) ⇒ Boolean
Instance methods
200 201 202 203 |
# File 'lib/populate_me/document_mixins/schema.rb', line 200 def field_applicable? f p_type = self.class.polymorphic? ? self.polymorphic_type : nil self.class.field_applicable? f, p_type end |
#relationship_applicable?(f) ⇒ Boolean
205 206 207 208 |
# File 'lib/populate_me/document_mixins/schema.rb', line 205 def relationship_applicable? f p_type = self.class.polymorphic? ? self.polymorphic_type : nil self.class.relationship_applicable? f, p_type end |