Last active
December 22, 2015 18:07
-
-
Save brianpattison/8bb0b682b756a3d849aa to your computer and use it in GitHub Desktop.
JSON API Resources Filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter :before, apply: -> (records, value, _options) do | |
records.where("shop_orders.order_datetime < ?", value) | |
end | |
filter :after, apply: -> (records, value, _options) do | |
records.where("shop_orders.order_datetime > ?", value) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment