Sha256: 40a4c6e4176274fc4e17b400dd20ab628d044e93413282a0fa0c92b8e17f4a40

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

ARH_INITIALIZER = proc{
  ActiveHashRelation.configure do |config|
    #override default scope when accessing associations
    config.use_unscoped = true
    #set true to be able to filter scopes (with params)
    #please note that unfortunately (:/) rails does not provide any way
    #to iterate through scopes so it uses a monkey patch.
    #The monkey patch is as gentle as it can be by aliasing the method, adds some
    #sugar and calls it
    #You need to run `initialize!` to actually include the required files
    config.filter_active_record_scopes = true
  end

  #requires monkeyparched scopes, optional if you don't enable them
  ActiveHashRelation.initialize!
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_hash_relation-1.4.1 spec/config/initializers/active_hash_relation.rb
active_hash_relation-1.4.0 spec/config/initializers/active_hash_relation.rb
active_hash_relation-1.2.0 spec/config/initializers/active_hash_relation.rb