On 3 April 2010 09:32, Marian Steinbach <[email protected]> wrote:
>>> Base64.encode64(Digest::SHA1.digest("#{rand(1<<64)}/#{Time.now.to_f}/#{Process.pid}/#{login}"))[0..7]
>>
>> What is that login doing in the line above I wonder?
>> I am not quite sure what the [0..7] is for either.
>
> Stupid me. I took that snippet some web page and didn't even notice
> that it uses a variable I don't have. :(
>
> The [0..7] might be another way of doing a substring.

Yes, I realised that just after I posted.  It is not a syntax that I
use regularly.

Colin

>
>>> NameError (undefined local variable or method `login' for
>>> #<SearchSubscription:0x104099750>):
>>
>> The clue is in the error message, it is SearchSubscription that it is
>> complaining about, not User.
>
> Colin, thank you very much! I replaced #{login} with #{self.email} and
> now it works.
>
> Marian
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to