-
Notifications
You must be signed in to change notification settings - Fork 9
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
two helpers for rails consistently #5
Conversation
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.
Looking good, @devvit. I'm going to set up TravisCI and you can rebase on that, please.
lib/paper_trail/sinatra.rb
Outdated
private | ||
|
||
# Tells PaperTrail who is responsible for any changes that occur. | ||
def set_paper_trail_whodunnit | ||
@set_paper_trail_whodunnit_called = true | ||
::PaperTrail.whodunnit = user_for_paper_trail if ::PaperTrail.enabled? | ||
end | ||
|
||
def set_paper_trail_request_info | ||
@set_paper_trail_request_info_called = true |
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 don't think this instance variable is necessary. You were probably copying @set_paper_trail_whodunnit_called
above. It, also, is not necessary. I think it was copied to this repository by mistake.
spec/modular_sinatra_spec.rb
Outdated
widget2 = Widget.last | ||
expect(widget2).to_not be_nil | ||
expect(widget2.name).to eq("foo") | ||
expect(widget2.versions.size).to eq(0) |
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.
Why test get "/test"
twice? Could this be two separate it
examples?
lib/paper_trail/sinatra.rb
Outdated
|
||
def paper_trail_enabled_for_request | ||
::PaperTrail.enabled? | ||
end |
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.
Please add documentation for both of these methods. You can copy the documentation from paper_trail/frameworks/rails/controller.rb
CI is set up. Please also add an entry to the changelog under Unreleased -> Added. Thanks! |
Thanks @devvit. Will release as 0.4.0. |
controller_info
andenabled_for_controller
are available,but sinatra has not controller,
paper_trail_enabled_for_controller
named topaper_trail_enabled_for_request