You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is related, but we are still facing the same issue in Rails-7.2.1 and activerecord-sqlserver-adapter 7.2.1. .where('date_column < ?', date) is throwing "undefined method `value_for_database'"
where("written_on < ?", Time.now) ✅
where("written_on < ?", Date.today) ❌
where("written_on < ?", DateTime.current) ❌
So, it seems to work only for Time objects, but not Date or DateTime objects.
Adding checks for type.is_a?(Date) || type.is_a?(DateTime) in #basic_attribute_type? would fix these specific cases, but I don't know the codebase well enough to say, if this would break something else.
The text was updated successfully, but these errors were encountered:
SELECT [my_models].* FROM [my_models] WHERE [my_models].[updated_at] >= '10-05-2024' AND [my_models].[updated_at] < '10-16-2024'"
However, I do not use american date formats. And I don't believe I am setting that anywhere. So maybe the problems is that dates do not default to iso-format as they used to?
@nielsjansendk: I think, if you don't set the format explicitly anywhere in your codebase, the format is fetched from the SQL Server.
Maybe you can run DBCC USEROPTIONS on your SQL Server and post the value of option dateformat here?
Originally posted by @aaronsajo in #1166 (comment)
The text was updated successfully, but these errors were encountered: