module ActiveRecord::MassAssignmentSecurity::Core

Public Class Methods

new(attributes = nil, options = {}) { |self| ... } click to toggle source
# File lib/active_record/mass_assignment_security/core.rb, line 5
def initialize(attributes = nil, options = {})
  @new_record = true
  self.class.define_attribute_methods
  @attributes = self.class._default_attributes.deep_dup

  init_internals
  initialize_internals_callback

  # +options+ argument is only needed to make protected_attributes gem easier to hook.
  init_attributes(attributes, options) if attributes

  yield self if block_given?
  _run_initialize_callbacks
end

Private Instance Methods

init_attributes(attributes, options) click to toggle source
# File lib/active_record/mass_assignment_security/core.rb, line 22
def init_attributes(attributes, options)
  assign_attributes(attributes, options)
end
init_internals() click to toggle source
Calls superclass method
# File lib/active_record/mass_assignment_security/core.rb, line 26
def init_internals
  super
  @mass_assignment_options = nil
end