Sha256: 8be3e271f001511ee87aa79d49892c27e371c9d4b054df433c20ce1d41278b3d
Contents?: true
Size: 606 Bytes
Versions: 17
Compression:
Stored size: 606 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: # Instantiates documents that came from the database. module Factory def from_db_with_custom_fields(klass, attributes = {}) if klass.with_custom_fields? klass.klass_with_custom_fields(attributes['custom_fields_recipe']) end from_db_without_custom_fields(klass, attributes) end # equivalent for "alias_method_chain :from_db, :custom_fields" alias_method :from_db_without_custom_fields, :from_db unless method_defined?(:from_db_without_custom_fields) alias_method :from_db, :from_db_with_custom_fields end end
Version data entries
17 entries across 17 versions & 1 rubygems