Module: Cathode::Action::RequiresCustomActionForSingular

Defined in:
lib/cathode/action.rb

Overview

Requires the resource to define custom action behavior if it is a singular resource.

Instance Method Summary collapse

Instance Method Details

#after_resource_initializedObject

Raises an error if the resource is singular and attempting to use the default action without a parent resource



188
189
190
191
192
193
194
195
# File 'lib/cathode/action.rb', line 188

def after_resource_initialized
  if resource.singular && !overridden? && resource.parent.nil?
    raise Cathode::ActionBehaviorMissingError,
      "Can't use default :#{name} action on singular resource `#{resource.name}'"
  end

  super
end