Skip to content
Extraits de code Groupes Projets
Valider c12103ae rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Deal with ids from PG coming out as strings

parent 2d3eeb9c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -302,7 +302,9 @@ describe Postzord::Dispatch do
it 'should call object#socket_to_user for each local user' do
sc = mock()
SocketsController.should_receive(:new).and_return(sc)
sc.should_receive(:outgoing).with(bob, @zord.instance_variable_get(:@object), :aspect_ids => bob.contact_for(alice.person).aspect_memberships.map{|a| a.aspect_id})
sc.should_receive(:outgoing).with(bob,
@zord.instance_variable_get(:@object),
:aspect_ids => bob.contact_for(alice.person).aspect_memberships.map{|a| postgres? ? a.aspect_id.to_s : a.aspect_id })
@zord.send(:socket_and_notify_users, [bob])
end
......
......@@ -83,3 +83,7 @@ end
def photo_fixture_name
@photo_fixture_name = File.join(File.dirname(__FILE__), 'fixtures', 'button.png')
end
def postgres?
defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter