I’m trying to make a design choice on some code I’m refactoring.
In my application I have a ActiveRecord model ContestEntry. After a certain time, the entries are considered live. I need to display these entries in a table which I populate via json. There are methods that I would call on the entries only when they are live. I’m debating using a concern or a new class which inherits from ContestEntry. Feel free to suggest something completely different.
Example new class:
class LiveContestEntry < ContestEntry ##some methods ## override as_json end
module Concerns module Live extend ActiveSupport::Concern ##some methods ##live_to_json end end