我想执行一个 SQL 查询并将结果应用于我的能力等级:
res_sql = "SELECT * FROM people
where trainer_id != null and people.user_id = user.id
and user.role = 'Trainerone'"
sql 应该从 Typ Sportler 返回对象,我可以将其应用于 cancan:
can :manage, **:sportler**
我想执行一个 SQL 查询并将结果应用于我的能力等级:
res_sql = "SELECT * FROM people
where trainer_id != null and people.user_id = user.id
and user.role = 'Trainerone'"
sql 应该从 Typ Sportler 返回对象,我可以将其应用于 cancan:
can :manage, **:sportler**