Deprecate include in favor of side_load

This commit is contained in:
Santiago Pastorino
2013-10-24 15:09:26 -02:00
parent 48db253765
commit cef6f85f44
4 changed files with 13 additions and 7 deletions

View File

@@ -19,14 +19,14 @@ module ActiveModel
def embed(type, options={})
CONFIG.embed = type
CONFIG.include = true if options[:include]
CONFIG.side_load = true if options[:side_load] || options[:include]
ActiveSupport::Deprecation.warn <<-WARN
** Notice: embed is deprecated. **
The use of .embed method on a Serializer will be soon removed, as this should have a global scope and not a class scope.
Please use the global .setup method instead:
ActiveModel::Serializer.setup do |config|
config.embed = :#{type}
config.include = #{CONFIG.include || false}
config.side_load = #{CONFIG.side_load || false}
end
WARN
end