blog_logic 1.1.1 → 1.1.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
data/app/models/post.rb CHANGED
@@ -93,7 +93,7 @@ class Post
93
93
  end
94
94
 
95
95
  def publish!
96
- self.update_attributes(:state => 'published', :publication_date => Time.zone.now)
96
+ self.update_attributes :state => 'published', :published_at => Time.zone.now
97
97
  end
98
98
 
99
99
  def published?
@@ -109,7 +109,7 @@ class Post
109
109
  end
110
110
 
111
111
  def unpublish!
112
- self.update_attributes :state => 'draft', :publication_date => nil
112
+ self.update_attributes :state => 'draft'
113
113
  end
114
114
 
115
115
  def state=(arg)
data/blog_logic.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "blog_logic"
8
- s.version = "1.1.1"
8
+ s.version = "1.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bantik"]
@@ -1,7 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  describe Post do
4
-
5
4
  before :all do
6
5
  @blog = Blog.make
7
6
  end
@@ -11,11 +10,11 @@ describe Post do
11
10
  end
12
11
 
13
12
  it 'returns its relative URL' do
14
- @blog.posts.new(:slug => 'foo').full_path.should == "/my-blog/foo/"
13
+ @blog.posts.new(:slug => 'foo').full_path.should == '/my-blog/foo/'
15
14
  end
16
15
 
17
16
  it 'returns its formatted slug' do
18
- @blog.posts.new(:slug => 'foo').humanize_path.should == "/foo/"
17
+ @blog.posts.new(:slug => 'foo').humanize_path.should == '/foo/'
19
18
  end
20
19
 
21
20
  it 'publishes, setting its publication date' do
@@ -30,7 +29,6 @@ describe Post do
30
29
  post.publish!
31
30
  post.unpublish!
32
31
  post.status.should == 'Draft'
33
- post.publication_date.nil?.should be_true
34
32
  end
35
33
 
36
34
  it 'defaults its desired slug to its title' do
@@ -42,5 +40,4 @@ describe Post do
42
40
  post.save.should be_true
43
41
  post.slug.should == 'test-post'
44
42
  end
45
-
46
43
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blog_logic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bantik