homesteading_helpers 0.0.7 → 0.0.8

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: 4673975a53fd80bcfcf2ecf63c7093afa762b24e
4
- data.tar.gz: b5ed5b75da3713de268ed7c93eaafeb2c4697b8c
3
+ metadata.gz: 09f96e4b8f77fed1ab53a1682d7c0b01e1fc7b72
4
+ data.tar.gz: 5d41361f710e70b3f6a0ac16294bf611f9eeda50
5
5
  SHA512:
6
- metadata.gz: 49a1acd3ab54d3813cdecc37e428f21d9d167b7e3e6e5c3dbb3df4d6717a0fe4c9ee49219f96e04d25cd9cd8c2fc8566f42ea4c3efcc1c3d7025a6fb97519eed
7
- data.tar.gz: 043d7d98c95384c765fbaaac5929b5c47112e7beeea84cb21147d8a0b803bee4ff273d2230328222c9cc6963b8378a46105666c6dc42324c7371037a42fbcbc3
6
+ metadata.gz: e251bfe777cb9da15ea81727aaf6c05f43e3c8fd8a18386a64811cf4451d6ef4e46eae4dc4457b9ff955a1042e3eaffd42f0e6fa73a5c73457e1deb5d3be8917
7
+ data.tar.gz: 326390ae570e83000b5a3c6cc857cc4656726490122bbb95577e4417d81b302ec7662c1db3d4f6ced2ec0cf46e3f3fdaa9087c6bbb95950a69e5befd11dca3c4
@@ -23,11 +23,13 @@ module HomesteadingHelpers
23
23
  end
24
24
 
25
25
  def nth_of_day(post)
26
- if post.is_a?(Note)
27
- nth = Note.where(year: post.year,
28
- month: post.month,
29
- day: post.day).all.sort_by{|n| n.published_at}.index(post) + 1
30
- else
26
+ nth = post.class.constantize.where(
27
+ year: post.year,
28
+ month: post.month,
29
+ day: post.day
30
+ ).all.sort_by{|n| n.published_at}.index(post) + 1
31
+
32
+ if nth.nil?
31
33
  nth = 1
32
34
  end
33
35
 
@@ -1,3 +1,3 @@
1
1
  module HomesteadingHelpers
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homesteading_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker