aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/bulb.rb
blob: c68d008c264b770753b9cac9923b8beef87b08f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
class Bulb < ActiveRecord::Base
  default_scope where(:name => 'defaulty')
  belongs_to :car

  attr_reader :scope_after_initialize

  after_initialize :record_scope_after_initialize
  def record_scope_after_initialize
    @scope_after_initialize = self.class.scoped
  end

end