File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 66- [ #876 ] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/876 ) Use native String#end_with
77- [ #873 ] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/873 ) Various fixes to get the tests running for Rails 6.1
88- [ #874 ] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/874 ) Deduplicate schema cache structures
9+ - [ #875 ] ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/875 ) Handle default boolean column values when deduplicating
910
1011#### Changed
1112
Original file line number Diff line number Diff line change @@ -27,6 +27,22 @@ def is_utf8?
2727 def case_sensitive?
2828 collation && collation . match ( /_CS/ )
2929 end
30+
31+ private
32+
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.
36+ def deduplicated
37+ @name = -name
38+ @sql_type_metadata = sql_type_metadata . deduplicate if sql_type_metadata
39+ @default = ( default . frozen? ? default : -default ) if default
40+ @default_function = -default_function if default_function
41+ @collation = -collation if collation
42+ @comment = -comment if comment
43+
44+ freeze
45+ end
3046 end
3147 end
3248end
You can’t perform that action at this time.
0 commit comments