Sha256: 974a325f8f59ea847e28af4512ecf69c307cb1bb9cca5c9db54e89e598835711

Contents?: true

Size: 598 Bytes

Versions: 34

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

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

34 entries across 34 versions & 2 rubygems

Version Path
solidus_core-2.8.6 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.6.6 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.7.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.8.5 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.7.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.6.5 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.8.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.8.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.7.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.6.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.8.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.8.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.6.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.8.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.7.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-2.6.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core_devise_token_auth-2.8.0.alpha.14 app/models/concerns/spree/ransackable_attributes.rb
solidus_core_devise_token_auth-2.8.0.alpha.13 app/models/concerns/spree/ransackable_attributes.rb
solidus_core_devise_token_auth-2.8.0.alpha.12 app/models/concerns/spree/ransackable_attributes.rb
solidus_core_devise_token_auth-2.8.0.alpha.11 app/models/concerns/spree/ransackable_attributes.rb