On 7/27/07, andreim <andreim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Hi,
>
> I want to write a script (something like script/breakpointer) which
> recognizes the models in my rails application. I tried inheriting from
> my model class, but I get an "uninitialized constant (NameError)"
> error. Any suggestions?
> Thanks
Put your code in a class in the lib directory, say myclass.rb. Define
class methods which will be your entry points.
class Myclass
def self.mymethod
Mymodel.find()
end
end
Then just run script/runner "Myclass.mymethod" -e [environment]
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---