-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
store cookie method #13
Conversation
Pull Request Test Coverage Report for Build 43
💛 - Coveralls |
@@ -130,4 +130,12 @@ def can_request_portability? | |||
self.portability_requests.select{|p| p.pending? || p.progress?}.blank? | |||
end | |||
|
|||
def store_cookie(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patriciojofre why call it store_cookie
if it can apply to any rule ?
We could have a store_policy_RULE_NAME
for every rule initialized in the user concern for example
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the method naming, however I think we could avoid creating multiple methods and just just add the store_policy_from(name)
.
This is just a method that wraps the "current_user.handle_policy_for(@term)" with an extra logic were validates the presence of a published term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the method accepts a term, we should name it as accept_policy_from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 @michelson, create multiples methods for this little wrapper is not necessary.
I'll change the name to accept_policy_from
😄
This PR adds the missing store cookie method.