Can active record handle the following? Or do I need to stick to
“.find_by_sql” to do this:
select parent.id, parent.title, parent.description from parent, child
where parent.id = child.parent_id AND child.memo like
‘%texttosearch%’
That is, I want to effectively ‘find’ parent objects, but filtered based
on
the contents of it’s associated child objects data. So the question is
if
it is possible what would the ruby code be to do this? i.e. results =
Parent.find(:all, …
Can active record handle the following? Or do I need to stick to
“.find_by_sql” to do this:
select parent.id, parent.title, parent.description from parent, child
where parent.id = child.parent_id AND child.memo like
‘%texttosearch%’
That is, I want to effectively ‘find’ parent objects, but filtered based
on
the contents of it’s associated child objects data. So the question is
if
it is possible what would the ruby code be to do this? i.e. results =
Parent.find(:all, …
Thanks
Greg
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.