aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-27 18:47:47 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-28 23:25:03 -0200
commit2cb576ef36fdf14c4d4e1b8e66d930af7ad35aeb (patch)
tree23a814ed1e574b69479bd0d58c58cfbb63660000
parent439ac72013fc1b819e711d66642b0b5b563fd72e (diff)
downloadrails-2cb576ef36fdf14c4d4e1b8e66d930af7ad35aeb.tar.gz
rails-2cb576ef36fdf14c4d4e1b8e66d930af7ad35aeb.tar.bz2
rails-2cb576ef36fdf14c4d4e1b8e66d930af7ad35aeb.zip
Refactor to use each_key, remove extra spaces
-rw-r--r--activerecord/CHANGELOG.md2
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb2
-rw-r--r--activerecord/lib/active_record/persistence.rb4
-rw-r--r--activerecord/lib/active_record/querying.rb1
-rw-r--r--activerecord/lib/active_record/reflection.rb1
-rw-r--r--activerecord/lib/active_record/scoping.rb2
-rw-r--r--activerecord/lib/active_record/scoping/default.rb4
7 files changed, 5 insertions, 11 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index c6a6e44724..b987104dd0 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -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:
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index cd366ac8b7..f40368cfeb 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -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)
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 1b2aa9349e..803cae7115 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -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>.
diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb
index 5ddcaee6be..f08b9c614d 100644
--- a/activerecord/lib/active_record/querying.rb
+++ b/activerecord/lib/active_record/querying.rb
@@ -1,4 +1,3 @@
-
module ActiveRecord
module Querying
delegate :find, :take, :take!, :first, :first!, :last, :last!, :exists?, :any?, :many?, :to => :all
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index bcfcb061f2..0995750ecd 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -1,4 +1,3 @@
-
module ActiveRecord
# = Active Record Reflection
module Reflection # :nodoc:
diff --git a/activerecord/lib/active_record/scoping.rb b/activerecord/lib/active_record/scoping.rb
index 0c3fd1bd29..9746b1c3c2 100644
--- a/activerecord/lib/active_record/scoping.rb
+++ b/activerecord/lib/active_record/scoping.rb
@@ -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
diff --git a/activerecord/lib/active_record/scoping/default.rb b/activerecord/lib/active_record/scoping/default.rb
index 6835d0e01b..5bd481082e 100644
--- a/activerecord/lib/active_record/scoping/default.rb
+++ b/activerecord/lib/active_record/scoping/default.rb
@@ -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