wheelhouse-blog 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/app/models/blog/archive.rb +5 -5
  2. metadata +2 -2
@@ -17,7 +17,7 @@ class Blog::Archive
17
17
  end
18
18
 
19
19
  def path
20
- @blog.path(year, month)
20
+ @blog.archive_path(year, month)
21
21
  end
22
22
 
23
23
  def posts
@@ -33,11 +33,11 @@ class Blog::Archive
33
33
  end
34
34
 
35
35
  def to_date
36
- Date.new(year, month, 1)
36
+ Date.new(year, month || 1, 1)
37
37
  end
38
38
 
39
39
  def <=>(other)
40
- other.to_date <=> to_date
40
+ to_date <=> other.to_date
41
41
  end
42
42
 
43
43
  def self.from_mongo(blog, hash)
@@ -51,7 +51,7 @@ class Blog::Archive
51
51
 
52
52
  group(blog.posts, :key => options[:group]).map { |hash|
53
53
  Blog::Archive.from_mongo(blog, hash)
54
- }.sort
54
+ }.sort.reverse
55
55
  end
56
56
 
57
57
  # Backwards-compatiblity with old-style archives
@@ -61,7 +61,7 @@ class Blog::Archive
61
61
 
62
62
  private
63
63
  def valid_month?
64
- month > 0 && month < 12
64
+ (1..12).cover?(month)
65
65
  end
66
66
 
67
67
  def self.group(base, options={})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wheelhouse-blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000 Z
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: wheelhouse