2009/12/8 RubyonRails_newbie <[email protected]>:
> Hi Colin,
>
> :conditions active_post is meant to only display posts that are
> active.
>
> If a user deletes a post (they think it's deleted, but infact it is
> archived and just set as inactive) as I may want to do something with
> it at a later date on the site.
>
> I looked on the rails api site, I was therefore kinda hoping that :
>
>  Post.find_by_user_id( session[:user_id], 1, :limit =>
> 1, :conditions => "active_post = 1", :order => "created_at desc")
> would only return posts where the active flag is set to 1.

I would kinda hope that would happen too.  What did happen?

Is active_post an integer type column or a string?  If it is a string
then "active_post = '1'" might be better as integer 1 is not the same
as string '1'

Colin

--

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