# Rails + runner limited to one model?

**URL:** <https://www.ruby-forum.com/t/rails-runner-limited-to-one-model/87158>\
**Category:** Rails\
**Created:** [February 28, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/rails-runner-limited-to-one-model/87158 "2007-02-28T16:29:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdamien](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mrdamien](https://www.ruby-forum.com/u/mrdamien)\
**Post date:** [February 28, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/rails-runner-limited-to-one-model/87158/1 "2007-02-28T16:29:58Z")

</div>

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).
