Skip to content

Commit

Permalink
Remove some defaults and conversions #709
Browse files Browse the repository at this point in the history
  • Loading branch information
fbacall committed Nov 9, 2022
1 parent 1882d0d commit bb201e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
35 changes: 2 additions & 33 deletions lib/ingestors/event_ingestion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,46 +83,15 @@ def overwrite_event_fields(old_event, new_event)
end

def set_event_field_defaults(event)
# contact
event.contact = event.content_provider.contact if (event.contact.nil? or event.contact.blank?) && !(event.field_locked? :contact)

# organizer
event.organizer = event.content_provider.title if (event.organizer.nil? or event.organizer.blank?) && !(event.field_locked? :organizer)

# host institutions
event.host_institutions = [event.content_provider.title.to_s] if (event.host_institutions.nil? or event.host_institutions.size < 1) && !(event.field_locked? :host_institutions)

# eligibility
event.eligibility = ['open_to_all'] if (event.eligibility.nil? or event.eligibility.size < 1) && !(event.field_locked? :eligibility)

# return
event
end

def convert_eligibility(input)
case input
when 'first_come_first_served'
'open_to_all'
when 'registration_of_interest'
'expression_of_interest'
when 'by_invitation'
'by_invitation'
end
input
end

def convert_event_types(input)
case input.downcase
when 'conference'
'conference'
when 'class'
'workshop'
when 'networking'
'meeting'
when 'meetings_and_conferences'
'meeting'
when 'workshops_and_courses'
'workshop'
end
input
end

def convert_location(input)
Expand Down
2 changes: 0 additions & 2 deletions lib/ingestors/material_ingestion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def save_valid_material(resource, matched)
end

def set_material_defaults(material)
# contact
material.contact = material.content_provider.contact if material.contact.nil? or material.contact.blank?
material
end

Expand Down

0 comments on commit bb201e3

Please sign in to comment.