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

Frank Hale frankhale at gmail.com
Sat Dec 10 08:50:39 EST 2005


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.

On 12/10/05, Frank Hale <frankhale at gmail.com> wrote:
> What's the policy on attaching code to email messages on the mailing list?
>
> On 12/10/05, David Morton <mortonda at dgrmm.net> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Frank Hale wrote:
> > > Theoretically the same code should still work, right? I am a n00b with
> > > Rails and have only developed a very basic login system that works on
> > > a Linux machine with Rails 0.14.4 and MySQL 4.1.12. It only has one
> > > table and one model with a method that calls find. When I try to run
> > > the same code on Instant Rails using Webrick (that is my preferred
> > > development server) it fails to run giving me a NoMethodError. When I
> > > run on Linux it works as expected. If I comment out the find method in
> > > my model then I don't get the error on Instant Rails but yet the code
> > > cannot function properly without it.
> >
> > I can't speak for anyone else, but I really can't say without seeing the code...
> >
> >
> > - --
> > David Morton
> > Maia Mailguard                        - http://www.maiamailguard.com
> > Morton Software Design and Consulting - http://www.dgrmm.net
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.2 (MingW32)
> > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> >
> > iD8DBQFDmnd/SIxC85HZHLMRAoaoAKCAeEWLOR2UZjP+qZaDTcf8MhyPOQCgh9tr
> > N3BRsfOrVUGBeu3HzYHjrUg=
> > =MCJp
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > Instantrails-users mailing list
> > Instantrails-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/instantrails-users
> >
>
>
> --
> "This life is built on match sticks and can crumble at anytime. I'm on
> the top floor and I sway in the opposite direction of the wind to
> counter act the force of gravity."
>


--
"This life is built on match sticks and can crumble at anytime. I'm on
the top floor and I sway in the opposite direction of the wind to
counter act the force of gravity."



More information about the Instantrails-users mailing list