From 701328900b5b33325c35e904be9cbd17995e699c Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Mon, 18 Feb 2019 12:43:44 +1030 Subject: [PATCH] Move tmdb_image method to ApplicationRecord --- app/models/application_record.rb | 5 +++++ app/models/concerns/media.rb | 4 ---- app/models/tv_show/season.rb | 4 ---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 10a4cba..051ce4c 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,8 @@ class ApplicationRecord < ActiveRecord::Base self.abstract_class = true + +protected + def tmdb_image(path, version="original") + "https://image.tmdb.org/t/p/#{version}#{path}" + end end diff --git a/app/models/concerns/media.rb b/app/models/concerns/media.rb index 156354d..d0efb19 100644 --- a/app/models/concerns/media.rb +++ b/app/models/concerns/media.rb @@ -18,8 +18,4 @@ def backdrop? def backdrop_url(version="original") tmdb_image(backdrop_path, version) end - - def tmdb_image(path, version="original") - "https://image.tmdb.org/t/p/#{version}#{path}" - end end diff --git a/app/models/tv_show/season.rb b/app/models/tv_show/season.rb index 2983374..c8e08ac 100644 --- a/app/models/tv_show/season.rb +++ b/app/models/tv_show/season.rb @@ -14,8 +14,4 @@ def poster? def poster_url(version="original") tmdb_image(poster_path, version) end - - def tmdb_image(path, version="original") - "https://image.tmdb.org/t/p/#{version}#{path}" - end end