Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Problems when trying to use include
Sam Ginko
8/6/2008 11:21:00 PM
I'm trying to access data from the skins table (see below) through a
nested include
with no luck. The association is all through imageasset but I do not
know how to figure it out. Any help is highly appreciated.
######the controller code#######
@furnii_from_furnii = Furni.find :all, :include => [{:raider =>
:imageasset}, :skin ] , :conditions =>
""+Furni.conditions_by_like(@search)+" OR "
+Raider.conditions_by_like(@search) + "OR"
+Skin.conditions_by_like(@search) + ""
#######I have 4 models set up this way (did only include the necessary
code )#######
class Furni < ActiveRecord::Base
belongs_to :imageasset
belongs_to :raider, :foreign_key => "original_raider_id"
end
class Raider < ActiveRecord::Base
belongs_to :imageasset
end
class Skin < ActiveRecord::Base
belongs_to :imageasset
end
class Imageasset
## nothing
end
--
Posted via
http://www.ruby-...
.
1 Answer
Maciej Tomaka
8/7/2008 2:27:00 PM
0
You should ask about it on Rails:)
http://www.ruby-forum.c...
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Problems when trying to use include
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password