From 2586fba3b8a181289c597071733774b3a406f675 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 6 Jul 2018 15:42:33 -0400 Subject: Abstracted Recordable concern Blogs, streams, and updates are all recordable, and there's no need to repeat code in the models for this. --- app/models/update.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'app/models/update.rb') diff --git a/app/models/update.rb b/app/models/update.rb index 41cc453..73c4911 100644 --- a/app/models/update.rb +++ b/app/models/update.rb @@ -1,11 +1,10 @@ class Update < ApplicationRecord - has_many :records, as: :recordable, inverse_of: :recordable + include Recordable + belongs_to :stream validates :stream, :body, presence: true - accepts_nested_attributes_for :records, allow_destroy: true - def path "/thinks/#{stream.slug}\#update-#{id}" end -- cgit 1.4.1