piggybak_coupons 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/piggybak_coupons/coupon.rb +2 -2
- data/lib/piggybak_coupons/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3df55b6e42116f2eb04adc11ed96a53f054c12
|
4
|
+
data.tar.gz: 164215bbe1f00b066dffea34056bc3361be8fbcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502503bfd772f4c0f3f71fb860da57ec2a7c92756b1fc00e2e7db99dfd313a110f21487bf0409b8ab1bc3873fe0722d78dabac70b580774fa1c7ac510cb469c6
|
7
|
+
data.tar.gz: 2eb1a56459e8a0e516e5e11fc61c1049c40f27e98b6143ca543d1063b10d2e98f351ac24e6d3076f58c287a7a749cfab0d050bbc865a0686d6a888ba2fb392fc
|
@@ -43,7 +43,7 @@ module PiggybakCoupons
|
|
43
43
|
|
44
44
|
def self.valid_coupon(code, object, already_applied)
|
45
45
|
# First check
|
46
|
-
coupon = Coupon.
|
46
|
+
coupon = Coupon.where(code: code).first
|
47
47
|
return "Invalid coupon code." if coupon.nil?
|
48
48
|
|
49
49
|
# Expiration date check
|
@@ -64,7 +64,7 @@ module PiggybakCoupons
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def self.apply_discount(code, object, shipcost = 0.0)
|
67
|
-
coupon = Coupon.
|
67
|
+
coupon = Coupon.where(code: code).first
|
68
68
|
return 0 if coupon.nil?
|
69
69
|
|
70
70
|
if coupon.discount_type == "$"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggybak_coupons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steph Skardal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Coupon support for Piggybak.
|
14
14
|
email:
|