Sha256: a29e9b644beda3d9eaf92773e7bb906f5a226562da058eee7bcf13bed9c861c3

Contents?: true

Size: 567 Bytes

Versions: 43

Compression:

Stored size: 567 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]
  end

  class_methods do
    def ransackable_associations(*_args)
      whitelisted_ransackable_associations || []
    end

    def ransackable_attributes(*_args)
      default_ransackable_attributes | (whitelisted_ransackable_attributes || [])
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
solidus_core-2.5.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.5.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.5.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.5.0.rc1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.5.0.beta2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.5.0.beta1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.4.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.3.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.4.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.2.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.1.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.0.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.4.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-1.3.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.4.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.4.0.rc1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.4.0.beta1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.3.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.3.0.rc3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.3.0.rc2 app/models/concerns/spree/ransackable_attributes.rb