From 9d036affcd1ff8723021493474a1b256d769781f Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sat, 6 Jul 2019 12:46:03 +0200 Subject: [PATCH] use alias_attributes for bolognese methods --- app/controllers/dois_controller.rb | 2 +- app/models/concerns/crosscitable.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index d61946eef..d739b08bf 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -397,7 +397,7 @@ def random def get_url authorize! :get_url, @doi - if !@doi.is_registered_or_findable? || %w(europ crossref medra).include?(@doi.provider_id) || %w(Crossref mEDRA).include?(@doi.agency) + if !@doi.is_registered_or_findable? || %w(europ crossref medra jalc kisti op).include?(@doi.provider_id) || %w(Crossref mEDRA).include?(@doi.agency) url = @doi.url head :no_content and return unless url.present? else diff --git a/app/models/concerns/crosscitable.rb b/app/models/concerns/crosscitable.rb index 724dcf565..edc8074f7 100644 --- a/app/models/concerns/crosscitable.rb +++ b/app/models/concerns/crosscitable.rb @@ -9,6 +9,15 @@ module Crosscitable attr_accessor :issue, :volume, :style, :locale + alias_attribute :get_medra, :get_crossref + alias_attribute :read_medra, :read_crossref + alias_attribute :get_kisti, :get_crossref + alias_attribute :read_kisti, :read_crossref + alias_attribute :get_jalc, :get_crossref + alias_attribute :read_jalc, :read_crossref + alias_attribute :get_op, :get_crossref + alias_attribute :read_op, :read_crossref + def sandbox !Rails.env.production? end