aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/bulb.rb
blob: 89ee5416bf72c1512dd6d18568cd406d7a42080f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Bulb < ActiveRecord::Base
  def self.default_scope
    where :name => 'defaulty'
  end

  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