Skip to content

Commit

Permalink
Merge pull request #1141 from westonganger/patch-2
Browse files Browse the repository at this point in the history
Add association tracking removal exception
  • Loading branch information
jaredbeck committed Aug 18, 2018
2 parents 3ba4808 + e085c54 commit 33ef9ac
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/paper_trail/config.rb
Expand Up @@ -34,5 +34,25 @@ def enabled
def enabled=(enable)
@mutex.synchronize { @enabled = enable }
end

def track_associations=(_)
raise AssociationTrackingRemovedError
end

def track_associations?
raise AssociationTrackingRemovedError
end

# Error for PT v10.x for when association tracking is attempted to be
# used without the paper_trail-association_tracking gem present
class AssociationTrackingRemovedError < RuntimeError
MESSAGE_FMT = "Association Tracking for PaperTrail has been extracted "\
"to a seperate gem. Please add "\
"`paper_trail-association_tracking` to your Gemfile."

def message
format(MESSAGE_FMT)
end
end
end
end

0 comments on commit 33ef9ac

Please sign in to comment.