Sha256: 825c36cbbbbeb08ca55cd3374ba923f78a8387e1f5ead1b1b8ea7516ad2075a1

Contents?: true

Size: 323 Bytes

Versions: 9

Compression:

Stored size: 323 Bytes

Contents

class HistoryTracker
  include Mongoid::History::Tracker

  def user
    @user ||= modifier
  end

  def username
    user.try(:name)
  end

  def user_type
    "User"
  end

  def user_id
    user.try(:id)
  end

  def auditable_type
    "Post"
  end

  def auditable_id
    1
  end

  def remote_address
    nil
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sunrise-cms-0.5.3 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.2 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.1 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.0 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.0.rc5 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.0.rc4 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.0.rc3 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.0.rc2 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb
sunrise-cms-0.5.0.rc1 lib/generators/sunrise/templates/models/mongoid/history_tracker.rb