Hi,
I am wondering why this does not work?
Email.find(1).the_file.create
Email model
has_one :the_file
Email.find(1).the_file always returns nil (until there is an
association) and you cannot do a create… Any suggestions?
Hi,
I am wondering why this does not work?
Email.find(1).the_file.create
Email model
has_one :the_file
Email.find(1).the_file always returns nil (until there is an
association) and you cannot do a create… Any suggestions?
On 10/30/07, nigel.bris [email protected] wrote:
Hi,
I am wondering why this does not work?
Email.find(1).the_file.create
It doesn’t work because that’s now how you do it. has_one works
differently from has_many.
Email model
has_one :the_fileEmail.find(1).the_file always returns nil (until there is an
association) and you cannot do a create… Any suggestions?
Per the docs:
Email.find(1).create_the_file(attrs)
see:
HTH
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs