File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -842,6 +842,15 @@ class PostgreSQLAdapter < AbstractAdapter
842842 # setting, you should immediately run <tt>bin/rails db:migrate</tt> to update the types in your schema.rb.
843843 class_attribute :datetime_type , default : :timestamp
844844
845+ ##
846+ # :singleton-method:
847+ # Toggles automatic decoding of date columns.
848+ #
849+ # ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date").class #=> String
850+ # ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.decode_dates = true
851+ # ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.select_value("select '2024-01-01'::date").class #=> Date
852+ class_attribute :decode_dates , default : false
853+
845854 # Try to use as much of the built in postgres logic as possible
846855 # maybe someday we can extend the actual adapter
847856 include ActiveRecord ::ConnectionAdapters ::PostgreSQL ::ReferentialIntegrity
You can’t perform that action at this time.
0 commit comments