提交 eed9f15b 编写于 作者: C Carlos Antonio da Silva

Improve Active Record changelog [ci skip]

上级 f265e0dd
* Raise error when non-existent enum used in query
This change will raise an error when a non-existent enum is passed to a query. Previously
with MySQL this would return an unrelated record. Fixes #38687.
* Raise error when non-existent enum used in query.
This change will raise an error when a non-existent enum is passed to a query.
Previously with MySQL this would return an unrelated record. Fixes #38687.
```ruby
class User < ActiveRecord::Base
enum status: { active: 0, non_active: 1 }
end
User.where(status: :non_existing_status)
=> ArgumentError ('non_existing_status' is not a valid status)
```
*Atul Kanswal *
* Dump the schema or structure of a database when calling db:migrate:name
*Atul Kanswal*
* Dump the schema or structure of a database when calling `db:migrate:name`.
In previous versions of Rails, `rails db:migrate` would dump the schema of the database. In Rails 6, that holds true (`rails db:migrate` dumps all databases' schemas), but `rails db:migrate:name` does not share that behavior.
......@@ -19,7 +22,7 @@
*Kyle Thompson*
* Reset the `ActiveRecord::Base` connection after `rails db:migrate:name`
* Reset the `ActiveRecord::Base` connection after `rails db:migrate:name`.
When `rails db:migrate` has finished, it ensures the `ActiveRecord::Base` connection is reset to its original configuration. Going forward, `rails db:migrate:name` will have the same behavior.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册