From 57c31a380e0136607f3ce6ee568730ec1539e163 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 23 Oct 2008 20:14:20 +0200 Subject: Prepare for Rails 2.2.0 [RC1] --- activerecord/CHANGELOG | 2 +- activerecord/Rakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 6479cc5a9b..7e00b84599 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,4 +1,4 @@ -*Edge* +*2.2.0 [RC1] (October 23rd, 2008)* * Add Model#delete instance method, similar to Model.delete class method. #1086 [Hongli Lai] diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 983528aff7..9574a431ba 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -171,7 +171,7 @@ spec = Gem::Specification.new do |s| s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) } end - s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD) + s.add_dependency('activesupport', '= 2.2.0' + PKG_BUILD) s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite" s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite" -- cgit v1.2.3 From eec6e0cbbddcc9bf141387536d4b910cc0df9d4d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 23 Oct 2008 20:18:11 +0200 Subject: Push to new gem server --- activerecord/Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 9574a431ba..4cad8bd9d9 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -225,8 +225,8 @@ end desc "Publish the beta gem" task :pgem => [:package] do - Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload - `ssh wrath.rubyonrails.org './gemupdate.sh'` + Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload + `ssh gems.rubyonrails.org './gemupdate.sh'` end desc "Publish the API documentation" -- cgit v1.2.3 From 5366e61458cb642429a80297abefddcda6696abe Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 23 Oct 2008 20:29:25 +0200 Subject: Proper update call for gem server --- activerecord/Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 4cad8bd9d9..f192646547 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -226,7 +226,7 @@ end desc "Publish the beta gem" task :pgem => [:package] do Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload - `ssh gems.rubyonrails.org './gemupdate.sh'` + `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'` end desc "Publish the API documentation" -- cgit v1.2.3 From 838cb1aa507746b3562931bb63cf4f474363e17a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 23 Oct 2008 18:53:13 -0700 Subject: Skip collection ids reader optimization if using :finder_sql --- activerecord/lib/active_record/associations.rb | 2 +- activerecord/test/cases/associations/has_many_associations_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 187caa13d0..52f6a04da1 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1296,7 +1296,7 @@ module ActiveRecord end define_method("#{reflection.name.to_s.singularize}_ids") do - if send(reflection.name).loaded? + if send(reflection.name).loaded? || reflection.options[:finder_sql] send(reflection.name).map(&:id) else send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map(&:id) diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 8d97b30c74..59784e1bcb 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -853,6 +853,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert !company.clients.loaded? end + def test_get_ids_for_unloaded_finder_sql_associations_loads_them + company = companies(:first_firm) + assert !company.clients_using_sql.loaded? + assert_equal [companies(:second_client).id], company.clients_using_sql_ids + assert company.clients_using_sql.loaded? + end + def test_assign_ids firm = Firm.new("name" => "Apple") firm.client_ids = [companies(:first_client).id, companies(:second_client).id] -- cgit v1.2.3 From d224e6ccb131559190f35c8ddfc9b31274ac5a89 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 24 Oct 2008 13:08:47 +0200 Subject: Update CHANGELOGs with the last few fixes, set date for today --- activerecord/CHANGELOG | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 7e00b84599..fec110d569 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,4 +1,6 @@ -*2.2.0 [RC1] (October 23rd, 2008)* +*2.2.0 [RC1] (October 24th, 2008)* + +* Skip collection ids reader optimization if using :finder_sql [Jeremy Kemper] * Add Model#delete instance method, similar to Model.delete class method. #1086 [Hongli Lai] -- cgit v1.2.3