Warn about deprecation via ActiveSupport

This commit is contained in:
Maikel Linke
2019-01-10 12:26:48 +11:00
parent c3029c612a
commit c6393b6077

View File

@@ -316,15 +316,22 @@ namespace :ofn do
if EnterpriseRole.count < 1
EnterpriseRole.create!(user: Spree::User.first, enterprise: enterprise2)
end
puts <<WARNING
display_deprecation_warning
end
Warning: This task is going to be replaced by:
def display_deprecation_warning
behaviour = ActiveSupport::Deprecation.behavior = :stderr
ActiveSupport::Deprecation.behavior = :stderr
ActiveSupport::Deprecation.warn(<<WARNING)
This task is going to be replaced by:
$ bundle exec rake openfoodnetwork:sample_data
It contains more sample data.
WARNING
ActiveSupport::Deprecation.behavior = behaviour
end
end
end