diff --git a/lib/assignable_values/active_record/restriction/scalar_attribute.rb b/lib/assignable_values/active_record/restriction/scalar_attribute.rb index 6ec40af..75fd1b1 100644 --- a/lib/assignable_values/active_record/restriction/scalar_attribute.rb +++ b/lib/assignable_values/active_record/restriction/scalar_attribute.rb @@ -88,7 +88,7 @@ def define_humanized_assignable_values_instance_method unless multiple define_method :"humanized_#{restriction.property.to_s.pluralize}" do - ActiveSupport::Deprecation.warn("humanized_s is deprecated, use humanized_assignable_s instead", caller) + ActiveSupport::Deprecation.new.warn("humanized_s is deprecated, use humanized_assignable_s instead", caller) restriction.humanized_assignable_values(self) end end diff --git a/spec/assignable_values/active_record_spec.rb b/spec/assignable_values/active_record_spec.rb index 5d8dc98..953c9b6 100644 --- a/spec/assignable_values/active_record_spec.rb +++ b/spec/assignable_values/active_record_spec.rb @@ -1277,7 +1277,7 @@ def genres %w[pop rock] end end - ActiveSupport::Deprecation.should_receive(:warn) + expect_any_instance_of(ActiveSupport::Deprecation).to receive(:warn) genres = klass.new.humanized_genres genres.collect(&:humanized).should == ['Pop music', 'Rock music'] end