Skip to content

Commit

Permalink
Make friendly_id be quiet; see norman/friendly_id#816
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Apr 13, 2018
1 parent 76734bd commit cbc42a2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/support/disable_friendly_id_deprecation_warnings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default_deprecation_behaviours = ActiveSupport::Deprecation.behavior
ActiveSupport::Deprecation.behavior = ->(message, callstack) {
if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR > 1
raise "Remove friendly_id deprecation silencing patch!"
end
unless callstack.find { |l| l.path =~ /gems\/friendly_id/ } &&
message =~ /The behavior of .* inside of after callbacks will be changing/
default_deprecation_behaviours.each { |b| b.call(message, callstack) }
end
}

0 comments on commit cbc42a2

Please sign in to comment.