Module: GonHelper

Included in:
PeopleController
Defined in:
app/helpers/gon_helper.rb

Instance Method Summary collapse

Instance Method Details

#gon_load_contact(contact) ⇒ Object


4
5
6
7
8
9
# File 'app/helpers/gon_helper.rb', line 4

def gon_load_contact(contact)
  Gon.preloads[:contacts] ||= []
  if Gon.preloads[:contacts].none? {|stored_contact| stored_contact[:person][:id] == contact.person_id }
    Gon.preloads[:contacts] << ContactPresenter.new(contact, current_user).full_hash_with_person
  end
end