op_cart 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 653b481db89668184d19034686eff0e0b4bc30de
4
- data.tar.gz: a6229db21c23e77e062c3b2530bc5b07572ee8b4
3
+ metadata.gz: ad47e8c3658d30668cbfaf4e1ad60ca64cf5806c
4
+ data.tar.gz: d97883ff84bdc92bf310c5fb40370a07ab995e90
5
5
  SHA512:
6
- metadata.gz: 9dcd00665bbac633e4f6884e534f9124b92f7b4d73d8e29970e06fdb087bb4b9e0c70b4f972845ea95271acbe5e71ed2e8ca53414ef28bf5f0965bc36de93895
7
- data.tar.gz: 76f25b88589462534223144ad586800410a5d3be87402e1ef821c5ce29e43198259d6e49b7314abddffeee90406b0241088db6311efe686be7e6711d260c33ec
6
+ metadata.gz: b9be7bdaf88cb70f5c5880c8eadbdd082f168b2944c8bf6a0b9ef2a7653b926c54a837a7bfb415fe19ec471ce2041075141ab4e00e6e5e9b06e9aaf96bd8bb2d
7
+ data.tar.gz: c746e0aa7b34e09c8ef9d53410a19ea69e0ea6ea9aaad4cfcce7546457e4046b3d440e6a69b5809cf7e6a69932442a3c0d47509d21af3fa7ffc74d1a4cb43e7d
@@ -1,6 +1,7 @@
1
1
  module OpCart
2
2
  class Customer < ActiveRecord::Base
3
3
  has_many :cards
4
+ has_many :subscriptions
4
5
  belongs_to :default_card, class_name: 'OpCart::Card'
5
6
  belongs_to :user
6
7
 
@@ -12,6 +12,9 @@ module OpCart
12
12
  before_validation :set_unit_price
13
13
  before_validation :snapshot_sellable
14
14
 
15
+ scope :products, -> { where sellable_type: 'OpCart::Product' }
16
+ scope :plans, -> { where sellable_type: 'OpCart::Plan' }
17
+
15
18
  def total
16
19
  if sellable.is_a? Plan
17
20
  0
@@ -1,3 +1,3 @@
1
1
  module OpCart
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: op_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Boehs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-09 00:00:00.000000000 Z
11
+ date: 2015-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails