Sha256: b71dffd32e6a6626b9af7af87a287e02c624b8254e986658ac5b0b304abb0b49

Contents?: true

Size: 1.48 KB

Versions: 11

Compression:

Stored size: 1.48 KB

Contents

module RailsAdmin
  module Extensions
    module History
      class AuditingAdapter
        def initialize(controller, user_class = User)
          @controller = controller
          @user_class = user_class
          require 'rails_admin/extensions/history/history'
        end

        def latest
          ::RailsAdmin::History.latest
        end

        def delete_object(message, object, model, user)
          ::RailsAdmin::History.create_history_item(message, object, model, user)
        end

        def update_object(model, object, associations_before, associations_after, modified_associations, old_object, user)
          ::RailsAdmin::History.create_update_history(model, object, associations_before, associations_after, modified_associations, old_object, user)
        end

        def create_object(message, object, abstract_model, user)
          ::RailsAdmin::History.create_history_item(message, object, abstract_model, user)
        end

        def listing_for_model(model, query, sort, sort_reverse, all, page, per_page = (RailsAdmin::Config.default_items_per_page || 20))
          ::RailsAdmin::History.history_for_model(model, query, sort, sort_reverse, all, page, per_page)
        end

        def listing_for_object(model, object, query, sort, sort_reverse, all, page, per_page = (RailsAdmin::Config.default_items_per_page || 20))
          ::RailsAdmin::History.history_for_object(model, object, query, sort, sort_reverse, all, page, per_page)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
rails_admin-0.0.5 lib/rails_admin/extensions/history/auditing_adapter.rb
rails_admin-0.0.4 lib/rails_admin/extensions/history/auditing_adapter.rb
rails_admin-0.0.3 lib/rails_admin/extensions/history/auditing_adapter.rb
rails_admin-0.0.2 lib/rails_admin/extensions/history/auditing_adapter.rb
upstream-rails_admin-1.0.2 lib/rails_admin/extensions/history/auditing_adapter.rb
rails_admin-0.0.1 lib/rails_admin/extensions/history/auditing_adapter.rb
obitum-rails_admin-0.0.5 lib/rails_admin/extensions/history/auditing_adapter.rb
drewda_rails_admin-0.0.1 lib/rails_admin/extensions/history/auditing_adapter.rb
obitum-rails_admin-0.0.4 lib/rails_admin/extensions/history/auditing_adapter.rb
obitum-rails_admin-0.0.3 lib/rails_admin/extensions/history/auditing_adapter.rb
obitum-rails_admin-0.0.2 lib/rails_admin/extensions/history/auditing_adapter.rb