Sha256: 8dd7fb1c65169d5f71c70f7c25fd431da3b6fc91dacca42a57f438f99459fce3

Contents?: true

Size: 819 Bytes

Versions: 3

Compression:

Stored size: 819 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id: blog.rb 313 2005-03-16 19:18:09Z gmosx $

require 'models/content'

# Forward reference to the Comment definition. 

class Comment; end

# Common properties/methods for the other classes.
# Since markup is required, automatically handles
# the markup expanding/compacting for the body.

module Common
	include BaseContent
	include CreateTime
	prop_accessor :author, String
	validate_value :body
end

# An entry in the Blog.

class BlogEntry 
	include Common
	has_many :comments, Comment, :linkback => 'entry_oid'
	validate_value :title, :msg => 'Please provide a title'
end

# A comment to the blog entry.

class Comment 
	include Common
	belongs_to :entry, BlogEntry
	validate_value :author, :msg => 'Please enter your name'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nitro-0.13.0 examples/blog/src/models/blog.rb
nitro-0.14.0 examples/blog/src/models/blog.rb
nitro-0.15.0 examples/blog/src/models/blog.rb