Sha256: eb403de2aff3ab65fc4a2d5e5241c20ebc43e6862acd601e39c06d8d6e023efd

Contents?: true

Size: 370 Bytes

Versions: 6

Compression:

Stored size: 370 Bytes

Contents

module Unidom::Shopping::Concerns::AsShop

  extend ActiveSupport::Concern

  included do |includer|

    has_many :shopping_carts, class_name: 'Unidom::Shopping::ShoppingCart', as: :shop

    def get_cart!(by: nil, at: Time.now)
      shopping_carts.shopped_by(by).valid_at(now: at).alive.first_or_create! opened_at: at
    end

  end

  module ClassMethods
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
unidom-shopping-1.6.4 app/models/unidom/shopping/concerns/as_shop.rb
unidom-shopping-1.6.3 app/models/unidom/shopping/concerns/as_shop.rb
unidom-shopping-1.6.2 app/models/unidom/shopping/concerns/as_shop.rb
unidom-shopping-1.6.1 app/models/unidom/shopping/concerns/as_shop.rb
unidom-shopping-1.6 app/models/unidom/shopping/concerns/as_shop.rb
unidom-shopping-1.5 app/models/unidom/shopping/concerns/as_shop.rb