Skip to content

Commit

Permalink
Update deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
martinschaflitzl1 committed Dec 13, 2024
1 parent 449b759 commit ed25cdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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_<value>s is deprecated, use humanized_assignable_<value>s instead", caller)
ActiveSupport::Deprecation.new.warn("humanized_<value>s is deprecated, use humanized_assignable_<value>s instead", caller)
restriction.humanized_assignable_values(self)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/assignable_values/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed25cdd

Please sign in to comment.