Skip to content
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

Extending helper methods #22

Merged
merged 3 commits into from
Dec 31, 2016
Merged

Extending helper methods #22

merged 3 commits into from
Dec 31, 2016

Conversation

yuya-takeyama
Copy link
Owner

@sethjeffery
I would appreciate if you have any comments about this change.
And now you can merge this if you are happy with it!
I've just invited you to the collaborators of this repo.


From the README.md

And you can also extend helper methods from base flagset.

Flagship.define :base do
  def staff?(context)
    def is_author(context)
      context.comment.author == context.current_user
    end
  end
end

Flagship.define :production do
  enable :delete, if: :is_author
end

```rb
Flagship.define :base do
def staff?(context)
def is_author(context)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the example looks a bit complex. Did you really intend to define the method is_author inside another method staff? ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, it's just a mistake cased by my rewriting!
Fixed it.
255500d

@sethjeffery
Copy link
Collaborator

LGTM but I don't have write access.

@yuya-takeyama
Copy link
Owner Author

@sethjeffery
You already should have received an invitation to this repo.

But this time, I'll merge by myself.
Thanks to review!

@yuya-takeyama yuya-takeyama merged commit 0776696 into master Dec 31, 2016
@yuya-takeyama yuya-takeyama deleted the extending-helper-methods branch December 31, 2016 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants