Commit 667ef5cfcbdfe4a70028b43f09e1d52b9b136e4f

Authored by Rodrigo Souto
1 parent 372f1c86

[tolerance-time] Fixing class due to block call context

plugins/tolerance_time/lib/tolerance_time_plugin.rb
@@ -27,7 +27,7 @@ class ToleranceTimePlugin < Noosfero::Plugin @@ -27,7 +27,7 @@ class ToleranceTimePlugin < Noosfero::Plugin
27 def cms_controller_filters 27 def cms_controller_filters
28 block = lambda do 28 block = lambda do
29 content = Article.find(params[:id]) 29 content = Article.find(params[:id])
30 - if self.class.expired?(content) 30 + if ToleranceTimePlugin.expired?(content)
31 session[:notice] = _('This content can\'t be edited anymore because it expired the tolerance time') 31 session[:notice] = _('This content can\'t be edited anymore because it expired the tolerance time')
32 redirect_to content.url 32 redirect_to content.url
33 end 33 end
@@ -40,7 +40,7 @@ class ToleranceTimePlugin < Noosfero::Plugin @@ -40,7 +40,7 @@ class ToleranceTimePlugin < Noosfero::Plugin
40 end 40 end
41 41
42 def content_expire_edit(content) 42 def content_expire_edit(content)
43 - if self.class.expired?(content) 43 + if ToleranceTimePlugin.expired?(content)
44 _('The tolerance time for editing this content is over.') 44 _('The tolerance time for editing this content is over.')
45 end 45 end
46 end 46 end