Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 15, 2020
1 parent 1de1af6 commit e3ead45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def random
def get_url
@doi = Doi.where(doi: params[:id]).first
fail ActiveRecord::RecordNotFound if @doi.blank?

authorize! :get_url, @doi

if !@doi.is_registered_or_findable? || %w(europ crossref medra jalc kisti op).include?(@doi.provider_id) || %w(Crossref mEDRA).include?(@doi.agency)
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/metadata_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class MetadataController < ApplicationController

def index
@doi = Doi.where(doi: params[:doi_id]).first
fail ActiveRecord::RecordNotFound unless @doi.present?
fail ActiveRecord::RecordNotFound if @doi.blank?

collection = @doi.metadata
total = @doi.cached_metadata_count.reduce(0) { |sum, d| sum + d[:count].to_i }
Expand Down Expand Up @@ -90,15 +90,15 @@ def destroy

def set_doi
@doi = Doi.where(doi: params[:doi_id]).first
fail ActiveRecord::RecordNotFound unless @doi.present?
fail ActiveRecord::RecordNotFound if @doi.blank?
end

def set_metadata
id = Base32::URL.decode(URI.decode(params[:id]))
fail ActiveRecord::RecordNotFound unless id.present?
fail ActiveRecord::RecordNotFound if id.blank?

@metadata = Metadata.where(id: id.to_i).first
fail ActiveRecord::RecordNotFound unless @metadata.present?
fail ActiveRecord::RecordNotFound if @metadata.blank?
end

def set_include
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/old_events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create
exists = @event.present?

# create event if it doesn't exist already
@event = Event.new(safe_params.except(:format)) unless @event.present?
@event = Event.new(safe_params.except(:format)) if @event.blank?

authorize! :create, @event

Expand Down

0 comments on commit e3ead45

Please sign in to comment.