Add comments association

This commit is contained in:
Micha Wrobel 2012-03-03 17:38:29 +01:00
parent eb4d131fc5
commit e66ad8b5ed

View File

@ -7,6 +7,8 @@ class Asciicast < ActiveRecord::Base
validates :stdout, :stdout_timing, :presence => true validates :stdout, :stdout_timing, :presence => true
validates :terminal_columns, :terminal_lines, :duration, :presence => true validates :terminal_columns, :terminal_lines, :duration, :presence => true
has_many :comments, :order => :created_at
def meta=(file) def meta=(file)
data = JSON.parse(file.tempfile.read) data = JSON.parse(file.tempfile.read)