From: Brian Candler Date: 2010-01-09T05:45:34+09:00 Subject: Re: Something changed an instance variable ... and now I'm confused Rick Denatale wrote: > Is activation_code an attribute of an ActiveRecord model? > > If so then the value isn't stored in an instance variable I believe it's stored in @attributes (which is a Hash) > You need something like: > > def activation_code=(arg) > puts at_file_line_msg(__FILE__, __LINE__) > puts "arg=" + arg > self['activation_code'] =arg > debugger > arg # strictly speaking you don't really need this since ruby > assignments via an x= method ignore the return value > end Should be cleaner to use: write_attribute('activation_code', arg) If you have the Agile Web Development with Rails book, look up 'facade columns' in the index. -- Posted via http://www.ruby-forum.com/.