app/models/taxon.rb
# Sometimes you don't want to make a new taxon name with a taxon, like when
# you're saving a new taxon name with a new associated taxon. Hence, this.
Sometimes you don't want to make a new taxon name with a taxon, like when
you're saving a new taxon name with a new associated taxon. Hence, this.
Sometimes you don ' t want to make a new taxon name with a taxon like when you ' re saving a new taxon name with a new associated taxon . Hence this .
def default_photo
    @default_photo ||= if taxon_photos.loaded?
      taxon_photos.sort_by{|tp| tp.position || tp.id}.first.try(:photo)
    else
      taxon_photos.first(:include => [:photo]).try(:photo)
    end
    @default_photo
  end
def default_photo @default_photo ||= if taxon_photos . loaded? taxon_photos . sort_by { | tp | tp . position || tp . id } . first . try ( :photo ) else taxon_photos . first ( :include => [ :photo ] ) . try ( :photo ) end @default_photo end
Sometimes you don't want to make a new taxon name with a taxon, like when
you're saving a new taxon name with a new associated taxon.
Sometimes you don ' t want to make a new taxon name with a taxon like when you ' re saving a new taxon name with a new associated taxon .