diff options
author | James Lopez <james@jameslopez.es> | 2017-07-07 20:01:49 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-07-07 20:01:49 +0300 |
commit | 20351c3620c34475c1162b46e29a0f0515df34b5 (patch) | |
tree | ce6c10ff8dd84c1f072e54fe5fa695305c4b01e3 /app/finders/concerns | |
parent | e5acf85c57e67a7d2f140e31eb4a5f6b34ab5f63 (diff) |
move CreatedAtFilter to concerns folder
Diffstat (limited to 'app/finders/concerns')
-rw-r--r-- | app/finders/concerns/created_at_filter.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/finders/concerns/created_at_filter.rb b/app/finders/concerns/created_at_filter.rb new file mode 100644 index 00000000000..ac9ac77732c --- /dev/null +++ b/app/finders/concerns/created_at_filter.rb @@ -0,0 +1,8 @@ +module CreatedAtFilter + def by_created_at(items) + items = items.created_before(params[:created_before]) if params[:created_before].present? + items = items.created_after(params[:created_after]) if params[:created_after].present? + + items + end +end |