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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c233cce940a101a06c7b19a6a11cddf25f17c9f3
4
- data.tar.gz: 01a156f8c4297f23faaba247bbeb3105fa1af85e
3
+ metadata.gz: aa3df55b6e42116f2eb04adc11ed96a53f054c12
4
+ data.tar.gz: 164215bbe1f00b066dffea34056bc3361be8fbcd
5
5
  SHA512:
6
- metadata.gz: 459b281dd14ab514208b782a636661c93cc5e22e6f071091d1330f839550b4623221bab2e0d39852084423847e26b2397eed745cfcdb0f7a24b8d78d603224f9
7
- data.tar.gz: 0d707e678d5a0679b847918a653a41a764d4134eb23b7341bb7cd19723b0cc4f53930287ce143f043197f5371bf6284ab23f3c6cc38ce459c19662c8b9a04711
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.find_by_code(code)
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.find_by_code(code)
67
+ coupon = Coupon.where(code: code).first
68
68
  return 0 if coupon.nil?
69
69
 
70
70
  if coupon.discount_type == "$"
@@ -1,3 +1,3 @@
1
1
  module PiggybakCoupons
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-03-27 00:00:00.000000000 Z
11
+ date: 2014-04-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Coupon support for Piggybak.
14
14
  email: