Sha256: 715ed508955e9a7a2fede634ad7255a86e3d490f40e4b70d4f4e0ec51d626091

Contents?: true

Size: 506 Bytes

Versions: 7

Compression:

Stored size: 506 Bytes

Contents

class Skyline::ArticleVersionObserver < ActiveRecord::Observer
  attr_accessor :controller
  def before(controller)
    self.controller = controller
  end
  def after(controller)
    self.controller = nil
  end  

  def before_create(article_version)
    article_version.creator = self.controller.send(:current_user) if self.controller
  end
          
  def before_save(article_version)
    article_version.last_updated_by = self.controller.send(:current_user) if self.controller
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
skylinecms-3.3.0 app/observers/skyline/article_version_observer.rb
skylinecms-3.2.0 app/observers/skyline/article_version_observer.rb
skylinecms-3.1.0 app/observers/skyline/article_version_observer.rb
westarete-skylinecms-3.0.8.20100329 app/observers/skyline/article_version_observer.rb
westarete-skylinecms-3.0.8.20100330 app/observers/skyline/article_version_observer.rb
skylinecms-3.0.8 app/observers/skyline/article_version_observer.rb
skylinecms-3.0.7 app/observers/skyline/article_version_observer.rb