retentiongrid 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/retentiongrid/product.rb +7 -4
- data/lib/retentiongrid/version.rb +1 -1
- data/spec/factories/products.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c46c8b19021285df0a40f8227bacc72f2e351244
|
4
|
+
data.tar.gz: 81150b36efc5b8429a71cae3e80a0c03308f5e17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 214c590b5de8447506031dd303fd811480e71068b79c609a7379e8d9d2b568eb0663a74abad8f9565801cf3278fac65a7c9e50528fced47ad0b3f1be4e9378df
|
7
|
+
data.tar.gz: 001b8861a1af6f4b796f86b0077cda67cc3117415061dc8992ba75fe86e12ad8c41b3d05a5b319c084442113b619c8986743e9730f80940f4648f543bf276cf5
|
@@ -7,7 +7,7 @@ module Retentiongrid
|
|
7
7
|
ATTRIBUTES_NAMES = [ :product_id, :available, :metadata,
|
8
8
|
:title, :image_url, :currency, :price,
|
9
9
|
:sale_price, :cost_price, :product_url,
|
10
|
-
:product_created_at, :product_updated_at, :
|
10
|
+
:product_created_at, :product_updated_at, :metadata
|
11
11
|
].freeze
|
12
12
|
|
13
13
|
ATTRIBUTES_NAMES.each do |attrib|
|
@@ -16,11 +16,14 @@ module Retentiongrid
|
|
16
16
|
|
17
17
|
def initialize(attribs={})
|
18
18
|
super
|
19
|
-
|
20
|
-
|
19
|
+
if product_created_at.class == "String" && !product_created_at.nil?
|
20
|
+
@product_created_at = Time.parse(product_created_at)
|
21
|
+
end
|
22
|
+
if @product_updated_at.class == "String" && !product_updated_at.nil?
|
23
|
+
@product_updated_at = Time.parse(product_updated_at)
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
|
-
|
24
27
|
# API Stuff here
|
25
28
|
|
26
29
|
# Find a product with given id
|
data/spec/factories/products.rb
CHANGED
@@ -15,7 +15,7 @@ FactoryGirl.define do
|
|
15
15
|
image_url 'http://example.com/images/1.png'
|
16
16
|
product_updated_at { Time.now - 86400 }
|
17
17
|
product_created_at { Time.now - 161024 }
|
18
|
-
|
18
|
+
metadata { Hash.new(
|
19
19
|
type: "red",
|
20
20
|
region: "napa valley",
|
21
21
|
country: "USA",
|