0
User has_many :organizations
可以访问_id一个引用的对象,但不是对象直接
create_table "organizations", :force => true do |t|
t.string "name"
t.integer "founder_id"
我可以分配founder_id,但不能访问方正(方法缺失)。
class CreateOrganizations < ActiveRecord::Migration
def change
create_table :organizations do |t|
t.string :name
t.belongs_to :founder, :class_name => "User"
什么我需要改变,所以我可以访问的Oranization创始人(用户)ATTR?
哦,让我不得不向后那些试图..。 – quantumpotato
我离开了迁移,更新了班级。作品,谢谢! – quantumpotato
嗯..现在这是一个问题,与rails_admin:http://stackoverflow.com/questions/16929802/no-such-column-with-a – quantumpotato