我有两个型号:轨惨惨 - 定义权限嵌套模型
Thread (id, title)
ThreadParticipation (id, thread_id, user_id)
我想定义是这样的:
can :create, ThreadParticipation if the user is a ThreadParticipation
例如:
for
thread: (1, 'hello world')
thread_participation: (313, 1, 13) -- where 13 is the user_id
我试着:
can :create, ThreadParticipation, :thread_participations => { :user_id => current_user.id }
但那个错误。有任何想法吗?
的财产是它一个非常非常非常非常非常严重的错误? :D如果没有一些错误信息,很难诊断! – Zabba