I have another resource:
http://api.rubyonrails.org/classes/ActiveRecord/Base.html

this seems quite useful, however I attempted the following instead of
the example I have listed in my previous post:

@myOrder2 = Order.where(:user_id => current_user)

but I just get:

undefined method `where' for #<Class:bunch of numbers

I'm running rails 2.3.5 and hobo 1.0.3. Is the failure due to my
version? Do I need rails 3.0+ and a newer version of hobo? what
methods can I use with rails 2.3.5 and hobo 1.0.3 other than
object.find?

-hobo_hippy


On Oct 19, 10:33 pm, hobo_hippy <[email protected]> wrote:
> I'm finding myself stuggling more and more often trying to figure out
> how to develop custom database queries from within a controller. I've
> found lots of resources, one of which 
> beinghttp://guides.rubyonrails.org/active_record_querying.htmlbut nothing
> i've found is hobo specific. Is there a hobo way to do this sort of
> thing? I feel like what I've been dealing with is a hodgepodge of
> techniques.
>
> In short, is there a clear reference anywhere on all available
> activerecord queries I can use in a hobo controller?
>
> This is about the limit to what I can do.
>
> @myOrder = Order.find :first, :limit => 1, :conditions => {:user_id =>
> current_user}
>
> As far as I understand, what the above line does is as follows:
>
> find, among the models called orders, any models where the userId is
> the same as the current user (condition), starting with the first one
> found(:first), and only return 1 instance(:limit => 1).
>
> If anyone has a good reference as to all the commands I can use in a
> query like this, I would be much appreciative. If not, I'd like to
> start a conversation to confer about the different kinds of things you
> can and can't do with activerecord queries like above.
>
> -HoboHippy

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to