Displaying 1 result from an estimated 1 matches for "initialize_by".
Did you mean:
initialize_
2008 Feb 08
4
x-post : find_or_initialize_by ActiveRecord bug? Ignores :conditions
...ate the object if it
doesn''t already exist. This dynamic finder is called with
find_or_create_by_ and will return the object if it already exists and
otherwise creates it, then returns it."
Here are a couple of examples. I know these are contrived since I
could use ''find_or_initialize_by_name_and_state()'' however what I am
really trying to show is that the :conditions options are ignored.
Check out the actual SQL run by each of these finds in a console to
see what I mean.
PASTIE w/ examples:
http://pastie.caboo.se/148479
Original Post:
http://groups.google.com/group/rub...