IT分からんわ~_~;

IT色々お勉強中のブログ

model 関連付けを調べる

全部

User.reflect_on_all_associations

belongs_to だけ

Group.reflect_on_all_associations(:belongs_to)

has_many だけ

Group.reflect_on_all_associations(:has_many)