Class: Cuprum::Rails::Actions::Middleware::Associations::Parent

Inherits:
Query show all
Defined in:
lib/cuprum/rails/actions/middleware/associations/parent.rb

Overview

Middleware for querying a parent association from a parameter.

Instance Attribute Summary

Attributes inherited from Query

#association, #association_type

Attributes inherited from Cuprum::Rails::Action

#options, #repository, #request

Instance Method Summary collapse

Methods inherited from Cuprum::Rails::Action

#call, #params

Constructor Details

#initialize(**association_params) ⇒ Parent

Returns a new instance of Parent.

Parameters:

  • association_params (Hash)

    parameters to pass to the association.



13
14
15
16
17
18
# File 'lib/cuprum/rails/actions/middleware/associations/parent.rb', line 13

def initialize(**association_params)
  super(
    association_type: :belongs_to,
    **association_params
  )
end