commontator 1.1.0 → 1.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.
- data/app/controllers/commontator/comments_controller.rb~ +2 -3
- data/app/models/commontator/comment.rb +2 -0
- data/app/models/commontator/comment.rb~ +1 -1
- data/config/initializers/commontator.rb +3 -2
- data/config/initializers/commontator.rb~ +1 -0
- data/lib/commontator/engine.rb~ +2 -1
- data/lib/commontator/version.rb +1 -1
- data/lib/commontator/version.rb~ +1 -1
- data/spec/app/models/commontator/comment_observer_spec.rb +1 -1
- data/spec/app/models/commontator/comment_observer_spec.rb~ +1 -1
- data/spec/dummy/config/initializers/commontator.rb +3 -2
- data/spec/dummy/config/initializers/commontator.rb~ +3 -2
- metadata +1 -1
@@ -2,7 +2,7 @@ module Commontator
|
|
2
2
|
class CommentsController < ApplicationController
|
3
3
|
before_filter :get_thread, :only => [:new, :create]
|
4
4
|
before_filter :get_comment_and_thread, :except => [:new, :create]
|
5
|
-
before_filter :set_commontable_url, :only => :
|
5
|
+
before_filter :set_commontable_url, :only => :create
|
6
6
|
|
7
7
|
# GET /1/comments/new
|
8
8
|
def new
|
@@ -21,11 +21,10 @@ module Commontator
|
|
21
21
|
|
22
22
|
# POST /1/comments
|
23
23
|
def create
|
24
|
-
set_commontable_url
|
25
24
|
@comment = Comment.new(params[:comment])
|
26
25
|
@comment.thread = @thread
|
27
26
|
@comment.creator = @user
|
28
|
-
|
27
|
+
CommentObserver.instance
|
29
28
|
raise SecurityTransgression unless @comment.can_be_created_by?(@user)
|
30
29
|
|
31
30
|
respond_to do |format|
|
@@ -11,9 +11,10 @@ Commontator.configure do |config|
|
|
11
11
|
# Proc that is called after any javascript runs (e.g. to display/clear flash messages)
|
12
12
|
# It is passed the view_context object (self from the view template), so you should be able to
|
13
13
|
# access anything you normally could in a view template (by using, e.g. view.flash)
|
14
|
+
# However, be aware that it does not have access to the main application's helpers
|
14
15
|
# Should return a string containing JS to be appended to all Commontator JS responses
|
15
|
-
# Default: lambda { |view| '$("#error_explanation").
|
16
|
-
config.javascript_proc = lambda { |view| '$("#error_explanation").
|
16
|
+
# Default: lambda { |view| '$("#error_explanation").remove();' }
|
17
|
+
config.javascript_proc = lambda { |view| '$("#error_explanation").remove();' }
|
17
18
|
|
18
19
|
|
19
20
|
# User (acts_as_commontator) Configuration
|
@@ -11,6 +11,7 @@ Commontator.configure do |config|
|
|
11
11
|
# Proc that is called after any javascript runs (e.g. to display/clear flash messages)
|
12
12
|
# It is passed the view_context object (self from the view template), so you should be able to
|
13
13
|
# access anything you normally could in a view template (by using, e.g. view.flash)
|
14
|
+
# However, be aware that it does not have access to the main application's helpers
|
14
15
|
# Should return a string containing JS to be appended to all Commontator JS responses
|
15
16
|
# Default: lambda { |view| '$("#error_explanation").remove();' }
|
16
17
|
config.javascript_proc = lambda { |view| '$("#error_explanation").hide();' }
|
data/lib/commontator/engine.rb~
CHANGED
data/lib/commontator/version.rb
CHANGED
data/lib/commontator/version.rb~
CHANGED
@@ -20,7 +20,7 @@ module Commontator
|
|
20
20
|
it 'must send mail if recipients not empty' do
|
21
21
|
@user2 = DummyUser.create
|
22
22
|
@thread.subscribe(@user2)
|
23
|
-
|
23
|
+
@comment.reload
|
24
24
|
@comment_observer.after_create(@comment).must_be_instance_of Mail::Message
|
25
25
|
end
|
26
26
|
end
|
@@ -11,9 +11,10 @@ Commontator.configure do |config|
|
|
11
11
|
# Proc that is called after any javascript runs (e.g. to display/clear flash messages)
|
12
12
|
# It is passed the view_context object (self from the view template), so you should be able to
|
13
13
|
# access anything you normally could in a view template (by using, e.g. view.flash)
|
14
|
+
# However, be aware that it does not have access to the main application's helpers
|
14
15
|
# Should return a string containing JS to be appended to all Commontator JS responses
|
15
|
-
# Default: lambda { |view| '$("#error_explanation").
|
16
|
-
config.javascript_proc = lambda { |view| '' }
|
16
|
+
# Default: lambda { |view| '$("#error_explanation").remove();' }
|
17
|
+
config.javascript_proc = lambda { |view| '$("#error_explanation").remove();' }
|
17
18
|
|
18
19
|
|
19
20
|
# User (acts_as_commontator) Configuration
|
@@ -11,9 +11,10 @@ Commontator.configure do |config|
|
|
11
11
|
# Proc that is called after any javascript runs (e.g. to display/clear flash messages)
|
12
12
|
# It is passed the view_context object (self from the view template), so you should be able to
|
13
13
|
# access anything you normally could in a view template (by using, e.g. view.flash)
|
14
|
+
# However, be aware that it does not have access to the main application's helpers
|
14
15
|
# Should return a string containing JS to be appended to all Commontator JS responses
|
15
|
-
# Default: lambda { |view| '$("#error_explanation").
|
16
|
-
config.javascript_proc = lambda { |view| '
|
16
|
+
# Default: lambda { |view| '$("#error_explanation").remove();' }
|
17
|
+
config.javascript_proc = lambda { |view| '' }
|
17
18
|
|
18
19
|
|
19
20
|
# User (acts_as_commontator) Configuration
|