diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-15 14:54:31 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-15 14:54:31 -0700 |
commit | 5c7633cd30a80e9cf747ff39798aea8c03f70420 (patch) | |
tree | da9378390da9aefbb3e0e7647296ded57f50d683 | |
parent | ee46f1d5d2a8825de2d4973fb0301f2d85986e73 (diff) | |
parent | f6e7e11ad28555860bb8a1bb362fa091f48cc81a (diff) | |
download | rails-5c7633cd30a80e9cf747ff39798aea8c03f70420.tar.gz rails-5c7633cd30a80e9cf747ff39798aea8c03f70420.tar.bz2 rails-5c7633cd30a80e9cf747ff39798aea8c03f70420.zip |
Merge branch 'master' into joindep
* master:
use the cached arel table
Fix typo in the changelog entry
Don't remove the select values to add they back again
Pluck on NullRelation accepts a list of columns
Conflicts:
activerecord/lib/active_record/relation/finder_methods.rb
-rw-r--r-- | activerecord/CHANGELOG.md | 7 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_base.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_part.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/null_relation.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 2 | ||||
-rw-r--r-- | railties/CHANGELOG.md | 2 |
6 files changed, 12 insertions, 5 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index e1eb3e4113..6e93477c3b 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* `NullRelation#pluck` takes a list of columns + + The method signature in `NullRelation` was updated to mimic that in + `Calculations`. + + *Derek Prior* + * `scope_chain` should not be mutated for other reflections. Currently `scope_chain` uses same array for building different diff --git a/activerecord/lib/active_record/associations/join_dependency/join_base.rb b/activerecord/lib/active_record/associations/join_dependency/join_base.rb index d6280796d5..3a26c25737 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_base.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_base.rb @@ -10,7 +10,7 @@ module ActiveRecord end def table - Arel::Table.new(table_name, arel_engine) + base_klass.arel_table end def aliased_table_name diff --git a/activerecord/lib/active_record/associations/join_dependency/join_part.rb b/activerecord/lib/active_record/associations/join_dependency/join_part.rb index ab78231bd7..e22232168d 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_part.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_part.rb @@ -15,7 +15,7 @@ module ActiveRecord # association. attr_reader :base_klass, :children - delegate :table_name, :column_names, :primary_key, :arel_engine, :to => :base_klass + delegate :table_name, :column_names, :primary_key, :to => :base_klass def initialize(base_klass) @base_klass = base_klass diff --git a/activerecord/lib/active_record/null_relation.rb b/activerecord/lib/active_record/null_relation.rb index 1f3d377e53..080b20134d 100644 --- a/activerecord/lib/active_record/null_relation.rb +++ b/activerecord/lib/active_record/null_relation.rb @@ -6,7 +6,7 @@ module ActiveRecord @records = [] end - def pluck(_column_name) + def pluck(*column_names) [] end diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index ec43ded690..860bd424b7 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -274,7 +274,7 @@ class RelationTest < ActiveRecord::TestCase def test_none_chained_to_methods_firing_queries_straight_to_db assert_no_queries do - assert_equal [], Developer.none.pluck(:id) # => uses select_all + assert_equal [], Developer.none.pluck(:id, :name) assert_equal 0, Developer.none.delete_all assert_equal 0, Developer.none.update_all(:name => 'David') assert_equal 0, Developer.none.delete(1) diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 8a0e0ff3f6..1d01c8d0e5 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,4 +1,4 @@ -* Added `--model-name` scaffld\_controller\_generator option. +* Added `--model-name` option to `ScaffoldControllerGenerator`. *yalab* |