On Tue, Sep 14, 2010 at 09:44, Marnen Laibow-Koser wrote:
> That's not true. In an instance method, self refers to the object.
Oops, you're right, on further research it seems to be a slippery
little bugger. No wonder I usually see people using @ (or @@)
instead
-Dave
--
Specialization
Pål Bergström wrote:
> I pass a value from controller to model with attr_accessor. before_save
> works fine but not after_find. What could be wrong?
Note this sentence from the documentation:
"Unlike all the other callbacks, after_find and after_initialize will
only be run if an explicit impleme
Dave Aronson wrote:
> P�l Bergstr�m wrote:
>
>> def crypt_data
>> � � �self.name = Crypto.encrypt(self.name,key)
>> end
>>
>> def decrypt_data
>> � � �self.name = Crypto.decrypt(self.name,key)
>> end
>
> Are you sure you don't mean @name? This is Ruby, not Python, so self
> would generally refer
3 matches
Mail list logo