[Nitro] Fwd: Og scaffolding

George Moschovitis george.moschovitis at gmail.com
Wed Feb 23 09:03:05 EST 2005


Hello Michael,

just took a break from my Job and played a bit with Og. I tried to add
the functionality you want for the scaffolder. Here is how it works:

class Article
  property :title, String
  property :body, String
  has_many :comments, Comment
  has_many :categories, Category
end

class Comment
  belongs_to :article, Article
end

Article.__props
=> [Property(:title), Property(:body)]

Article.__meta[:has]
=> [ [:comments, Comment, :article_oid], [:categories, Category, :article_oid]]

Comment.__meta[:belongs_to]
=> [[:article, Article]]

All arrays are sorted. Is this ok with you? I 'll probably come up
with a better interface to those arrays. Let me know, what you think

George.


ps: and I added the property alias :)

-- 
www.rubyforge.com/projects/nitro
www.joy.gr



More information about the Nitro-general mailing list