Sha256: 75d61a78f843e8873bb1f28d63848e438440ad07f7547c9d9b5781bdbfc0fc11

Contents?: true

Size: 616 Bytes

Versions: 9

Compression:

Stored size: 616 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

  validates :title, presence: true

  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

9 entries across 9 versions & 1 rubygems

Version Path
montage_rails-0.5.0 test/dummy/app/models/movie.rb
montage_rails-0.4.11 test/dummy/app/models/movie.rb
montage_rails-0.4.10 test/dummy/app/models/movie.rb
montage_rails-0.4.9 test/dummy/app/models/movie.rb
montage_rails-0.4.8 test/dummy/app/models/movie.rb
montage_rails-0.4.7 test/dummy/app/models/movie.rb
montage_rails-0.4.6 test/dummy/app/models/movie.rb
montage_rails-0.4.5 test/dummy/app/models/movie.rb
montage_rails-0.4.4 test/dummy/app/models/movie.rb