Fearless Fool wrote:
> Michael Pavling wrote:
>> Coming back to my first thought when I read your code: WTF? What are
>> you *trying* to do?! Why are you hoping to achieve with that
>> find_by_sql? Are you trying to find the first record you created? If
>> so, you need to learn some SQL:
>> 
>> b = Blurg.find_by_sql("SELECT * from blurgs where name = 'tic'")
>> 
>> If that's not what you're trying to do, please explain.
> 
> Michael:
> 
> The point of my question is that the save! silently fails, which 
> surprises me.
> save! returns true yet doesn't save the record: how is this not a bug?

Your find_by_sql call doesn't select a database record, so there is 
nothing to save.  Look again at your query.

> 
> But since you asked (and since you've impugned my knowledge of SQL :),

Um, don't get offended.  Your query *is* improperly constructed, and 
that's probably the root of your problem.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to