aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/models/bulb.rb
blob: 7d90963720fff348134c9e7a7472498c6267e267 (plain) (tree)
1
2
3
4
5
6
7
8
                               
                                          

                 

                                         
                                     
 


                                                 

     



                                     
   
class Bulb < ActiveRecord::Base
  default_scope where(:name => 'defaulty')
  belongs_to :car

  attr_protected :car_id, :frickinawesome

  attr_reader :scope_after_initialize

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

  def color=(color)
    self[:color] = color.upcase + "!"
  end

end