Browse files

Don't merge base opts into includes when serializing ARs

Conflicts:

	activerecord/lib/active_record/serialization.rb
  • Loading branch information...
1 parent 294e2a8 commit 043b6243901aea2e7f604e1d4ce655cfe595ceb7 @jmileham jmileham committed May 26, 2011
Showing with 2 additions and 6 deletions.
  1. +2 −6 activerecord/lib/active_record/serialization.rb
View
8 activerecord/lib/active_record/serialization.rb
@@ -31,9 +31,6 @@ def serializable_hash(options = nil)
def serializable_add_includes(options = {})
return unless include_associations = options.delete(:include)
- base_only_or_except = { :except => options[:except],
- :only => options[:only] }
-
include_has_options = include_associations.is_a?(Hash)
associations = include_has_options ? include_associations.keys : Array.wrap(include_associations)
@@ -46,9 +43,8 @@ def serializable_add_includes(options = {})
end
if records
- association_options = include_has_options ? include_associations[association] : base_only_or_except
- opts = options.merge(association_options)
- yield(association, records, opts)
+ association_options = include_has_options ? include_associations[association] : {}
+ yield(association, records, association_options)
end
end

0 comments on commit 043b624

Please sign in to comment.