Reputation: 2608
what i am trying to do is, getting all the users which have been created X month ago + all which have been created before that also. Just for one month users am using this query
EvercamUser.created_months_ago(i).count
but i want this query to be for i months ago + all users which already created before. any help will be appreciated
Upvotes: 0
Views: 96
Reputation: 951
class EvercamUser < ActiveRecord::Base
scope :created_months_ago, ->(i) { where("created_at < ?", i.months.ago.end_of_month) }
end
Upvotes: 1