governor_comments 0.2.2 → 0.2.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ./
3
3
  specs:
4
- governor_comments (0.2.2)
4
+ governor_comments (0.2.3)
5
5
  governor (>= 0.5.0)
6
6
  rails (~> 3.0.5)
7
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -10,13 +10,12 @@ module Governor
10
10
  helper Governor::Controllers::Helpers
11
11
 
12
12
  def create
13
- params[:comment][:commenter] = governor_logged_in? ? the_governor : Guest.new(params[:commenter])
14
-
13
+ params[:comment][:commenter] = governor_logged_in? ? the_governor : Guest.find_or_create_by_email(params[:comment][:commenter])
15
14
  @comment = resource.comments.new(params[:comment])
16
15
 
17
16
  respond_to do |format|
18
17
  if @comment.save
19
- @comment.update_attribute(:hidden, true) if @comment.respond_to?(:spam) and @comment.spam?
18
+ @comment.update_attribute(:hidden, true) if @comment.respond_to?(:spam?) and @comment.spam?
20
19
  flash[:notice] = 'Your comment was successfully added.'
21
20
  format.html { redirect_to resource }
22
21
  format.xml { render :xml => @comment, :status => :created, :location => @comment }
@@ -1,6 +1,6 @@
1
1
  <%= f.error_messages %>
2
2
  <% if f.object.new_record? && !governor_logged_in? %>
3
- <%= fields_for :commenter, Guest.new do |gf| %>
3
+ <%= f.fields_for :commenter, Guest.new do |gf| %>
4
4
  <%= gf.text_field :name %> <%= gf.label :name, 'Name (required)' %><br/>
5
5
  <%= gf.text_field :email %> <%= gf.label :email, 'E-Mail (required, will not be published)' %><br/>
6
6
  <%= gf.text_field :website %> <%= gf.label :website %><br/>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{governor_comments}
8
- s.version = "0.2.2"
8
+ s.version = "0.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Liam Morley"]
12
- s.date = %q{2011-05-16}
12
+ s.date = %q{2011-05-17}
13
13
  s.description = %q{Comments plugin for the Rails 3-based Governor blogging system.}
14
14
  s.email = %q{liam@carpeliam.com}
15
15
  s.extra_rdoc_files = [
@@ -15,6 +15,7 @@ module GovernorComments
15
15
  base.scope :public, base.where(:hidden => false)
16
16
 
17
17
  base.validates_presence_of :content
18
+ base.validates_presence_of :commenter
18
19
  end
19
20
 
20
21
  def mark_spam
@@ -18,6 +18,8 @@ module Governor
18
18
  assigns[:comment].commenter.should == @user
19
19
  assigns[:article].should == @article
20
20
  end
21
+
22
+ it "looks up returning guests by email"
21
23
  end
22
24
 
23
25
  context "#mark_spam" do
@@ -1,14 +1,14 @@
1
1
  GIT
2
2
  remote: git://github.com/carpeliam/governor.git
3
- revision: df491f9eb8049efd8e7875f1202052272b2f58af
3
+ revision: c1867661afb7659c2bdfa6aee5afda6d2a93c8a3
4
4
  specs:
5
- governor (0.5.2)
6
- rails (~> 3.0.5)
5
+ governor (0.5.7)
6
+ rails (>= 3.0.5)
7
7
 
8
8
  PATH
9
9
  remote: ../..
10
10
  specs:
11
- governor_comments (0.2.2)
11
+ governor_comments (0.2.3)
12
12
  governor (>= 0.5.0)
13
13
  rails (~> 3.0.5)
14
14
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: governor_comments
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Liam Morley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-16 00:00:00 -04:00
18
+ date: 2011-05-17 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency