0.0
No commit activity in last 3 years
No release in over 3 years
A helper for creating declaretive interface for decent_exposure queries
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 3.1.0
>= 0
>= 0

Runtime

 Project Readme

Code Climate Build Status Dependency Status

ExposeQuery

Add query benefit for exposed decent_exsposure values

Installation

Add this line to your application's Gemfile:

gem 'expose_query'

And then execute:

$ bundle

Usage

Include module to controller:

  class PhotosController  < ApplicationController
    include ExposeQuery::ControllerDsl
    expose(:photos)

    expose_query PhotoQuery
  end

And define query class:

  class PhotoQuery < ExposeQuery::BaseQuery

    def apply source_scope
      source_scope.where(image_processing: [nil, false])
    end
  end

Advanced parameters

Allow define query objects for specific expose:

  class PhotosController  < ApplicationController
    include ExposeQuery::ControllerDsl
    expose(:photos)
    expose(:recent_photos, model: :photo)

    expose_query PhotoQuery, PaginationQuery, only: :photos
    expose_query RecentPhotosQuery, only: :recent_photos

  end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/expose_query/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request