Sha256: 60162b26cfc1bc98b44a58ec493a2cf171a172bff001db68ef52a1db4422c154

Contents?: true

Size: 503 Bytes

Versions: 18

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

18 entries across 18 versions & 1 rubygems

Version Path
trusty-cms-4.1.2 app/models/user_action_observer.rb
trusty-cms-4.1.1 app/models/user_action_observer.rb
trusty-cms-4.1.0 app/models/user_action_observer.rb
trusty-cms-4.0.2 app/models/user_action_observer.rb
trusty-cms-3.9.7 app/models/user_action_observer.rb
trusty-cms-3.9.6 app/models/user_action_observer.rb
trusty-cms-3.9.5 app/models/user_action_observer.rb
trusty-cms-4.0.1 app/models/user_action_observer.rb
trusty-cms-3.9.4 app/models/user_action_observer.rb
trusty-cms-3.9.3 app/models/user_action_observer.rb
trusty-cms-3.9.2 app/models/user_action_observer.rb
trusty-cms-4.0.0 app/models/user_action_observer.rb
trusty-cms-3.9.1 app/models/user_action_observer.rb
trusty-cms-3.9.0 app/models/user_action_observer.rb
trusty-cms-3.8.4 app/models/user_action_observer.rb
trusty-cms-3.8.3 app/models/user_action_observer.rb
trusty-cms-3.8.2 app/models/user_action_observer.rb
trusty-cms-3.8.1 app/models/user_action_observer.rb