Forum: Ruby on Rails How to rubify this query

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Franz Bettag (Guest)
on 2006-04-20 01:19
Hi guys,

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

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! ;)
This topic is locked and can not be replied to.