On Nov 10, 1:25 pm, Nicholas Young <[email protected]>
wrote:
> First off, I want to apologize if this topic has been previously
> addressed on the list. I looked, but could have missed it.
>
> I'm trying to run a subscription site, and have created a Subscription
> resource. I now have a table that holds a user_id, sub_user_id, and
> expiration (in UTC.) I've constructed a query (that doesn't blow up!)
> in my application controller that should check if a user's
> subscription is valid:
>
>   def check_subscription(current_user_id, content_owner_id)
>     @subscription = Subscription.find(:all,
>                                       :conditions => { :user_id =>
> current_user_id,
>                                                        :sub_user_id =>
> content_owner_id,
>                                                        "((expiration> ?))" => 
> Time.now.utc })
>

Somewhat offtopic, but how is the bit with a placeholder working? I
just tried it against 2.3 and got an error about 'wrong number of bind
variables".

--Matt Jones
--~--~---------~--~----~------------~-------~--~----~
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