Sha256: 2502f3c1d7915ef4cb0f3f32d45da7aeeb8fc4bccb95d0ecd12b5f31fffe031c

Contents?: true

Size: 580 Bytes

Versions: 3

Compression:

Stored size: 580 Bytes

Contents

class Movie < MontageRails::Base
  has_many :actors

  belongs_to :studio

  attr_accessor :before_save_var, :before_create_var, :after_save_var, :after_create_var

  before_save :do_stuff
  before_create :do_other_stuff
  after_save :do_stuff_after_save
  after_create :do_stuff_after_create

  def do_stuff
    @before_save_var = "FOO"
  end

  def do_other_stuff
    @before_create_var = "BAR"
  end

  def do_stuff_after_save
    @after_save_var = "AFTER SAVE"
  end

  def do_stuff_after_create
    @after_create_var = "AFTER CREATE"
    self.votes = 600
    save!
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
montage_rails-0.4.3 test/dummy/app/models/movie.rb
montage_rails-0.4.2 test/dummy/app/models/movie.rb
montage_rails-0.4.1 test/dummy/app/models/movie.rb