Class: BeStrong::StrongParameterMethods::Model
- Inherits:
-
Object
- Object
- BeStrong::StrongParameterMethods::Model
- Defined in:
- lib/be_strong/strong_parameter_methods.rb
Instance Method Summary collapse
- #accessible_attributes ⇒ Object
-
#initialize(name) ⇒ Model
constructor
A new instance of Model.
Constructor Details
#initialize(name) ⇒ Model
Returns a new instance of Model.
18 19 20 |
# File 'lib/be_strong/strong_parameter_methods.rb', line 18 def initialize(name) @klass = name.to_s.classify.constantize end |
Instance Method Details
#accessible_attributes ⇒ Object
22 23 24 25 26 27 |
# File 'lib/be_strong/strong_parameter_methods.rb', line 22 def accessible_attributes accssible = @klass.accessible_attributes return accssible if accssible.size.nonzero? @klass.attribute_names - @klass.protected_attributes.to_a end |