comfy_blog 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -36,8 +36,8 @@ class Blog::Post < ActiveRecord::Base
36
36
 
37
37
  # -- Callbacks ------------------------------------------------------------
38
38
  before_validation :set_slug,
39
- :set_date,
40
- :set_published_at
39
+ :set_published_at,
40
+ :set_date
41
41
  after_save :sync_tags,
42
42
  :sync_categories
43
43
 
@@ -58,8 +58,8 @@ protected
58
58
  end
59
59
 
60
60
  def set_date
61
- self.year ||= Time.zone.now.year
62
- self.month ||= Time.zone.now.month
61
+ self.year = self.published_at.year
62
+ self.month = self.published_at.month
63
63
  end
64
64
 
65
65
  def set_published_at
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "comfy_blog"
8
- s.version = "0.1.7"
8
+ s.version = "0.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov", "The Working Group Inc."]
12
- s.date = "2012-04-12"
12
+ s.date = "2012-05-09"
13
13
  s.description = ""
14
14
  s.email = "oleg@twg.ca"
15
15
  s.extra_rdoc_files = [
@@ -16,12 +16,12 @@ class PostTest < ActiveSupport::TestCase
16
16
 
17
17
  def test_validation_of_slug_uniqueness
18
18
  old_post = blog_posts(:default)
19
- old_post.update_attributes!(:year => Time.now.year, :month => Time.now.month)
19
+ old_post.update_attributes!(:published_at => Time.now)
20
20
  post = Blog::Post.new(:title => old_post.title, :content => 'Test Content')
21
21
  assert post.invalid?
22
22
  assert_has_errors_on post, [:slug]
23
23
 
24
- old_post.update_attributes!(:year => 1.year.ago.year, :month => Time.now.month)
24
+ old_post.update_attributes!(:published_at => 1.year.ago)
25
25
  assert post.valid?
26
26
  end
27
27
 
@@ -45,9 +45,10 @@ class PostTest < ActiveSupport::TestCase
45
45
 
46
46
  def test_set_date
47
47
  post = Blog::Post.new
48
+ post.send(:set_published_at)
48
49
  post.send(:set_date)
49
- assert_equal Time.now.year, post.year
50
- assert_equal Time.now.month, post.month
50
+ assert_equal post.published_at.year, post.year
51
+ assert_equal post.published_at.month, post.month
51
52
  end
52
53
 
53
54
  def test_set_published_at
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfy_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-12 00:00:00.000000000 Z
13
+ date: 2012-05-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -171,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  segments:
173
173
  - 0
174
- hash: 2132240465952250888
174
+ hash: -3059080312658189013
175
175
  required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  none: false
177
177
  requirements: