Topic: data modelling for beginners
I'm new to rails and got some problems how i should design my models and relations the "rails way".
I've got the following Models:
User habtm Groups
User has many Items
Item habtm ItemGroups
Group is set up as "acts_as_nested_set" so i can have subgroups and stuff..
thats the easy way :-))
Where the problems start is with the rights on items:
a User can have different rights on a item.
also a Group can have rights on a single item
then a User can also have rights on a ItemGroup (say rights on items through ItemGroups)
so can a Group have rights on ItemGroups...
hope this makes sense and it's understandable... sorry for the bad english.. my native language is german.
anyway, the question is... how can I implement the "Right" model with its relations in a proper way?
do i have to setup multiple Right models (inheritance)? or can i handle that somehow with polymorphic associations?