Sha256: ba535b8fced58615beae7e02db153b279290d2da73e93d29fb3cafea1651fea2

Contents?: true

Size: 566 Bytes

Versions: 42

Compression:

Stored size: 566 Bytes

Contents

module Spree::RansackableAttributes
  extend ActiveSupport::Concern
  included do
    class_attribute :whitelisted_ransackable_associations
    class_attribute :whitelisted_ransackable_attributes

    class_attribute :default_ransackable_attributes
    self.default_ransackable_attributes = %w[id name]

    def self.ransackable_associations(*args)
      self.whitelisted_ransackable_associations || []
    end

    def self.ransackable_attributes(*args)
      self.default_ransackable_attributes | (self.whitelisted_ransackable_attributes || [])
    end
  end

end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
solidus_core-1.2.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.1.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.0.7 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.5 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.4 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.3 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.2 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.0.10 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.1 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.0 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.0.rc4 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.0.9 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.0.rc3 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.0.rc2 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.0.rc1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.0.6 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.0.8 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.2.2 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.0.7 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.2.1 app/models/concerns/spree/ransackable_attributes.rb