I am trying to run a batch job on demand and using the script/runner
The job will add some informations in the database with dependencies.
So I have the following code but it failed.
Class Father < ActiveRecord::Base
Class Son < ActiveRecord::Base
father = Father.new
son = Son.new
father.son = son
son.name = “Tom”
son.gender = “Male”
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
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