Module: Superseeder::Adapters::Mongoid
- Defined in:
- lib/superseeder/adapters/mongoid.rb
Instance Method Summary collapse
Instance Method Details
#each_field(row) ⇒ Object
11 12 13 14 15 |
# File 'lib/superseeder/adapters/mongoid.rb', line 11 def each_field(row) self.instance.fields.select{ |f, o| row.key? o.[:as] || f }.each do |field, | yield .[:as] || field, self.is_array_field?(), self.is_hash_field?() end end |
#each_relation ⇒ Object
5 6 7 8 9 |
# File 'lib/superseeder/adapters/mongoid.rb', line 5 def each_relation self.instance.relations.each do |key, val| yield key, self.is_array_relation?(val), val.class_name.constantize end end |