opinio 0.3.0 → 0.3.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.
@@ -8,7 +8,7 @@ class Opinio::CommentsController < ApplicationController
8
8
 
9
9
  def create
10
10
  @comment = resource.comments.build(params[:comment])
11
- @comment.owner = current_user
11
+ @comment.owner = send(Opinio.current_user_method)
12
12
  if @comment.save
13
13
  flash[:notice] = I18n.translate('opinio.comment.sent', :default => "Comment sent successfully.")
14
14
  else
@@ -24,7 +24,7 @@ class Opinio::CommentsController < ApplicationController
24
24
  flash[:notice] = I18n.translate('opinio.comment.destroyed', :default => "Comment removed successfully")
25
25
  else
26
26
  #flash[:error] = I18n.translate('opinio.comment.not_permitted', :default => "Not permitted")
27
- logger.warning "user #{current_user.email} tried to remove a comment from another user #{@comment.owner.email}"
27
+ logger.warning "user #{send(Opinio.current_user_method)} tried to remove a comment from another user #{@comment.owner.id}"
28
28
  render :text => "unauthorized", :status => 401
29
29
  end
30
30
  end
@@ -1,5 +1,5 @@
1
1
  <div id="new_comment">
2
- <% if current_user %>
2
+ <% if send(Opinio.current_user_method) %>
3
3
  <h2>Send Comments</h3>
4
4
  <%= form_for Comment.new, :remote => true do |f| %>
5
5
  <p>
@@ -29,6 +29,9 @@ module Opinio
29
29
  mattr_accessor :destroy_conditions
30
30
  @@destroy_conditions = Proc.new { true }
31
31
 
32
+ mattr_accessor :current_user_method
33
+ @@current_user_method = :current_user
34
+
32
35
  def self.setup
33
36
  yield self
34
37
  end
@@ -1,5 +1,5 @@
1
1
  module Opinio
2
2
  class Version
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opinio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,40 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2011-06-09 00:00:00.000000000 -03:00
13
13
  default_executable:
14
- dependencies: []
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: &2157417420 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *2157417420
26
+ - !ruby/object:Gem::Dependency
27
+ name: kaminari
28
+ requirement: &2157417000 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *2157417000
37
+ - !ruby/object:Gem::Dependency
38
+ name: jquery-rails
39
+ requirement: &2157416540 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *2157416540
15
48
  description: Opinio is an engine used to add comments functionallity to rails 3 applications.
16
49
  email:
17
50
  - luiz.felipe.gp@gmail.com