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

two helpers for rails consistently #5

Merged
merged 6 commits into from
Feb 22, 2018

Conversation

devvit
Copy link
Contributor

@devvit devvit commented Feb 20, 2018

controller_info and enabled_for_controller are available,
but sinatra has not controller, paper_trail_enabled_for_controller named to paper_trail_enabled_for_request

Copy link
Member

@jaredbeck jaredbeck left a 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.

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
Copy link
Member

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.

widget2 = Widget.last
expect(widget2).to_not be_nil
expect(widget2.name).to eq("foo")
expect(widget2.versions.size).to eq(0)
Copy link
Member

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?


def paper_trail_enabled_for_request
::PaperTrail.enabled?
end
Copy link
Member

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

@jaredbeck
Copy link
Member

I'm going to set up TravisCI and you can rebase on that, please.

CI is set up.

Please also add an entry to the changelog under Unreleased -> Added.

Thanks!

@jaredbeck jaredbeck merged commit bc3644d into paper-trail-gem:master Feb 22, 2018
@jaredbeck
Copy link
Member

Thanks @devvit. Will release as 0.4.0.

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