Add support for commenting on, and replying to, diary entries.
This commit is contained in:
parent
3eecc3ee5b
commit
8181cb4bf7
9 changed files with 83 additions and 12 deletions
7
app/models/diary_comment.rb
Normal file
7
app/models/diary_comment.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class DiaryComment < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :diary_entry
|
||||
|
||||
validates_presence_of :body
|
||||
validates_associated :diary_entry
|
||||
end
|
|
@ -1,5 +1,6 @@
|
|||
class DiaryEntry < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
has_many :diary_comments, :order => "id"
|
||||
|
||||
validates_presence_of :title, :body
|
||||
validates_numericality_of :latitude, :allow_nil => true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue