Created
September 7, 2010 20:18
-
-
Save joegaudet/569019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================================================== | |
// Project: DarkHorse.Comment | |
// Copyright: ©2010 My Company, Inc. | |
// ========================================================================== | |
/*globals DarkHorse */ | |
/** @class | |
(Document your Model here) | |
@extends SC.Record | |
@version 0.1 | |
*/ | |
sc_require('models/feed_item'); | |
DarkHorse.Comment = SC.Record.extend( | |
/** @scope DarkHorse.Comment.prototype */ { | |
body: SC.Record.attr(String,{defaultValue:""}), | |
commentedOn: SC.Record.attr(SC.DateTime,{defaultValue:"010-09-03T14:08:09.468-0700"}), | |
timeStamp: function(){ | |
return this.get('commentedOn').toFormattedString("%a - %b %d, %i:%M"); | |
}.property('commentedOn').cacheable(), | |
user: SC.Record.toOne("DarkHorse.User",{ | |
inverse: "comments" | |
}), | |
feedItem: SC.Record.toOne("DarkHorse.FeedItem",{ | |
inverse: "comments", | |
isMaster: NO | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment