Deal with ids from PG coming out as strings
This commit is contained in:
parent
2d3eeb9c46
commit
c12103aed9
2 changed files with 7 additions and 1 deletions
|
|
@ -302,7 +302,9 @@ describe Postzord::Dispatch do
|
||||||
it 'should call object#socket_to_user for each local user' do
|
it 'should call object#socket_to_user for each local user' do
|
||||||
sc = mock()
|
sc = mock()
|
||||||
SocketsController.should_receive(:new).and_return(sc)
|
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])
|
@zord.send(:socket_and_notify_users, [bob])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,3 +83,7 @@ end
|
||||||
def photo_fixture_name
|
def photo_fixture_name
|
||||||
@photo_fixture_name = File.join(File.dirname(__FILE__), 'fixtures', 'button.png')
|
@photo_fixture_name = File.join(File.dirname(__FILE__), 'fixtures', 'button.png')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def postgres?
|
||||||
|
defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) && ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue