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

Remove rails-observers dependency #325

Merged
merged 1 commit into from
Mar 27, 2017

Conversation

domcleal
Copy link
Collaborator

The Audited::Sweeper class made limited use of the cache sweeping
functionality provided by rails-observer, mostly using it as a way to
implement Audit#before_create on the same class that was attached
around controller actions.

Since there is no released version of rails-observer that's compatible
with Rails 5.0 (and not in the foreseeable future without considerable
refactoring), the population of IPs, users and request UUIDs is replaced
by thread-local storage and the existing Audit#before_create methods.

This is a net code reduction and somewhat simplifies the "sweeper" by
removing the assumptions about how rails-observer works.

The `Audited::Sweeper` class made limited use of the cache sweeping
functionality provided by rails-observer, mostly using it as a way to
implement `Audit#before_create` on the same class that was attached
around controller actions.

Since there is no released version of rails-observer that's compatible
with Rails 5.0 (and not in the foreseeable future without considerable
refactoring), the population of IPs, users and request UUIDs is replaced
by thread-local storage and the existing `Audit#before_create` methods.

This is a net code reduction and somewhat simplifies the "sweeper" by
removing the assumptions about how rails-observer works.
@thomasfedb
Copy link

Would be very keen to see this released.

@thomasfedb
Copy link

This as well as #324 have been merged into my fork (https://github.com/thomasfedb/audited). If there's enough interest I'm happy to cut a new minor release, although I'll need to change the gem name.

@domcleal
Copy link
Collaborator Author

Thanks @thomasfedb, I'd be interested in a new gem if audited itself or rails-observers aren't updated within a couple of weeks.

@thomasfedb
Copy link

@domcleal no worries. If you think of a decent gem name (I'm thinking trackback or metameta), or if there's anything that needs fixing then drop me a PR or create an Issue. I also see it as an opportunity to refactor and drop support for Ruby < 2.4 and Rails < 5.

@thomasfedb
Copy link

@domcleal also note that, from what I can see, rails-observers is fairly dead.

@danielmorrison danielmorrison merged commit 0c1cba4 into collectiveidea:master Mar 27, 2017
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.

3 participants