开发者

Authlogic, multiple user types and multiple relations between the same models

Good morning,

I'm trying to figure out the best way to manage this user situation I've got.

I have users and affiliates. There is already a HABTM relationship between the two of them, because users can sign up for affiliates, and affiliates can reach out and touch users, in order to get various data points.

Now I need to set up a new Authlogic user type, let's call them affiliate managers, to manage affiliates. Each affiliate manager can only manage one affiliate, and they should not be counted in the affiliate's user count.

Our app is already using Authlogic to separate regular users and admins, but I'm having a hard time 开发者_C百科wrapping my brain around how I would build in this latest piece: specifically the relationship between the affiliate and the manager.

Thanks for any help.


Maybe you can try to solve this with single table inheritance. Docs: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#label-Single+table+inheritance

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜