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
| require "rails_admin/application_controller" | |
| require "rails_admin/abstract_history" | |
| module RailsAdmin | |
| # use declarative_authorization for rails_admin's authz | |
| class ApplicationController < ::ApplicationController | |
| filter_access_to :all | |
| end |
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
| require "paper_trail/version" | |
| # Make PaperTrail's Version class quack like RailsAdmin's History | |
| class Version | |
| def username ; whodunnit && User.find(whodunnit).try(:email) || whodunnit ; end | |
| def message ; "#{event} #{item_type} id #{item_id}" ; end | |
| def table ; item_type ; end | |
| def updated_at ; created_at ; end | |
| # the count(*) that we select in the :number attribute comes back |