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/stream.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'app/models/stream.rb') diff --git a/app/models/stream.rb b/app/models/stream.rb index 7faa370..1398b75 100644 --- a/app/models/stream.rb +++ b/app/models/stream.rb @@ -1,12 +1,11 @@ class Stream < ApplicationRecord - has_many :records, as: :recordable, inverse_of: :recordable + include Recordable + has_many :updates validates :title, presence: true validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ - accepts_nested_attributes_for :records, allow_destroy: true - def path "/thinks/#{slug}" end -- cgit 1.4.1