我有 2 个表 User 和 Member 并且关系是 In user
has_one :member, :class_name => 'User::Member' Member belongs_to :user
我正在尝试使用控制台插入数据,并且正在使用此代码
u = User.create(
:group => UserGroup.find_by_slug(:members),
:first_name => 'abc',
:last_name => 'fgh',
:company_name => 'xyz',
:email => 'test@test.com',
:password => '123456',
:password_confirmation => '123456'
)
m = User::Member.create(
:user => u,
:pricing_plan => PricingPlan.order('RANDOM()').first,
:state => UserState.order('RANDOM()').first,
:industry => Industry.order('RANDOM()').first,
:fy_start_month => 7
)
它抛出这个错误
语法错误,意外的 tIDENTIFIER,需要 $end ) m = User::Member.create(
我想知道我的语法有什么问题。提前致谢