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

@@ -5,10 +5,16 @@ module ActiveModel
class Serializer
class Association
def initialize(name, options={})
if options.has_key?(:include)
ActiveSupport::Deprecation.warn <<-WARN
** Notice: include was renamed to side_load. **
WARN
end
@name = name.to_s
@options = options
self.embed = options.fetch(:embed) { CONFIG.embed }
@side_load = options.fetch(:include) { CONFIG.include }
@side_load = options.fetch(:side_load) { options.fetch(:include) { CONFIG.side_load } }
@embed_key = options[:embed_key] || :id
@key = options[:key]
@embedded_key = options[:root] || name