./lib/lux/controller/controller.rb in lux-fw-0.5.36 vs ./lib/lux/controller/controller.rb in lux-fw-0.5.37

- old
+ new

@@ -37,19 +37,10 @@ # before and after should be exected only once @executed_filters = {} @base_template = self.class.to_s.include?('::') ? self.class.to_s.sub(/Controller$/,'').underscore : self.class.to_s.sub(/Controller$/,'').downcase end - # because we can call action multiple times - # ensure we execute filters only once - def filter fiter_name, arg=nil - return if @executed_filters[fiter_name] - @executed_filters[fiter_name] = true - - Object.class_callback fiter_name, self, @controller_action - end - def cache *args, &block Lux.cache.fetch *args, &block end # action(:show) @@ -244,6 +235,14 @@ else yield fmt end end + # because we can call action multiple times + # ensure we execute filters only once + def filter fiter_name, arg=nil + return if @executed_filters[fiter_name] + @executed_filters[fiter_name] = true + + Object.class_callback fiter_name, self, @controller_action + end end