Sha256: 79e1442b439ff9610bd72e7ea2778c43a2b83afe331f8085f1a3e5592a9300e4

Contents?: true

Size: 747 Bytes

Versions: 7

Compression:

Stored size: 747 Bytes

Contents

module Admino
  module Query
    module Dsl
      def config
        @config ||= Admino::Query::Configuration.new
      end

      def search_field(name, options = {})
        config.add_search_field(name, options)

        define_method name do
          search_field_by_name(name).value
        end
      end

      def filter_by(name, scopes, options = {})
        config.add_filter_group(name, scopes, options)
      end

      def sorting(*args)
        options = args.extract_options!
        config.add_sorting_scopes(args, options)
      end

      def starting_scope(&block)
        config.starting_scope_callable = block
      end

      def ending_scope(&block)
        config.ending_scope_callable = block
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
admino-0.0.15 lib/admino/query/dsl.rb
admino-0.0.14 lib/admino/query/dsl.rb
admino-0.0.13 lib/admino/query/dsl.rb
admino-0.0.12 lib/admino/query/dsl.rb
admino-0.0.11 lib/admino/query/dsl.rb
admino-0.0.10 lib/admino/query/dsl.rb
admino-0.0.9 lib/admino/query/dsl.rb