incubator-alois-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fla...@apache.org
Subject svn commit: r1066427 - /incubator/alois/trunk/rails/app/controllers/survey_controller.rb
Date Wed, 02 Feb 2011 11:47:36 GMT
Author: flavio
Date: Wed Feb  2 11:47:35 2011
New Revision: 1066427

URL: http://svn.apache.org/viewvc?rev=1066427&view=rev
Log:
Fixed name collision problem with Filter class

Modified:
    incubator/alois/trunk/rails/app/controllers/survey_controller.rb

Modified: incubator/alois/trunk/rails/app/controllers/survey_controller.rb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/controllers/survey_controller.rb?rev=1066427&r1=1066426&r2=1066427&view=diff
==============================================================================
--- incubator/alois/trunk/rails/app/controllers/survey_controller.rb (original)
+++ incubator/alois/trunk/rails/app/controllers/survey_controller.rb Wed Feb  2 11:47:35 2011
@@ -18,6 +18,11 @@ class SurveyController < ApplicationCont
   before_filter :handle_cancel, :only => [ :create, :update ]
   before_filter :init
 
+  def filter_class
+    # otherwise rails filter class would be returned
+    View.instance_eval("Filter")
+  end
+
   def init
     initialize_parameters
   end
@@ -276,7 +281,7 @@ class SurveyController < ApplicationCont
 
   def add_filter
     if params[:survey] and params[:survey][:filter_id] 
-      @filters << Filter.find(params[:survey][:filter_id])
+      @filters << filter_class.find(params[:survey][:filter_id])
       @filters = @filters.uniq
       save_session
     end
@@ -284,7 +289,7 @@ class SurveyController < ApplicationCont
   end
 
   def remove_filter
-    @filters.delete(Filter.find(params[:filter_id].to_i))
+    @filters.delete(filter_class.find(params[:filter_id].to_i))
     @filters = @filters.uniq
     save_session
     render :partial => "edit_named_filters"



Mime
View raw message