Permalink
Browse files

Fixing more DM 0.9 fun issues with include order

  • Loading branch information...
mleung committed Jun 11, 2008
1 parent 18ebc87 commit c61c20ca9dd91f464d6942bf6744d9edaa87550d
Showing with 6 additions and 3 deletions.
  1. +4 −1 app/models/activity.rb
  2. +1 −1 app/models/user.rb
  3. +1 −1 app/views/articles/_article.html.erb
View
@@ -1,8 +1,11 @@
class Activity
+ include DataMapper::Validate
include DataMapper::Resource
property :id, Integer, :key => true, :serial => true
- property :message, String, :nullable => false, :length => 255
+ property :message, String, :length => 255
property :created_at, DateTime
+
+ validates_present :message, :key => "uniq_msg"
end
View
@@ -5,9 +5,9 @@
nil
end
class User
- include DataMapper::Resource
include DataMapper::Validate
include AuthenticatedSystem::Model
+ include DataMapper::Resource
attr_accessor :password, :password_confirmation
@@ -6,7 +6,7 @@
<div class="vcard">
Posted by <span class="fn"><%= article.user.name %></span>
</div>
- <abbr class="published" title=""><%= article.published_at.strftime("on %b %d, %y") %></abbr>
+ <abbr class="published" title=""><%= article.published_at.strftime("on %b %d, %y") unless article.published_at.nil? %></abbr>
<br class="clear" />
<div class="entry-content">
<%= render_article(article) %>

0 comments on commit c61c20c

Please sign in to comment.