state_machines-activerecord
StateMachines Active Record Integration (by state-machines)
time_for_a_boolean
Back boolean concepts like deleted?, published?, or active? with timestamps (by calebhearth)
state_machines-activerecord | time_for_a_boolean | |
---|---|---|
1 | 3 | |
393 | 93 | |
1.8% | - | |
3.7 | 0.0 | |
2 months ago | 7 months ago | |
Ruby | Ruby | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
state_machines-activerecord
Posts with mentions or reviews of state_machines-activerecord.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-09-17.
-
ActiveRecord: Adding Boolean methods for DateTime columns
Might this be better handled with a state machine with active record integration?
time_for_a_boolean
Posts with mentions or reviews of time_for_a_boolean.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-09-17.
-
ActiveRecord: Adding Boolean methods for DateTime columns
There's a gem that handles this behavior. I haven't personally used it, but I heard about it on the Bikeshed podcast. time_for_a_boolean
-
Is there a convention to implement this (more) efficiently and elegantly?
There's a gem for treating timestamp columns like booleans https://github.com/calebhearth/time_for_a_boolean. I haven't personally used it, but it seems to be a similar solution to what some people here have suggested
-
Mechanism for marking messages "read" in our chat module in our rail's app.
It might not be the most efficient if your app scales to millions of messages, but perhaps adding another table with a schema like `message_id`, `user_id`, `read_at`. Don't forget to eager load this new relation, as it can lead to N+1 errors.On the app that I work on, we use the gem time_for_a_boolean which allows us to treat a nullable timestamp field. It might be useful for your project too.
What are some alternatives?
When comparing state_machines-activerecord and time_for_a_boolean you can also consider the following projects:
state_machines - Adds support for creating state machines for attributes on any Ruby class
rubygems - Library packaging and distribution for Ruby.