Module: AgentCode::HasAgentCode
- Extended by:
- ActiveSupport::Concern
- Included in:
- AgentCodeModel
- Defined in:
- lib/agentcode/concerns/has_agentcode.rb
Overview
Main model concern that provides the DSL for configuring query builder options.
Usage: class Post < ApplicationRecord include AgentCode::HasAgentCode
agentcode_filters :status, :user_id
agentcode_sorts :title, :created_at
agentcode_default_sort '-created_at'
agentcode_includes :user, :comments
agentcode_fields :id, :title, :status, :created_at
agentcode_search :title, :content, 'user.name'
agentcode_per_page 25
agentcode_pagination_enabled true
agentcode_middleware 'throttle:60,1'
agentcode_middleware_actions store: ['verified'], update: ['verified']
agentcode_except_actions :destroy
end