instance method attributes_protected_by_default

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18 Private

Available in: v2.2.3 v2.3.18

Signature

attributes_protected_by_default()

The primary key and inheritance column can never be set by mass-assignment for security reasons.

Source
# File activerecord/lib/active_record/base.rb, line 3033
      def attributes_protected_by_default
        default = [ self.class.primary_key, self.class.inheritance_column ]
        default << 'id' unless self.class.primary_key.eql? 'id'
        default
      end

Defined in activerecord/lib/active_record/base.rb line 3033 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Base

Type at least 2 characters to search.

↑↓ navigate · open · esc close