After the ezed stuff like login and creating your idea, now time to implement some ish...
So what did I do first? Create the model!
Step 1
below is a screen that I used to create my models/domain objects simply by bustin script/generate model <model_name>
once that is done, it will create a bunch of files... what we need to look for is the NNN_create_
now all you need to to create your fields
What I noticed is that there is no way by default to create your foreign keys on your migration file by default, you either have to (1)call the execute method I.E. "execute 'alter table....'" or (2)download a gem that does it for you. It looks like in rails development, all the relationships are built through your models/domain objects.
Step 2
Once you have finished creating your migration files time for the domain objects.
So lets start with the crazy ones... User, Assignment, & Project.
Before we begin check out the the relationship between user & project
You will notice we're busting a many to many relationship with users & projects through assignments.
This is how you implement the relationship in rails
and
once that "hard" part is done, everything else is ezed!
here's the most code I have done so far on my domain object
Well that's it for now... Stay tuned for testing the domain objects!
20070725
Jonas' Crazy Adventures in RoR - Part III - Migration Files & Models/Domain Objects
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment