Skip to content

Instantly share code, notes, and snippets.

@chelseatroy

chelseatroy/workout.rb

Last active Sep 20, 2018
Embed
What would you like to do?
Example: Data Import as a Process
class Workout
property :description, type: String
property :date, type: DateTime
enum status: [:needs_revision, :complete]
property :status, default: :complete
scope :complete, -> { where(status: :complete) }
scope :needs_revision, -> { where(status: :needs_revision) }
validates :date, presence: true
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.