On Mon, Mar 15, 2010 at 4:17 PM, M I R wrote:
> hi,
> I have to retrieve data from table with two conditions using a actully
> the following query
>
> select * from abc where id=1 and type = 'a'
>
> how will i do if:
>
> find_by_id(id) > how will i use for multiple conditions
>
> --
> You rec
On 15 March 2010 10:47, M I R wrote:
> select * from abc where id=1 and type = 'a'
>
> how will i do if:
>
> find_by_id(id) > how will i use for multiple conditions
Model.all(:conditions => ["id = ? AND type = ?", id, type])
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002263
hi,
I have to retrieve data from table with two conditions using a actully
the following query
select * from abc where id=1 and type = 'a'
how will i do if:
find_by_id(id) > how will i use for multiple conditions
--
You received this message because you are subscribed to the Google Groups
Hi All,
I'm looking to improve finding friends on my site, by adding a
''suggestion'' page/area.
BAsically, a query should be run against a logged in user and find
other people from the same town/location. Or that share a similar
hobby etc.
I have a controller and an index page i want to update
Hi,
I am puzzlin for quite a while on this. I use find_by methods to retieve
AR objects. In some cases find_by will return nil if there is no match.
However I would like to have find_by return a default object instead.
Is there a way to overload that particular find_by method? Or whats the
best
Hello,
I am trying to construct a lookup based on params submited.
possible urls..
/gadgets?product_id=1
/gadgets?product_id=1&product_group_id=2
/gadgets?product_location_id=5
/gadgets?product_id=1&product_location=5
...
How do I write a universal lookup method ?
Gadget.find_by_product_id
Gadge
6 matches
Mail list logo