Commit dadc491c2bef921d618c338f8d6daf64b64a70b1

Authored by Junior Silva
1 parent 9c003f99

tolerance-time-plugin: solved permission problems

plugins/tolerance_time/lib/tolerance_time_plugin.rb
@@ -51,7 +51,6 @@ class ToleranceTimePlugin < Noosfero::Plugin @@ -51,7 +51,6 @@ class ToleranceTimePlugin < Noosfero::Plugin
51 redirect_to content.article.url 51 redirect_to content.article.url
52 end 52 end
53 end 53 end
54 -  
55 { :type => 'before_filter', 54 { :type => 'before_filter',
56 :method_name => 'expired_content', 55 :method_name => 'expired_content',
57 :options => {:only => 'edit_comment'}, 56 :options => {:only => 'edit_comment'},
plugins/tolerance_time/lib/tolerance_time_plugin/publication.rb
@@ -2,6 +2,7 @@ class ToleranceTimePlugin::Publication < Noosfero::Plugin::ActiveRecord @@ -2,6 +2,7 @@ class ToleranceTimePlugin::Publication < Noosfero::Plugin::ActiveRecord
2 belongs_to :target, :polymorphic => true 2 belongs_to :target, :polymorphic => true
3 validates_presence_of :target_id, :target_type 3 validates_presence_of :target_id, :target_type
4 validates_uniqueness_of :target_id, :scope => :target_type 4 validates_uniqueness_of :target_id, :scope => :target_type
  5 + attr_accessible :target
5 6
6 class << self 7 class << self
7 def find_by_target(target) 8 def find_by_target(target)
plugins/tolerance_time/lib/tolerance_time_plugin/tolerance.rb
@@ -4,4 +4,5 @@ class ToleranceTimePlugin::Tolerance &lt; Noosfero::Plugin::ActiveRecord @@ -4,4 +4,5 @@ class ToleranceTimePlugin::Tolerance &lt; Noosfero::Plugin::ActiveRecord
4 validates_uniqueness_of :profile_id 4 validates_uniqueness_of :profile_id
5 validates_numericality_of :content_tolerance, :only_integer => true, :allow_nil => true 5 validates_numericality_of :content_tolerance, :only_integer => true, :allow_nil => true
6 validates_numericality_of :comment_tolerance, :only_integer => true, :allow_nil => true 6 validates_numericality_of :comment_tolerance, :only_integer => true, :allow_nil => true
  7 + attr_accessible :profile, :content_tolerance, :comment_tolerance
7 end 8 end
plugins/tolerance_time/views/tolerance_time_plugin_myprofile/index.html.erb
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 <%= error_messages_for :tolerance %> 3 <%= error_messages_for :tolerance %>
4 4
5 -<%= form_for :tolerance, @tolerance do |f| %> 5 +<%= form_for :tolerance do |f| %>
6 6
7 <% time_units = [[_('Seconds'), 1], [_('Minutes'), 60], [_('Hours'), 3600]]%> 7 <% time_units = [[_('Seconds'), 1], [_('Minutes'), 60], [_('Hours'), 3600]]%>
8 8