Skip to content

Commit

Permalink
Store related_items in DB field
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Apr 20, 2021
1 parent 9ac4ec5 commit 4538661
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Doi < ApplicationRecord
validate :check_landing_page, if: :landing_page?
validate :check_identifiers, if: :identifiers?
validate :check_related_identifiers, if: :related_identifiers?
# validate :check_related_items, if: :related_items?
validate :check_related_items, if: :related_items?
validate :check_funding_references, if: :funding_references?
validate :check_geo_locations, if: :geo_locations?
validate :check_language, if: :language?
Expand Down Expand Up @@ -1656,15 +1656,6 @@ def identifier
normalize_doi(doi, sandbox: !Rails.env.production?)
end

# disable virtual attributes when database has been migrated
def related_items=(value)
write_attribute(:related_items, value) if has_attribute?(:related_items)
end

def related_items
read_attribute(:related_items) if has_attribute?(:related_items)
end

def client_id
client.symbol.downcase if client.present?
end
Expand Down

0 comments on commit 4538661

Please sign in to comment.