### @export "comment-properties"
class Comment
include DataMapper::Resource
storage_names[:default] = 'wp_comments'
property :id, Integer, :serial => true # original field name comment_ID
property :post_id, Integer # original field name comment_post_ID
property :comment_author, String
property :comment_author_url, String
property :comment_date, DateTime
property :comment_content, String
property :comment_approved, Boolean
property :user_id, Integer
belongs_to :post
### @export "formatting"
def author_with_url
if comment_author_url.to_s === ""
comment_author
else
%{#{comment_author}}
end
end
def to_html
%{
#{author_with_url} #{comment_date.strftime("%d %b %Y")}
#{wp_format(comment_content)}
}
end
### @end
end