1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Refactor to use each_key, remove extra spaces

This commit is contained in:
Carlos Antonio da Silva 2013-01-27 18:47:47 -02:00
parent 439ac72013
commit 2cb576ef36
7 changed files with 5 additions and 11 deletions

View file

@ -601,7 +601,7 @@
*Matt Jones*
* Accept belongs_to (including polymorphic) association keys in queries.
* Accept `belongs_to` (including polymorphic) association keys in queries.
The following queries are now equivalent:

View file

@ -68,7 +68,7 @@ module ActiveRecord
remove_duplicate_results!(base, records, association)
end
when Hash
associations.keys.each do |name|
associations.each_key do |name|
reflection = base.reflections[name]
remove_uniq_by_reflection(reflection, records)

View file

@ -220,7 +220,7 @@ module ActiveRecord
save
end
end
alias update_attributes update
# Updates its receiver just like +update+ but calls <tt>save!</tt> instead
@ -233,7 +233,7 @@ module ActiveRecord
save!
end
end
alias update_attributes! update!
# Equivalent to <code>update_columns(name => value)</code>.

View file

@ -1,4 +1,3 @@
module ActiveRecord
module Querying
delegate :find, :take, :take!, :first, :first!, :last, :last!, :exists?, :any?, :many?, :to => :all

View file

@ -1,4 +1,3 @@
module ActiveRecord
# = Active Record Reflection
module Reflection # :nodoc:

View file

@ -1,4 +1,3 @@
module ActiveRecord
module Scoping
extend ActiveSupport::Concern
@ -25,6 +24,5 @@ module ActiveRecord
send("#{att}=", value) if respond_to?("#{att}=")
end
end
end
end

View file

@ -1,4 +1,3 @@
module ActiveRecord
module Scoping
module Default
@ -99,7 +98,7 @@ module ActiveRecord
)
end
self.default_scopes = default_scopes + [scope]
self.default_scopes += [scope]
end
def build_default_scope # :nodoc:
@ -140,7 +139,6 @@ module ActiveRecord
self.ignore_default_scope = false
end
end
end
end
end