Skip to content

Commit 3d8741b

Browse files
committed
Char type data compared against it's string value. Fixes #487 #488
1 parent 42210f1 commit 3d8741b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#### Fixed
44

55
* Overwrite `_type_cast` method for char data. Fixes #491 #494
6+
* Char type data compared against it's string value. Fixes #487 #488
67

78

89
## v4.2.15

lib/active_record/connection_adapters/sqlserver/type/char.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def to_s
2929
end
3030
alias_method :to_str, :to_s
3131

32+
def ==(other)
33+
self.to_s == other.to_s
34+
end
35+
alias_method :eql?, :==
36+
3237
end
3338

3439
end

0 commit comments

Comments
 (0)