diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-04-11 08:41:02 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-04-11 08:41:02 -0500 |
commit | b8bc92e61914cc6ef9d6ca12aba27d440ec0ebd5 (patch) | |
tree | 089cb73df0d695c88b8d1bc38203bef0ffc95072 | |
parent | 67022671bfa28d5675a30925a8d1e271c576f4d2 (diff) | |
parent | f46fd6f2fceb22f00669f066fc98f92a18e5875f (diff) | |
download | rails-b8bc92e61914cc6ef9d6ca12aba27d440ec0ebd5.tar.gz rails-b8bc92e61914cc6ef9d6ca12aba27d440ec0ebd5.tar.bz2 rails-b8bc92e61914cc6ef9d6ca12aba27d440ec0ebd5.zip |
Merge branch 'master' of git://github.com/rails/rails
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/associations/belongs_to_associations_test.rb | 12 | ||||
-rw-r--r-- | railties/lib/tasks/framework.rake | 48 |
4 files changed, 19 insertions, 45 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index e79487c687..3248594c19 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -2,8 +2,6 @@ * Change validates_uniqueness_of :case_sensitive option default back to true (from [9160]). Love your database columns, don't LOWER them. [rick] -* Ensure that save on child object fails for invalid belongs_to association. Closes #11555. [rubyruy] - * Add support for interleaving migrations by storing which migrations have run in the new schema_migrations table. Closes #11493 [jordi] * ActiveRecord::Base#sum defaults to 0 if no rows are returned. Closes #11550 [kamal] diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 3ea933875d..7d27b0607a 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -922,8 +922,6 @@ module ActiveRecord ) end - add_single_associated_save_callbacks(reflection.name) - configure_dependency_for_belongs_to(reflection) end diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index 75f236aca0..b8ec9117af 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -377,16 +377,4 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase assert companies(:first_client).readonly_firm.readonly? end - def test_save_fails_for_invalid_belongs_to - log = AuditLog.new - assert log.valid? - - log.build_developer # Build invalid association - assert !log.developer.valid? - assert !log.valid? - assert_equal "is invalid", log.errors.on("developer") - - assert !log.save - end - end diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index 891f901fe9..7955ded898 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -38,40 +38,30 @@ namespace :rails do end end - desc "Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)" + desc 'Lock to latest Edge Rails' task :edge do - $verbose = false - `svn --version` rescue nil - unless !$?.nil? && $?.success? - $stderr.puts "ERROR: Must have subversion (svn) available in the PATH to lock this application to Edge Rails" - exit 1 - end - - rm_rf "vendor/rails" - mkdir_p "vendor/rails" - - svn_root = "http://dev.rubyonrails.org/svn/rails/" - - if ENV['TAG'] - rails_svn = "#{svn_root}/tags/#{ENV['TAG']}" - touch "vendor/rails/TAG_#{ENV['TAG']}" - else - rails_svn = "#{svn_root}/trunk" - - if ENV['REVISION'].nil? - ENV['REVISION'] = /^r(\d+)/.match(%x{svn -qr HEAD log #{svn_root}})[1] - puts "REVISION not set. Using HEAD, which is revision #{ENV['REVISION']}." + require 'open-uri' + + chdir 'vendor' do + puts 'Downloading Rails' + File.open('rails_edge.zip', 'wb') do |dst| + open 'http://dev.rubyonrails.org/archives/rails_edge.zip' do |src| + while chunk = src.read(4096) + dst << chunk + end + end end - touch "vendor/rails/REVISION_#{ENV['REVISION']}" + puts 'Unpacking Rails' + rm_rf 'rails' + `unzip rails_edge.zip` + %w(rails_edge.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner| + rm_f goner + end end - for framework in %w(railties actionpack activerecord actionmailer activesupport activeresource) - system "svn export #{rails_svn}/#{framework} vendor/rails/#{framework}" + (ENV['REVISION'] ? " -r #{ENV['REVISION']}" : "") - end - - puts "Updating current scripts, javascripts, and configuration settings" - Rake::Task["rails:update"].invoke + puts 'Updating current scripts, javascripts, and configuration settings' + Rake::Task['rails:update'].invoke end end |