I’m designing a Rails application that has a Group resource that habtm
Since I’m following the RESTful pattern, I thought on creating a
GroupsPermissions (via Group
has_many Permissions :through => GroupsPermissions in the Group model)
resource, even thought it doesn’t map to anything concrete (such as
Friendship or any other relathinship
between two entities).
My question is: Is it okay to sometimes create these kind of meaningless
resources so that you are able to CRUD them in a RESTful way, instead of
creating more actions into the Group and Permissions models? Or is there
better way to do that I might not be aware of?
Thanks in advance!
Ok, already solved it.
It happened that it wasn’t a “meaningless” association. Some guys @
#rubyonrails helped me come into a conclusion that Groups vs Permissions
Authorization. Thanks goes to dblack and life @ #rubyonrails.
The rationale behind using Group has_many Permissions :through =>
Authorization is that of clean code and design. Since I’m following the
RESTful design, I might take advantage of this “controller design
to reduce code and keep things DRY and simple. Instead of creating
to add permissions to manage the group vs permission relationship in the
Group model, I can just use the AuthorizationsController REST methods.
On Mon, Jul 21, 2008 at 8:12 PM, Marcelo de Moraes S. <
Ops, I meant lifo not life for the username of the guy who helped me at
On Mon, Jul 21, 2008 at 10:52 PM, Marcelo de Moraes S. <