On 11 Sep 2008, at 21:46, Shandy Nantz wrote:

>
> Frederick Cheung wrote:
>> find out why that filter is returning false.
>>
>> Fred
>
> What's happening is that I have this before_filter that set some flags
> and then returns. I pass an id along so I can instantiate a User  
> object
> and then save the set conditions of these flags. It is going through  
> the
> steps correctly, however, when I get to the line that save the object
> and set flags it doesn't.
>
> if @user.save
>  return true
> else
>  return false
> end
>
> Not sure why it's no saving????

Failing validation perhaps. In a case like this where you're not doing  
something useful with the return value of save then you might as well  
use save!, at least you'll get an error when the save fails.

Fred
>
> -- 
> 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