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.3.0.rc4 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.0.rc3 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.7 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.3 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.2 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.0.rc2 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.1.6 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.3.0.rc1 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.1 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.0 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.0.rc3 app/models/concerns/spree/ransackable_attributes.rb
spree_core-3.2.0.rc2 app/models/concerns/spree/ransackable_attributes.rb