Forum: Ruby on Rails rails + runner limited to one model ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9e8274f1e5340cc2efe0e4bc2f83121f?d=identicon&s=25 MR Damien (mrdamien)
on 2007-02-28 16:29

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
has_one :son

Class Son < ActiveRecord::Base
belongs_to :father

father       =
...(some code)
son          =
father.son   = son     = "Tom"
son.gender   = "Male"
...(some code)

# ruby script/runner -e development "Father.update_son"
The error is on the line "son          =".
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
with rails).
This topic is locked and can not be replied to.