Sha256: 6b2406a10ba7a6d07944beb4bc7f1213e0b30ab57005e4835a4c50946e945ded
Contents?: true
Size: 787 Bytes
Versions: 15
Compression:
Stored size: 787 Bytes
Contents
module PushType module ApplicationControllerMethods extend ActiveSupport::Concern FILTERS = [ :before_node_load_filters, :before_node_action_filters, :after_node_action_filters ] included do class_attribute *FILTERS end protected def permalink_path params[:permalink].split('/') end private FILTERS.each do |filter| define_method(filter) { self.class.send(filter) } end module ClassMethods FILTERS.each do |filter| method_name = filter.to_s.gsub(/_filters$/, '') define_method method_name do |*args, &block| args.push block if block filters = ( self.send(filter) || [] ) << args self.send "#{ filter }=", filters end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems