Module: CouchPotato::ForbiddenAttributesProtection

Defined in:
lib/couch_potato/forbidden_attributes_protection.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/couch_potato/forbidden_attributes_protection.rb', line 3

def self.included(base)
  base.class_eval do
    if defined?(ActiveModel::ForbiddenAttributesProtection)
      include ActiveModel::ForbiddenAttributesProtection

      def attributes=(attributes)
        super sanitize_for_mass_assignment(attributes)
      end
    end
  end
end