Forum: Ruby on Rails Dynamic Finders and Legacy Schemas

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eden B. (Guest)
on 2005-12-21 21:30
(Received via mailing list)
Hello everyone,

I have another question related to a legacy schema I am working with.

Do dynamic finders work with legacy schemas in general?  The schema I am
working with uses hungarian prefixes for column names.  For example
fOpen is
0 if a bug is closed and 1 if it is open (type smallint).  When I try
@bugs
= Bug.find_all_by_fOpen(1), I get the following exception:

undefined method `find_by_fOpen' for Bug:Class

But when I try @bugs = Bug.find(:all, :conditions => ["fOpen = ?", 1]),
I
get the expected find results.

Any ideas?

Thanks,

Eden
This topic is locked and can not be replied to.