An abundance of ternary operators I'd like to find a way to do what this method does in a cleaner, less hacky looking way 

 def self.create_from_person!(person)
    spi = new(:person =&gt; person, :provider =&gt; person.provider)
    spi.age_eligible_code = participant.age_eligible?(person) ? 1 : 2
    spi.county_of_residence_code = participant.psu_county_eligible?(person) ? 1 : 2
    spi.first_prenatal_visit_code = participant.first_visit?(person) ? 1 : 2
    spi.pregnancy_eligible_code = participant.pbs_pregnant?(person) ? 1 : 2
    spi.save!
  end


Any thoughts?
Notes:


Any reason not to set the attributes in a single create step? 
DRY by using procs for short-lived functions.
Methods should return meaningful values. Here it makes sense to return the newly created object.
(As Mark pointed out) The mismatch names between attributes makes the code more verbose that it should be. However, I guess part of this mismatch already comes from the app you are patching.
:provider =&gt; person.provider. Note that this can break referential integrity. Person may change its provider in the future, but this model will remain as it is.


I'd write:

def self.create_from_person!(person)
  code = lambda { |value| value ? 1 : 2 }
  create!({
    :person =&gt; person, 
    :provider =&gt; person.provider,
    :age_eligible_code =&gt; code[participant.age_eligible?(person)],
    :county_of_residence_code =&gt; code[participant.psu_county_eligible?(person)],
    :first_prenatal_visit_code =&gt; code[participant.first_visit?(person)],
    :pregnancy_eligible_code =&gt; code[participant.pbs_pregnant?(person)],
  })
end