Module: Rhino::HasRhino
- Extended by:
- ActiveSupport::Concern
- Included in:
- RhinoModel
- Defined in:
- lib/rhino/concerns/has_rhino.rb
Overview
Main model concern that provides the DSL for configuring query builder options.
Usage:
class Post < ApplicationRecord
include Rhino::HasRhino
rhino_filters :status, :user_id
rhino_sorts :title, :created_at
rhino_default_sort '-created_at'
rhino_includes :user, :comments
rhino_fields :id, :title, :status, :created_at
rhino_search :title, :content, 'user.name'
rhino_per_page 25
rhino_pagination_enabled true
rhino_middleware 'throttle:60,1'
rhino_middleware_actions store: ['verified'], update: ['verified']
rhino_except_actions :destroy
end