Created
December 30, 2015 07:00
-
-
Save eliotsykes/41e6aea1f907a2cf04fd to your computer and use it in GitHub Desktop.
Add Custom Scopes to Audited Gem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/audit.rb | |
Audit = Audited.audit_class | |
class Audit | |
scope :foo, -> { where("created_at > 0") } | |
scope :bar, -> { where("updated_at > 0") } | |
end | |
# Using scopes example: | |
# Audit.foo.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For audited gem: https://github.com/collectiveidea/audited