instance method
protected_environments=
Ruby on Rails edge
Since v5.1.7Signature
protected_environments=(environments)
Sets an array of names of environments where destructive actions should be prohibited.
Parameters
-
environmentsreq
Source
# File activerecord/lib/active_record/model_schema.rb, line 343
def protected_environments=(environments)
ActiveRecord.deprecator.warn <<~MSG
ActiveRecord::Base.protected_environments= is deprecated in favor of
ActiveRecord.protected_environments= and will be removed in Rails 9.0.
MSG
if self == ActiveRecord::Base
ActiveRecord.protected_environments = environments
else
@protected_environments = environments.map(&:to_s)
end
end
Defined in activerecord/lib/active_record/model_schema.rb line 343
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ModelSchema::ClassMethods