F
Fred
Hello,
I just finished reading the Agile book. Of course I forgot at least the
two thirds of what I read. I started reading the source code of Typo, to
see a real (and Rails) application.
I stumbled upon this snippet of code:
def crypt_unless_empty
if password(true).empty?
user = self.class.find(self.id)
self.password = user.password
else
write_attribute "password", self.class.sha1(password(true))
@password = nil
end
end
is there any practical reason to use sometimes self.password and
sometimes @password? I thought they were synonyms...
I just finished reading the Agile book. Of course I forgot at least the
two thirds of what I read. I started reading the source code of Typo, to
see a real (and Rails) application.
I stumbled upon this snippet of code:
def crypt_unless_empty
if password(true).empty?
user = self.class.find(self.id)
self.password = user.password
else
write_attribute "password", self.class.sha1(password(true))
@password = nil
end
end
is there any practical reason to use sometimes self.password and
sometimes @password? I thought they were synonyms...