Closed nathanl closed 11 years ago
:+1: (make sure you handle namespaced models properly though)
@adamhunter - Good point.
I'd say Piano::Key
should look for Piano::KeyAuthorizer
, not PianoKeyAuthorizer
or somesuch thing. Agreed?
Also, would you consider this a breaking change, needing a major version bump? If anyone has a CommentAuthorizer
and haven't specified an authorizer for Comment
, all of a sudden they will get switched from ApplicationAuthorizer
. Seems like a small chance, though.
I think you can get away with a minor version bump. If anything the person in that use case is broken, not Authority.
Done - released 2.5.0.
A possible feature for consideration: models currently start out assuming that their authorizer is
ApplicationAuthorizer
. TheComment
model doesn't automatically look for aCommentAuthorizer
because it often makes sense to group multiple models under the same authorizer.However, wouldn't it be sensible to at least check for the existence of an authorizer with a corresponding name? It's unlikely that you'd create a
Comment
model and aCommentAuthorizer
and not want to hook them together.If
Comment
hasn't been told what authorizer to use, should it look forCommentAuthorizer
first, then failing that, assumeApplicationAuthorizer
?