noob question about CASTING (yes, I know)

J

Josh Hester

ok, well i have os_hardware_combos.send("platform_id") which returns 1
and i have Platforms.find(1)
which returns a value i want
but if i do Platforms.find(os_hardware_combos.send("platform_id")) it says,
no id supplied to the find method

The only thing I can think of would be the 1 that is returned is not
numeric? Although this didn't seem very ruby like.

Any help?
 
L

Logan Capaldo

ok, well i have os_hardware_combos.send("platform_id") which returns 1
and i have Platforms.find(1)
which returns a value i want
but if i do Platforms.find(os_hardware_combos.send("platform_id")) it says,
no id supplied to the find method

The only thing I can think of would be the 1 that is returned is not
numeric? Although this didn't seem very ruby like.
This is really an activerecord question, but I'll give it a shot. You
should try doing it like
Platforms.find:)first, :id => os_hardware_combos.platform_id)

Actually, if os_hardward_combos is an instance of AR, you should just
do os_hardware_combos.platform
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top