Skip to content

Commit b2b5fa9

Browse files
committed
Include Calculations module instead of prepending
Another gem (groupdate) also patches the #calculate method and prepending this module prevents any other libraries from patching this method.
1 parent 3c89b8e commit b2b5fa9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ def build_count_subquery(relation, column_name, distinct)
3939

4040
ActiveSupport.on_load(:active_record) do
4141
mod = ActiveRecord::ConnectionAdapters::SQLServer::CoreExt::Calculations
42-
ActiveRecord::Relation.prepend(mod)
42+
ActiveRecord::Relation.include(mod)
4343
end

0 commit comments

Comments
 (0)