1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Implement discussion composition and creation

This commit is contained in:
Toby Zerner
2015-02-06 14:07:15 +10:30
parent abd3aa2e1a
commit 28d213d868
9 changed files with 159 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ import DS from 'ember-data';
var Discussion = DS.Model.extend({
title: DS.attr('string'),
content: DS.attr('string'), // only used to save a new discussion
slug: function() {
return this.get('title').toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-');
@@ -31,7 +32,8 @@ var Discussion = DS.Model.extend({
posts: DS.attr('string'),
postIds: function() {
return this.get('posts').split(',');
var posts = this.get('posts') || '';
return posts.split(',');
}.property('posts'),
readTime: DS.attr('date'),