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

15 lines
297 B
Ruby

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