From: Thufir Date: 2009-09-23T10:22:52+09:00 Subject: Re: decompose ActiveRecord script into methods On Wed, 23 Sep 2009 00:54:23 +0900, Paul Smith wrote: > The error message tells you exactly what is wrong: > >> class Items <  ActiveRecord::Base >> end > > You can't have a class declaration like this inside a method body. > > Instead of making a single method around the whole script, make at least > 2 methods, one which covers the code before the class declaration, then > one which covers the code after it. Or move the class definition to the > top of the file, before def all. Ah, before the class, that makes sense. I suppose what I was wanting was to declare the class in a separate file and then "require 'Items.rb'", how would that work? thanks, Thufir