Sha256: 9dc4017908b4ac114a0604718e325f756e1476c52e49326d7ded8b1a73927deb

Contents?: true

Size: 768 Bytes

Versions: 2

Compression:

Stored size: 768 Bytes

Contents

# SerializedAttributes is deprecated in Rails 4.2.x, and will be removed in
#   Rails 5. Draftsman spews a ton of deprecation warnings about this issue.
#
#   More info: https://github.com/airblade/paper_trail/issues/416
#
# TODO: when migrating to Rails 5, remove this initializer

if Draftsman::VERSION.to_f < 1.0
  current_behavior = ActiveSupport::Deprecation.behavior
  ActiveSupport::Deprecation.behavior = lambda do |message, callstack|
    return if message =~ /`serialized_attributes` is deprecated without replacement/ && callstack.any? { |m| m =~ /draftsman/ }
    Array.wrap(current_behavior).each { |behavior| behavior.call(message, callstack) }
  end
else
  warn 'FIXME: Draftsman initializer to suppress deprecation warnings can be safely removed.'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
draftsman-0.4.0 spec/support/silence_serialized_attributes_deprecation.rb
draftsman-0.3.7 spec/support/silence_serialized_attributes_deprecation.rb