Sha256: 1935e8e3db9b60f949219d26a259a2b6bb3c3efdc6c8f9cd33093d6d3b7658b1

Contents?: true

Size: 352 Bytes

Versions: 3

Compression:

Stored size: 352 Bytes

Contents

module Adminos::Controllers::Filters
  extend ActiveSupport::Concern

  included do
    helper_method :filters
  end

  class_methods do
    attr_reader :filters

    def add_filter(attribute, *args)
      options = args.extract_options!
      (@filters ||= {})[attribute.to_sym] = options
    end
  end

  def filters
    self.class.filters
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adminos-1.0.0.pre.rc.5 lib/adminos/controllers/filters.rb
adminos-1.0.0.pre.rc.4 lib/adminos/controllers/filters.rb
adminos-1.0.0.pre.rc.3 lib/adminos/controllers/filters.rb