summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/users_finder.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/finders/users_finder.rb b/app/finders/users_finder.rb
index 07deceb827b..ae031162892 100644
--- a/app/finders/users_finder.rb
+++ b/app/finders/users_finder.rb
@@ -29,6 +29,7 @@ class UsersFinder
users = by_active(users)
users = by_external_identity(users)
users = by_external(users)
+ users = by_created_at(users)
users
end
@@ -71,4 +72,16 @@ class UsersFinder
users.external
end
+
+ def by_created_at(users)
+ if params[:created_after].present?
+ users = users.where(users.klass.arel_table[:created_at].gteq(params[:created_after]))
+ end
+
+ if params[:created_before].present?
+ users = users.where(users.klass.arel_table[:created_at].lteq(params[:created_before]))
+ end
+
+ users
+ end
end