mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
12 lines
278 B
Ruby
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
|