HI, I am trying to run a batch job on demand and trying to get it works with the script/runner command. The job will add some informations in the database with dependencies. So I have the following code but it failed. son = Son.new father.son= metafile metafile.carp = false metafile.usemfw = false -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, I am trying to run a batch job on demand and using the script/runner command. The job will add some informations in the database with dependencies. So I have the following code but it failed. ============Class Father < ActiveRecord::Base has_one :son Class Son < ActiveRecord::Base belongs_to :father self.update_son father = Father.new ...(some code) son = Son.new father.son = son son.name = "Tom" son.gender = "Male" ...(some code) ============ # ruby script/runner -e development "Father.update_son" The error is on the line "son = Son.new". The output is telling me "uninitialized constant Father::Son (NameError)". I was asking me if you can only access to the model used in the command line with runner ? Or perhaps I am missing something else (about the use of relationship with rails). -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---