Sha256: 4b2b3fdff3bcfac20f6ae98fec81a2ce14ef682f48326ca7909ed61d28426d1f

Contents?: true

Size: 726 Bytes

Versions: 23

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

module Spree::RansackableAttributes
  extend ActiveSupport::Concern
  included do
    class_attribute :allowed_ransackable_associations, default: []
    class_attribute :allowed_ransackable_attributes, default: []
    class_attribute :allowed_ransackable_scopes, default: []
    class_attribute :default_ransackable_attributes
    self.default_ransackable_attributes = %w[id]
  end

  class_methods do
    def ransackable_associations(*_args)
      allowed_ransackable_associations
    end

    def ransackable_attributes(*_args)
      default_ransackable_attributes | allowed_ransackable_attributes
    end

    def ransackable_scopes(*_args)
      allowed_ransackable_scopes
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
solidus_core-4.4.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.4.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.3.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.2.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.1.5 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.3.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.3.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.1.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.3.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.3.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.2.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.1.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.0.4 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.0.3 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.1.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.2.2 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.2.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.2.0 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.1.1 app/models/concerns/spree/ransackable_attributes.rb
solidus_core-4.0.2 app/models/concerns/spree/ransackable_attributes.rb