hi all,
I''m stuck with this:
in environment.rb I have:
Inflector.inflections do |inflect|
inflect.plural /istituto/, ''istituti''
inflect.plural /Istituto/, ''Istituti''
inflect.irregular ''Istituto'',
''Istituti''
inflect.irregular ''istituto'',
''istituti''
inflect.plural /sede/, ''sedi''
inflect.plural /Sede/, ''Sedi''
inflect.irregular ''Sede'', ''Sedi''
inflect.irregular ''sede'', ''sedi''
end
my models are:
istituto.rb
class Istituto < ActiveRecord::Base
has_many :sedi
end
sede.rb
class Sede < ActiveRecord::Base
set_primary_key "istituto_id"
belongs_to :istituti
end
now if I run ./script/console and execute Istituto.find :all, my query is
SELECT * FROM istituti and does not do the join with sedi
I think I have not understood well the whole mechanism, please shed some light
thanks! :)
ciao,
Marco
--
,= ,-_-. =. ------------------------------------------------------- +
((_/)o o(\_)) jabber:kpanic@jabber.linux.it/msn:kpanic@muppetslab.org |
`-''(. .)`- #muppetslab@irc.freenode.net |
\_/ There''s no one inside that flat, everybody knows it |