diff options
-rw-r--r-- | activejob/Rakefile | 2 | ||||
-rw-r--r-- | activejob/lib/active_job/base.rb | 4 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/backburner.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/qu.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/resque.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/sidekiq.rb | 2 | ||||
-rw-r--r-- | activejob/test/support/integration/adapters/sneakers.rb | 2 | ||||
-rw-r--r-- | activerecord/CHANGELOG.md | 7 | ||||
-rw-r--r-- | activerecord/lib/active_record/errors.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/merger.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 6 |
11 files changed, 21 insertions, 12 deletions
diff --git a/activejob/Rakefile b/activejob/Rakefile index a66df8939e..7e66860b36 100644 --- a/activejob/Rakefile +++ b/activejob/Rakefile @@ -35,6 +35,7 @@ namespace :test do t.libs << 'test' t.test_files = FileList['test/cases/**/*_test.rb'] t.verbose = true + t.warning = true t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION) end @@ -53,6 +54,7 @@ namespace :test do t.libs << 'test' t.test_files = FileList['test/integration/**/*_test.rb'] t.verbose = true + t.warning = true t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION) end end diff --git a/activejob/lib/active_job/base.rb b/activejob/lib/active_job/base.rb index 7a64bb9392..913e221d89 100644 --- a/activejob/lib/active_job/base.rb +++ b/activejob/lib/active_job/base.rb @@ -9,14 +9,14 @@ require 'active_job/logging' module ActiveJob #:nodoc: # = Active Job # - # Active job objects can be configured to work with different backend + # Active Job objects can be configured to work with different backend # queuing frameworks. To specify a queue adapter to use: # # ActiveJob::Base.queue_adapter = :inline # # A list of supported adapters can be found in QueueAdapters. # - # Active job objects can be defined by creating a class that inherits + # Active Job objects can be defined by creating a class that inherits # from the ActiveJob::Base class. The only necessary method to # implement is the "perform" method. # diff --git a/activejob/test/support/integration/adapters/backburner.rb b/activejob/test/support/integration/adapters/backburner.rb index 0cda36a273..2e82562948 100644 --- a/activejob/test/support/integration/adapters/backburner.rb +++ b/activejob/test/support/integration/adapters/backburner.rb @@ -29,7 +29,7 @@ module BackburnerJobsManager def can_run? begin Backburner::Worker.connection.send :connect! - rescue => e + rescue return false end true diff --git a/activejob/test/support/integration/adapters/qu.rb b/activejob/test/support/integration/adapters/qu.rb index e913f04a24..3a5b66a057 100644 --- a/activejob/test/support/integration/adapters/qu.rb +++ b/activejob/test/support/integration/adapters/qu.rb @@ -30,7 +30,7 @@ module QuJobsManager def can_run? begin Qu.backend.connection.client.connect - rescue => e + rescue return false end true diff --git a/activejob/test/support/integration/adapters/resque.rb b/activejob/test/support/integration/adapters/resque.rb index 9de3e7c879..82acb17b2b 100644 --- a/activejob/test/support/integration/adapters/resque.rb +++ b/activejob/test/support/integration/adapters/resque.rb @@ -41,7 +41,7 @@ module ResqueJobsManager def can_run? begin Resque.redis.client.connect - rescue => e + rescue return false end true diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb index 0a0a549c9e..3cc9a34993 100644 --- a/activejob/test/support/integration/adapters/sidekiq.rb +++ b/activejob/test/support/integration/adapters/sidekiq.rb @@ -49,7 +49,7 @@ module SidekiqJobsManager def can_run? begin Sidekiq.redis { |conn| conn.connect } - rescue => e + rescue return false end true diff --git a/activejob/test/support/integration/adapters/sneakers.rb b/activejob/test/support/integration/adapters/sneakers.rb index f21bb38a32..875803a2d8 100644 --- a/activejob/test/support/integration/adapters/sneakers.rb +++ b/activejob/test/support/integration/adapters/sneakers.rb @@ -68,7 +68,7 @@ module SneakersJobsManager def can_run? begin bunny_publisher - rescue => e + rescue return false end true diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index b12d048169..e0e107e89d 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* `AR::UnknownAttributeError` now includes the class name of a record. + + User.new(name: "Yuki Nishijima", project_attributes: {name: "kaminari"}) + # => ActiveRecord::UnknownAttributeError: unknown attribute 'name' for User. + + *Yuki Nishijima* + * Fix regression causing `after_create` callbacks to run before associated records are autosaved. diff --git a/activerecord/lib/active_record/errors.rb b/activerecord/lib/active_record/errors.rb index 52c70977ef..5b3fdf16f5 100644 --- a/activerecord/lib/active_record/errors.rb +++ b/activerecord/lib/active_record/errors.rb @@ -167,7 +167,7 @@ module ActiveRecord def initialize(record, attribute) @record = record @attribute = attribute.to_s - super("unknown attribute: #{attribute}") + super("unknown attribute '#{attribute}' for #{@record.class}.") end end diff --git a/activerecord/lib/active_record/relation/merger.rb b/activerecord/lib/active_record/relation/merger.rb index ac41d0aa80..545bf5debc 100644 --- a/activerecord/lib/active_record/relation/merger.rb +++ b/activerecord/lib/active_record/relation/merger.rb @@ -13,7 +13,7 @@ module ActiveRecord @hash = hash end - def merge + def merge #:nodoc: Merger.new(relation, other).merge end diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 7ca7349528..c3e8ceb0da 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -736,11 +736,11 @@ class AttributeMethodsTest < ActiveRecord::TestCase def test_bulk_update_raise_unknown_attribute_error error = assert_raises(ActiveRecord::UnknownAttributeError) { - @target.new(:hello => "world") + Topic.new(hello: "world") } - assert_instance_of @target, error.record + assert_instance_of Topic, error.record assert_equal "hello", error.attribute - assert_equal "unknown attribute: hello", error.message + assert_equal "unknown attribute 'hello' for Topic.", error.message end def test_methods_override_in_multi_level_subclass |