Sha256: 2d3b50dfabc16de39a494c49b4b21b878a57cb1dcfdb517b155775a608973ea3
Contents?: true
Size: 689 Bytes
Versions: 24
Compression:
Stored size: 689 Bytes
Contents
module ActiveAdmin module ScopeChain private # Scope an ActiveRecord::Relation chain # # Example: # scope_chain(Scope.new(:published), Article) # # => Article.published # # @param scope The <ActiveAdmin::Scope> we want to scope on # @param chain The ActiveRecord::Relation chain or ActiveRecord::Base class to scope # @return <ActiveRecord::Relation or ActiveRecord::Base> The scoped relation chain # def scope_chain(scope, chain) if scope.scope_method chain.public_send scope.scope_method elsif scope.scope_block instance_exec chain, &scope.scope_block else chain end end end end
Version data entries
24 entries across 24 versions & 3 rubygems