Skip to content

Commit

Permalink
Salesforce - doi_estimate_year_one field. (Allow doi_estimate to be s…
Browse files Browse the repository at this point in the history
…et for any org type.)
  • Loading branch information
svogt0511 committed Mar 14, 2022
1 parent 7df417e commit d8f4e37
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions app/models/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ class Provider < ApplicationRecord
# validates :voting_contact, contact: true
# validates :billing_information, billing_information: true

# validates :doi_estimate, numericality: { only_integer: true, greater_than_or_equal_to: 0 } if :member_type === "consortium_organization"
validate :doi_estimate_field
validates :doi_estimate, numericality: { only_integer: true, greater_than_or_equal_to: 0 }

strip_attributes

Expand Down Expand Up @@ -839,23 +838,6 @@ def activity_id_not_changed
end
end

def doi_estimate_field
num = Integer(doi_estimate)
if num < 0
errors.add(
:doi_estimate,
:doi_estimate_invalid,
value: "The doi_estimate must be a nonnegative integer.",
)
end
rescue
errors.add(
:doi_estimate,
:doi_estimate_invalid,
value: "The doi_estimate must be a nonnegative integer.",
)
end

# attributes to be sent to elasticsearch index
def to_jsonapi
attributes = {
Expand Down

0 comments on commit d8f4e37

Please sign in to comment.