Sha256: 417b1a32e256052506e441ec5aca9bfe2b33d6bab3f9efe0f870fcd94cff21c6

Contents?: true

Size: 381 Bytes

Versions: 3

Compression:

Stored size: 381 Bytes

Contents

ActiveRecord::Base.send(:attr_accessible, nil)

unless Rails.env.production?
  module ActiveModel
    class MassAssignmentError < StandardError; end
  end

  ActiveModel::MassAssignmentSecurity::Sanitizer.class_eval do
    def warn!(attributes)
      raise ActiveModel::MassAssignmentError, "Can't mass-assign these protected attributes: #{attributes.join(', ')}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bento-0.0.3 spec/rails_app/config/initializers/inaccessible_attributes.rb
bento-0.0.2 spec/rails_app/config/initializers/inaccessible_attributes.rb
bento-0.0.1 spec/rails_app/config/initializers/inaccessible_attributes.rb