typo:
has_many :workers
...move the colon, and see what happens.
Does it work the other way around? can you call "Worker.first.ressort"?
--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What command did you type to get this return value? It's certainly
weird if you asked for "Worker.first"... (or Worker.all.first)
> irb(main):037:0> Ressort
> => Ressort(id: integer, name: string, description: text, created_at:
> datetime, updated_at: datetime)
...And what if you display "Worker"?
I think your migrations would help too... I really don't think you've
quite got all the structure in place yet.
Can you paste the contents of ressort.rb and worker.rb? Do not
re-type them, copy and paste here please.
Also db/schema.rb
Colin
+1
Everything looks good... nothing is jumping out at me - but the error
messages you're getting don't tie with what code/migrations you have.
> Have a look and remove anything extra there. Are
> you *absolutely* sure you are looking at the right files?
It could be worth just moving up one folder and typing "rails
project2" and starting again - you can copy the migrations and model
files over and check things one step at a time.
Please don't top post, it makes it difficult to follow the thread.
Insert your reply at appropriate point in previous message. Thanks.
This really makes no sense to me. Is it possible that you have some
old files (backup files for example) in the app/model folder that may
be confusing rails? Have a look and remove anything extra there. Are
you *absolutely* sure you are looking at the right files? I know it
seems a stupid question but I remember once I had made a complete copy
of an application as a temporary backup and was editing the files in
one folder and running the server in the other. It took me a little
time to work out why nothing I changed seemed to make any difference
:)
Colin
one alternative:
rake db:migrate VERSION=0
rake db:migrate