I am hoping that the script would evolve into a DSL that would read
like a tutorial.
Any thoughts you had on this would be great in guiding me.

My migration tool reads from a larger block of text, and handles more
aspects together, at a higher level.
The script reads specifications from an input file, and applies them
where needed throughout the code.

Fields, Assoications, Permissions, and Actions are all related in some
ways to the feature.

For example, in the first step,
---
Project:model_resource    name:string
Story:model_resource      title:string  body:text   status:string
Task:model_resource       description:string
----
I run three model migrations at one step.

Next, I can layer in the associations
---
Project:
  has_many :stories, :dependent => :destroy
Story:
  belongs_to :project
  has_many :tasks, :dependent => :destroy
Task:
  belongs_to :story
  has_many :task_assignments, :dependent => :destroy
  has_many :users, :through => :task_assignments, :accessible => true
TaskAssignment:model
  belongs_to :user
  belongs_to :task
User:
  has_many :task_assignments, :dependent => :destroy
  has_many :tasks, :through => :task_assignments
---
and I snuck in a model (TaskAssignment) in there.


Later, with the same tool, I can add new associations, and setup the
permissions layer
---
Project:
  belongs_to :owner, :class_name => "User", :creator => true
Project:create:
  owner_is? acting_user
Project:update:
  acting_user.administrator? ||  ( owner_is?(acting_user) && !
owner_changed?)
Project:destroy:
  acting_user.administrator? ||  owner_is?(acting_user)
User:
  has_many :projects, :class_name => "Project", :foreign_key =>
"owner_id"
---

All this, with the one tool.

And all the while DRYML builds the view layer for me.




On Mar 30, 6:15 am, Tom Locke <[email protected]> wrote:
> This looks useful. What happens when the tutorial changes? Making sure
> the script and the tutorial are in sync just has to be done carefully
> by hand, right?
>
> Also, can you explain a bit more about this "uber migrator"?
>
> Cheers
>
> Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to