estore_conventions 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGM4Y2Y4MjZjOWRkYjU1M2U1MTYwODVlOGUyZTg2ODZmNTIxYzgzZQ==
4
+ ZTkzNzViMjU2NjhmZDgzMjJiMjZmZGMyZDJjNzMxMDBlMjU3NzlkMA==
5
5
  data.tar.gz: !binary |-
6
- NTMwMmZhZDYzNjljNmEyZDM4YTM0ZWVmYjFjNjg1NTk4NTg1NTEzOQ==
6
+ NzJiZmYyOWFiMDUxYzMzODYzOGFiMjc5ODBhMDk2YWZlNGI2ZTQ1OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDBkODQ2ZDc0MDExZjNkNWIzNzYyMGZjYjFkZjE1ODcxYTY3NGJmZmZmYTli
10
- OGY5NjdiNDhjMTJkMjM3NmJkNjA4OTY4MDA2ZDcxNTZjYjhkNjdhNTJhYzFm
11
- Njg1MDZiYzkyOWZhNTFiNTNiMzk3NmM1Mzk5MTUyZjljMDFiNGY=
9
+ MTY1Mjg5M2UwNGU1ZGVmMWJmYmJlMmMwYzc4NDk5MzVlYzEyNDA2OTRjZDc0
10
+ YzIyOTNhZjVmYTM5NTc0OTU4NDQ0MzE1NWYzYTVlZTAxMmE5MzAyNTQ1NWEx
11
+ NjRhOTBlMjgzNmQ2M2FiNTE4ODAzOTJhY2NiZjZmZjUxMzU2NWE=
12
12
  data.tar.gz: !binary |-
13
- MzA3ZTQ5Y2MyZmE4NGJmNTNkZjEzMmMyMTk2YTg3ZDZhM2Q5MjNlMjIxY2E2
14
- NzY3NWQ0NjdjOTQ5NDFiODUwZGE4ZmE3ZTMyYmY0MjM3NDY0YmIwNmJlMTE3
15
- NWM4NzY3OWY2Y2E0YTY5NzE0MGNkMGMzYTA3YmUzYzJkYWJjZGM=
13
+ ZDk0MzMzOThlNDhhYmE0Y2UzNTEzNDQyZWRkM2I4YWZlMzgzNWM3MjFhZDY3
14
+ ZWVkZDU3NGEyZWFhNjc3Y2I3ODYxNGNjM2Y5YjIwZDkxN2Q3ZjNmZWIzY2Fm
15
+ ZDk5N2Q3OGI4NDQ2YWM1ZTlkZTExYmIyYjQ1YzdjNjlmMzYzYzg=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "estore_conventions"
8
- s.version = "0.1.8"
8
+ s.version = "0.1.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Callahan"]
@@ -36,31 +36,29 @@ module EstoreConventions
36
36
 
37
37
  end
38
38
 
39
- module InstanceMethods
40
- def archived_attribute(attribute, time_frame=(30.days))
41
- # normalize time since we are returning today as a whole day
42
- time_frame = (DateTime.now + 1.day).beginning_of_day - time_frame
39
+ def archived_attribute(attribute, time_frame=(30.days))
40
+ # normalize time since we are returning today as a whole day
41
+ time_frame = (DateTime.now + 1.day).beginning_of_day - time_frame
43
42
 
44
- # transform papertrail objects to reify objects
45
- a = self.versions.map {|v| v.reify }
43
+ # transform papertrail objects to reify objects
44
+ a = self.versions.map {|v| v.reify }
46
45
 
47
- # get rid of nil first version
48
- a.compact!
46
+ # get rid of nil first version
47
+ a.compact!
49
48
 
50
- # add the current object to the array
51
- a << self
49
+ # add the current object to the array
50
+ a << self
52
51
 
53
- # weed out old entries
54
- a.delete_if {|x| x.rails_updated_at <= time_frame }
52
+ # weed out old entries
53
+ a.delete_if {|x| x.rails_updated_at <= time_frame }
55
54
 
56
- # sort hash based on key
57
- a.sort_by!{|x| x.rails_updated_at }
55
+ # sort hash based on key
56
+ a.sort_by!{|x| x.rails_updated_at }
58
57
 
59
- # transform reify objects into hash of {date => value}
60
- a.reduce({}) do |hsh,val|
61
- hsh[val.rails_updated_at.strftime('%Y-%m-%d')] = val.send(attribute)
62
- hsh
63
- end
58
+ # transform reify objects into hash of {date => value}
59
+ a.reduce({}) do |hsh,val|
60
+ hsh[val.rails_updated_at.strftime('%Y-%m-%d')] = val.send(attribute)
61
+ hsh
64
62
  end
65
63
  end
66
64
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: estore_conventions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Callahan