Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 4d04180

Browse files
author
andreysaleba
committed
Replaces .tables method calls to .data_sources to avoid using of deprecated Rails API
1 parent e42d6d7 commit 4d04180

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ bower.json
4747

4848
# Ignore built gem
4949
*.gem
50+
51+
.idea
52+
*.iml

lib/hyper-operation/transport/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Hyperloop
22
module AutoCreate
33
def needs_init?
44
return false if Hyperloop.transport == :none
5-
return true unless connection.tables.include?(table_name)
5+
return true unless connection.data_sources.include?(table_name)
66
return false unless Hyperloop.on_server?
77
return true if defined?(Rails::Server)
88
return true unless Connection.root_path

spec/aaa-connection_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
end
1313

1414
it 'creates the tables' do
15-
ActiveRecord::Base.connection.tables.should include('hyperloop_connections')
16-
ActiveRecord::Base.connection.tables.should include('hyperloop_queued_messages')
15+
ActiveRecord::Base.connection.data_sources.should include('hyperloop_connections')
16+
ActiveRecord::Base.connection.data_sources.should include('hyperloop_queued_messages')
1717
described_class.column_names.should =~ ['id', 'channel', 'session', 'created_at', 'expires_at', 'refresh_at']
1818
end
1919

0 commit comments

Comments
 (0)