Skip to content

Commit b52404f

Browse files
modno
1 parent 0e7b4d1 commit b52404f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/umbrellio_utils/sql.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ module UmbrellioUtils
44
module SQL
55
extend self
66

7-
UniqueConstraintViolation = Sequel::UniqueConstraintViolation if defined?(::Sequel)
7+
if defined?(::Rails) && defined?(::Sequel)
8+
Rails.configuration.after_initialize do
9+
UniqueConstraintViolation = Sequel::UniqueConstraintViolation if defined?(::Sequel)
10+
end
11+
elsif defined?(::Sequel)
12+
UniqueConstraintViolation = Sequel::UniqueConstraintViolation if defined?(::Sequel)
13+
end
814

915
def [](*args)
1016
Sequel[*args]

0 commit comments

Comments
 (0)