Sha256: 3ba12548b1fa8566926a467cb0aaf157a30f660162fa540ef8dd929e37dda023

Contents?: true

Size: 731 Bytes

Versions: 32

Compression:

Stored size: 731 Bytes

Contents

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

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

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

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

    def self.ransackable_scopes(*args)
      whitelisted_ransackable_scopes || []
    end
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
spree_core-3.2.9 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.14 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.6 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.8 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.13 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.5 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.4 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.7 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.12 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.3 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.6 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.11 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.10 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.2 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.5 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.9 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.1 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.4 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.8 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.0 app/models/concerns/spree/ransackable_attributes.rb