Module: Cathode::Action::RequiresStrongParams

Defined in:
lib/cathode/action.rb

Overview

Requires that the action has an attributes block defined or one is defined at the resource level

Instance Method Summary collapse

Instance Method Details

#after_resource_initializedObject

Raises an error if there is no attributes block defined



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/cathode/action.rb', line 112

def after_resource_initialized
  if strong_params.nil?
    if resource.strong_params.present?
      @strong_params = resource.strong_params
    else
      fail UnknownAttributesError, "An attributes block was not specified for `#{name}' action on resource `#{resource.name}'"
    end
  end

  super
end