1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models/bulb.rb

12 lines
278 B
Ruby

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