File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,15 @@ def case_sensitive?
3030
3131 private
3232
33- # Handle when the default value is a boolean. Boolean's do not respond to the method `:-@`. Method now
34- # checks whether the default value is already frozen and if so it uses that, otherwise it calls `:-@` to
35- # freeze it.
33+ # Change to Rails implementation that handles when the `default` object does not respond to the `:-@` method
34+ # call. Examples of classes that do not respond to `:-@` are `TrueClass`, `FalseClass` and `Date`.
35+ #
36+ # The `default` object for other database adapters is always a String. This isn't the case for the SQL Server
37+ # adapter.
3638 def deduplicated
3739 @name = -name
3840 @sql_type_metadata = sql_type_metadata . deduplicate if sql_type_metadata
39- @default = ( default . frozen? ? default : - default ) if default
41+ @default = ( default . respond_to? ( :-@ ) ? - default : default . dup . freeze ) if default
4042 @default_function = -default_function if default_function
4143 @collation = -collation if collation
4244 @comment = -comment if comment
You can’t perform that action at this time.
0 commit comments