Module: Effective::EffectiveDatatable::Dsl::Scopes
- Included in:
- Datatable
- Defined in:
- app/models/effective/effective_datatable/dsl/scopes.rb
Instance Method Summary collapse
-
#scope(name, default, options = {}, &block) ⇒ Object
Instance Methods inside the scopes do ..
Instance Method Details
#scope(name, default, options = {}, &block) ⇒ Object
Instance Methods inside the scopes do .. end block
6 7 8 9 10 11 12 13 14 |
# File 'app/models/effective/effective_datatable/dsl/scopes.rb', line 6 def scope(name, default, = {}, &block) if block_given? raise "You cannot use partial: ... with the block syntax" if [:partial] [:block] = block end # This needs to be a {} not WithIndifferentAccess or rendering _scopes won't work correctly (@scopes ||= {})[name] = .merge(default: default) end |