Skip to content

Commit 970e831

Browse files
author
Carlos Silva
committed
Quick fix inheritance initialization to avoid mistakes while loading records
1 parent b8bb59b commit 970e831

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/torque/postgresql/inheritance.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def inheritance_merged_attributes
3939

4040
# Check if the model's table depends on any inheritance
4141
def physically_inherited?
42-
return false unless connected?
43-
4442
@physically_inherited ||= connection.schema_cache.dependencies(
4543
defined?(@table_name) ? @table_name : decorated_table_name,
4644
).present?
45+
rescue ActiveRecord::ConnectionNotEstablished
46+
false
4747
end
4848

4949
# Get the list of all tables directly or indirectly dependent of the

lib/torque/postgresql/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Torque
22
module PostgreSQL
3-
VERSION = '0.2.15'
3+
VERSION = '0.2.16'
44
end
55
end

0 commit comments

Comments
 (0)