- 2009-12-10 (木) 23:11
- Rails
はまりちゅう。
とある事情で、Railsの規約からはみだしてリレーションをはりたい。
Aテーブルで参照したいのは hoge_id でこちらが hasmany :b。
Bテーブルで参照したいのは foo_id で belongs_to :a。
belongs_to :a , :primary_key => foo_id, :foreign_key => hoge_id
これで動かず。。
んーこの辺の理解が全然足りていないみたいだな。
勉強しよう。
今日は遅いのでもうやめですな。
おしまい。
- Newer: Pleiades 3.5 Galileo でSVNが動かない。
- Older: Rails2.3.4で例外処理。
Comments:0
Trackbacks:0
- Trackback URL for this entry
- http://www.terut.net/wp-trackback.php?p=186
- Listed below are links to weblogs that reference
- Rails2.3.4でbelongs_toのリレーションがうまく動かない。 from Action*3