How to rubify this query


Hi guys,

i spent about 5 hours now of finding out how to rubify/railify this
Maybe someone of you can help me :wink:

class Menu < ActiveRecord::Base
validates_uniqueness_of :handle
validates_presence_of :name, :sequence, :accesslevel, :defaultpage,

belongs_to :cmodule
belongs_to :creator, :class_name => ‘User’, :foreign_key =>
belongs_to :updater, :class_name => ‘User’, :foreign_key =>

Now this is my query:
@menu = Menu.find_by_sql “SELECT self.* FROM menus self, menus remote
WHERE self.parent_id =
AND remote.handle = ‘#{parent}’
AND self.accesslevel <=
ORDER BY self.sequence”

Any ideas? thanks! :wink: