Skip to content

Instantly share code, notes, and snippets.

@adamgamble
Created June 27, 2011 00:18
Show Gist options
  • Save adamgamble/1048119 to your computer and use it in GitHub Desktop.
Save adamgamble/1048119 to your computer and use it in GitHub Desktop.
object @prospect
attributes :height, :weight
code :image do |p|
{:large => root_url.chop + p.image.url(:large), :thumb => root_url.chop + p.image.url(:thumb)}
end
code :primary_position do |p|
p.primary_position.try(:name)
end
code :high_school do |p|
p.high_school.try(:name)
end
code :offered_colleges do |p|
colleges = []
p.offered_colleges.each do |offered_college_interest|
colleges << {:id => offered_college_interest.college.id, :name => offered_college_interest.college.name}
end
colleges
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment