Closed jordanbyron closed 13 years ago
I've got a working patch, but I'm reconsidering. There are already self.published and published? methods on the model which check the release date, which may lead to confusion. Changing the name to is_published is still a bit confusing. Also, won't a new field defaulted to false require a ninja update to prevent existing puzzles from being hidden?
We could invert this - create a "hidden" flag which is set to true on puzzle creation, and allow "published" to continue to mean a combination of date, flag, draft access, and admin.
What do you think?
There are already self.published and published? methods on the model
Puzzle#published?
can be removed, and Puzzle.published
just needs to be re-written to look at the new published
flag.
Also, won't a new field defaulted to false require a ninja update to prevent existing puzzles from being hidden?
Why don't we have the migration default the new field to false, but then also update existing Puzzles in the database who's release date <= Date.today and set their published values to true. Make sense?
Fixed in Pull Request #36
Currently puzzles are "published" on or after their release date. Because of this, some puzzles can be released before they are ready. Instead a simple boolean flag should be added to Puzzle
Puzzle#published