Skip to content

Commit 7dcff73

Browse files
authored
Updated sample code for connection configuration (#1242)
1 parent 68d1c0f commit 7dcff73

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,14 @@ configuration then implement the `configure_connection` method in an initializer
105105
example we are setting the `TEXTSIZE` to 64 megabytes.
106106

107107
```ruby
108-
module ActiveRecord
109-
module ConnectionAdapters
110-
class SQLServerAdapter < AbstractAdapter
111-
def configure_connection
112-
super
113-
@raw_connection.execute("SET TEXTSIZE #{64.megabytes}").do
114-
end
108+
ActiveRecord::ConnectionAdapters::SQLServerAdapter.prepend(
109+
Module.new do
110+
def configure_connection
111+
super
112+
@raw_connection.execute("SET TEXTSIZE #{64.megabytes}").do
115113
end
116114
end
117-
end
115+
)
118116
```
119117

120118
#### Configure Application Name

0 commit comments

Comments
 (0)