Skip to content

Commit

Permalink
use alias_attributes for bolognese methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 6, 2019
1 parent 489d6a5 commit 9d036af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions app/models/concerns/crosscitable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d036af

Please sign in to comment.