Created
May 30, 2016 08:31
-
-
Save bitsapien/489ce829a6ae0aba830a2fffa4c80d1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/concerns/states.rb | |
module States | |
extend ActiveSupport::Concern | |
included do | |
enum state: [ :in_process, :processing, :processed, :failed_processing, :verified ,:deleted, :invalid_file, :sent_to_api ] | |
end | |
end | |
# app/models/input_tracker.rb | |
class InputTracker < ApplicationRecord | |
has_one :output_tracker | |
include States | |
end | |
# app/models/output_tracker.rb | |
class OutputTracker < ApplicationRecord | |
belongs_to :input_tracker | |
include States | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment