How can I do this in rails active record¿?
find all models that match (created_at + 100 days between this month)
Edit: Ok, Sorry for not be precise this what
You didn't specify Rails 2 or 3, and I'm not entirely sure what range you're actually looking for, but this should get you started. Please add some example dates and say whether they should fall into your range or not.
In Rails 2 you can use a named_scope in your model.
# This range represents "created_at" values that are within 100 days on either side of today.
# Please clarify what "created_at + 100 days between this month" means if you need help
# refining this.
#
named_scope :within_range, lambda {{ :conditions => ["created_at <= ? AND created_at >= ?", Date.today + 100, Date.today - 100] }}
In Rails 3, you would use a scope with the new Arel scope methods:
scope :within_range, lambda { where("created_at <= ? AND created_at >= ?", Date.today + 100, Date.today - 100) }