[Instantrails-users] Upgrading Instant Rails to Rails 1.0 RC5 (aka 0.14.4)

David Morton mortonda at dgrmm.net
Sat Dec 10 10:56:53 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Frank Hale wrote:
> Anyway this is the code that causes the problem on Instant Rails.
> 
> require 'digest/sha1'
> 
> class User < ActiveRecord::Base
> 	
> 	def self.validate(name,pass)
> 		find(:first, :conditions => [ "username = ? AND password = ?", name,
> Digest::SHA1.hexdigest(pass) ])
> 	end
> 
> end
> 
> I'll get a NoMethodError on the find method. If I comment it out, the
> app will run but of course it doesn't validate a user.

Ok, first problem, you probably don't mean to use validate(), since that is a
method called when a record is saved; see
http://api.rubyonrails.com/classes/ActiveRecord/Validations.html

I don't know if that is causing the error or not.

Could you also post the exact stack trace you are getting?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDmvrFSIxC85HZHLMRAg3bAJ9garMnueGg5RN9dA4pa0QBYtEB3gCgkelw
bHhlpcrxVgCMsvnv9TakrTk=
=lPNm
-----END PGP SIGNATURE-----


More information about the Instantrails-users mailing list