Sha256: aa5368b79603aae11f9db921eb5f9c49004b93f7bd540e72b2fe471e03641bb6

Contents?: true

Size: 971 Bytes

Versions: 3

Compression:

Stored size: 971 Bytes

Contents

module Spree
  Store.class_eval do
    has_and_belongs_to_many :products, join_table: 'spree_products_stores'
    has_many :taxonomies
    has_many :orders

    has_many :store_payment_methods
    has_many :payment_methods, through: :store_payment_methods

    has_many :store_shipping_methods
    has_many :shipping_methods, through: :store_shipping_methods

    has_and_belongs_to_many :promotion_rules, class_name: 'Spree::Promotion::Rules::Store', join_table: 'spree_promotion_rules_stores', association_foreign_key: 'promotion_rule_id'

    has_attached_file :logo,
      styles: { mini: '48x48>', small: '100x100>', medium: '250x250>' },
      default_style: :medium,
      url: 'stores/:id/:style/:basename.:extension',
      path: 'stores/:id/:style/:basename.:extension',
      convert_options: { all: '-strip -auto-orient' }

      validates_attachment_file_name :logo, matches: [/png\Z/i, /jpe?g\Z/i],
        if: -> { respond_to?(:logo_file_name) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_multi_domain-1.0.3 app/models/spree/store_decorator.rb
solidus_multi_domain-1.0.1 app/models/spree/store_decorator.rb
solidus_multi_domain-1.0.0 app/models/spree/store_decorator.rb