Skip to content

Commit b4cf871

Browse files
Rails: Prefer timestamps over booleans (#723)
Back boolean concepts like deleted? or published? with timestamps columns in the database `deleted_at`, `published_at`. This can be valuable when you need to know **when** something took place. [1]: https://github.com/calebhearth/time_for_a_boolean
1 parent 05ff75b commit b4cf871

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rails/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
- Use private instead of protected when defining controller methods.
44
- Name date columns with `_on` suffixes.
55
- Name datetime columns with `_at` suffixes.
6+
- Back boolean concepts like deleted? or published? with timestamps columns in the database `deleted_at`, `published_at`.
7+
This can be valuable when you need to know **when** something took place. [Time for A Boolean](https://github.com/calebhearth/time_for_a_boolean) provides a nice interface for this.
68
- Name time columns (referring to a time of day with no date) with `_time`
79
suffixes.
810
- Name initializers for their gem name.

0 commit comments

Comments
 (0)