Sha256: 9483a3cd7cf9306a25099df9e579317398d81eef4726a3bff857555da48158be

Contents?: true

Size: 503 Bytes

Versions: 81

Compression:

Stored size: 503 Bytes

Contents

class UserActionObserver < ActiveRecord::Observer
  observe User, Page, Layout

  def current_user=(user)
    self.class.current_user = user
  end

  def self.current_user=(user)
    Thread.current[:current_user] = user
  end

  def current_user
    self.class.current_user
  end

  def self.current_user
    Thread.current[:current_user]
  end

  def before_create(model)
    # model.created_by = self.current_user
  end

  def before_update(model)
    # model.updated_by = self.current_user
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
trusty-cms-7.0.9.1 app/models/user_action_observer.rb
trusty-cms-7.0.11 app/models/user_action_observer.rb
trusty-cms-7.0.10 app/models/user_action_observer.rb
trusty-cms-7.0.9 app/models/user_action_observer.rb
trusty-cms-7.0.8 app/models/user_action_observer.rb
trusty-cms-7.0.7 app/models/user_action_observer.rb
trusty-cms-7.0.6 app/models/user_action_observer.rb
trusty-cms-7.0.5 app/models/user_action_observer.rb
trusty-cms-7.0.4 app/models/user_action_observer.rb
trusty-cms-7.0.3 app/models/user_action_observer.rb
trusty-cms-6.3.1 app/models/user_action_observer.rb
trusty-cms-7.0.2 app/models/user_action_observer.rb
trusty-cms-7.0.1 app/models/user_action_observer.rb
trusty-cms-7.0.0 app/models/user_action_observer.rb
trusty-cms-6.3 app/models/user_action_observer.rb
trusty-cms-6.2.1 app/models/user_action_observer.rb
trusty-cms-6.2.2.1 app/models/user_action_observer.rb
trusty-cms-6.2.0 app/models/user_action_observer.rb
trusty-cms-6.1.2 app/models/user_action_observer.rb
trusty-cms-6.1.1 app/models/user_action_observer.rb