2013-07-24 05:58:26 +08:00
|
|
|
# StaffActionLog stores information about actions that staff members have taken,
|
2013-04-12 04:04:20 +08:00
|
|
|
# like deleting users, changing site settings, etc.
|
2013-07-24 05:58:26 +08:00
|
|
|
# Use the StaffActionLogger class to log records to this table.
|
|
|
|
class StaffActionLog < ActiveRecord::Base
|
|
|
|
belongs_to :staff_user, class_name: 'User'
|
|
|
|
belongs_to :target_user, class_name: 'User'
|
2013-04-12 04:04:20 +08:00
|
|
|
|
2013-07-24 05:58:26 +08:00
|
|
|
validates_presence_of :staff_user_id
|
2013-04-12 04:04:20 +08:00
|
|
|
validates_presence_of :action
|
|
|
|
|
|
|
|
def self.actions
|
2013-07-08 17:53:22 +08:00
|
|
|
@actions ||= Enum.new(:delete_user, :change_trust_level)
|
2013-04-12 04:04:20 +08:00
|
|
|
end
|
|
|
|
end
|
2013-05-24 10:48:32 +08:00
|
|
|
|
|
|
|
# == Schema Information
|
|
|
|
#
|
2013-07-24 05:58:26 +08:00
|
|
|
# Table name: staff_action_logs
|
2013-05-24 10:48:32 +08:00
|
|
|
#
|
|
|
|
# id :integer not null, primary key
|
|
|
|
# action :integer not null
|
2013-07-24 05:58:26 +08:00
|
|
|
# staff_user_id :integer not null
|
2013-05-24 10:48:32 +08:00
|
|
|
# target_user_id :integer
|
|
|
|
# details :text
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
|
|
|
#
|
|
|
|
|