Skip to content

Commit a8fbc77

Browse files
authored
Merge pull request #783 from kryali/master
Replace deprecated ActiveRecord::Base.connection via with_connection
2 parents 77da613 + c48ca73 commit a8fbc77

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/authlogic/acts_as_authentic/queries/find_with_case.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@ def comparison
4242

4343
# @api private
4444
def insensitive_comparison
45-
@model_class.connection.case_insensitive_comparison(
46-
@model_class.arel_table[@field], @value
47-
)
45+
@model_class.with_connection do |connection|
46+
connection.case_insensitive_comparison(
47+
@model_class.arel_table[@field], @value
48+
)
49+
end
4850
end
4951

5052
# @api private
5153
def sensitive_comparison
5254
bound_value = @model_class.predicate_builder.build_bind_attribute(@field, @value)
53-
@model_class.connection.case_sensitive_comparison(
54-
@model_class.arel_table[@field], bound_value
55-
)
55+
@model_class.with_connection do |connection|
56+
connection.case_sensitive_comparison(
57+
@model_class.arel_table[@field], bound_value
58+
)
59+
end
5660
end
5761
end
5862
end

0 commit comments

Comments
 (0)