Skip to content

Instantly share code, notes, and snippets.

@ArturLyapin
Last active November 5, 2015 10:57
Show Gist options
  • Save ArturLyapin/30bec90f2a487b43fdb0 to your computer and use it in GitHub Desktop.
Save ArturLyapin/30bec90f2a487b43fdb0 to your computer and use it in GitHub Desktop.
#№1 Делает 2 select запроса по индексам. Должен работать быстрее
@campaign.participant_data_items.find_by(:name => "email", :value => "email@email.com").try(:participant)
#№2 Делает один тяжеловесный запрос
@store.participants.with_info_email("email@email.com", @campaign.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment