Sha256: ccb078fc2f631cb285cf00a348f37ebc165353b47f35e55b9d1d69c3eed3cf44

Contents?: true

Size: 821 Bytes

Versions: 10

Compression:

Stored size: 821 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id$

require 'parts/content'

# The models used in the Blog part.

# 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 N::BaseContent
	include N::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

10 entries across 5 versions & 1 rubygems

Version Path
nitro-0.10.0 examples/no_xsl_blog/lib/blog/model.rb
nitro-0.10.0 examples/blog/lib/blog/model.rb
nitro-0.11.0 examples/no_xsl_blog/lib/blog/model.rb
nitro-0.11.0 examples/blog/lib/blog/model.rb
nitro-0.12.0 examples/no_xsl_blog/lib/blog/model.rb
nitro-0.12.0 examples/blog/lib/blog/model.rb
nitro-0.9.3 examples/no_xsl_blog/lib/blog/model.rb
nitro-0.9.3 examples/blog/lib/blog/model.rb
nitro-0.9.5 examples/no_xsl_blog/lib/blog/model.rb
nitro-0.9.5 examples/blog/lib/blog/model.rb