13
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 I'm trying to do in active record in Rails 3.0 way:
select
distinct p.ID
from
patients p
inner join vaccines_patients vp on p.ID = vp.patient_id
inner join vaccines v on v.ID = vp.VACCINE_ID
where
month(vp.appliedAt + INTERVAL v.duration DAY) = month(now())
I want to get a similar query but using where in active record.