Skip to content

Commit 50118e1

Browse files
author
Bill Heaton
committed
Destroy depenedent comments on post; update JSON API resources gem
1 parent 28ffe4f commit 50118e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/cerebris/jsonapi-resources.git
3-
revision: e385293a7b5bbf5a483a4bef9bf7f78dc174c49f
3+
revision: 7335d833e56c9eece47166b8d0e70e658c87f47f
44
specs:
55
jsonapi-resources (0.3.3)
66
rails (>= 4.0)

app/models/post.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class Post < ActiveRecord::Base
22
belongs_to :author
3-
has_many :comments, -> { where(approved: true) }
3+
has_many :comments, -> { where(approved: true) }, :dependent => :destroy
44

55
validates :slug, uniqueness: true
66

0 commit comments

Comments
 (0)