Module: LetMeMassAssignProtectedAttributes::ClassMethods

Defined in:
lib/let_me_mass_assign_protected_attributes.rb

Instance Method Summary collapse

Instance Method Details

#unprotected_create(attributes = {}) ⇒ Object

The same as a normal create, only it lets you initialize/set attr_protected attributes



27
28
29
# File 'lib/let_me_mass_assign_protected_attributes.rb', line 27

def unprotected_create(attributes = {})
  create(attributes, without_protection: true)
end

#unprotected_create!(attributes = {}) ⇒ Object



31
32
33
# File 'lib/let_me_mass_assign_protected_attributes.rb', line 31

def unprotected_create!(attributes = {})
  create!(attributes, without_protection: true)
end

#unprotected_new(attributes = {}) ⇒ Object

The same as a normal new, only it lets you initialize/set attr_protected attributes



22
23
24
# File 'lib/let_me_mass_assign_protected_attributes.rb', line 22

def unprotected_new(attributes = {})
  new(attributes, without_protection: true)
end