sunrise-comments 0.1.0 → 0.1.1

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.
@@ -1,5 +1,6 @@
1
1
  class CommentsController < ApplicationController
2
2
  before_filter :find_author
3
+ before_filter :build_comment, :only => [:new, :create]
3
4
  before_filter :find_comment, :only => [:edit, :update, :destroy]
4
5
 
5
6
  authorize_resource
@@ -9,16 +10,11 @@ class CommentsController < ApplicationController
9
10
  cache_sweeper :comment_sweeper, :only => [:create, :update, :destroy]
10
11
 
11
12
  def new
12
- @comment = Comment.new
13
- @comment.author = @author
14
13
  respond_with(@comment)
15
14
  end
16
15
 
17
16
  def create
18
- @comment = Comment.new(params[:comment])
19
- @comment.author = @author
20
17
  @comment.save
21
-
22
18
  respond_with(@comment, respond_options)
23
19
  end
24
20
 
@@ -42,6 +38,12 @@ class CommentsController < ApplicationController
42
38
  @author = current_user
43
39
  end
44
40
 
41
+ def build_comment
42
+ @comment = Comment.new(params[:comment])
43
+ @comment.author = @author
44
+ @comment
45
+ end
46
+
45
47
  def find_comment
46
48
  @comment = Comment.find(params[:id])
47
49
  end
@@ -1,5 +1,5 @@
1
1
  module Sunrise
2
2
  module Comments
3
- VERSION = "0.1.0".freeze
3
+ VERSION = "0.1.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunrise-comments
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Igor Galeta
@@ -16,7 +16,8 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-18 00:00:00 Z
19
+ date: 2011-07-12 00:00:00 +03:00
20
+ default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
23
  name: sunrise
@@ -26,12 +27,12 @@ dependencies:
26
27
  requirements:
27
28
  - - ~>
28
29
  - !ruby/object:Gem::Version
29
- hash: 27
30
+ hash: 25
30
31
  segments:
31
32
  - 0
32
33
  - 1
33
- - 0
34
- version: 0.1.0
34
+ - 1
35
+ version: 0.1.1
35
36
  type: :runtime
36
37
  version_requirements: *id001
37
38
  description: Sunrise is a Aimbulance CMS
@@ -66,6 +67,7 @@ files:
66
67
  - lib/sunrise/comments/engine.rb
67
68
  - lib/sunrise/comments/version.rb
68
69
  - lib/sunrise/models/comment.rb
70
+ has_rdoc: true
69
71
  homepage: https://github.com/galetahub/sunrise-comments
70
72
  licenses: []
71
73
 
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
97
  requirements: []
96
98
 
97
99
  rubyforge_project:
98
- rubygems_version: 1.8.2
100
+ rubygems_version: 1.6.2
99
101
  signing_key:
100
102
  specification_version: 3
101
103
  summary: Rails CMS