-
-
Save eqbal/948ffcb0b52d818e7301b3874b2bf967 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/forms/entry_form.rb | |
class EntryForm | |
include ActiveModel::Model | |
attr_accessor :distance, :time_period, :date_time, | |
:status_weather, :status_landform | |
validates_presence_of :distance, :time_period, :date_time | |
validates_numericality_of :distance, :time_period | |
validates :status_weather, inclusion: { | |
in: EntryStatus::OPTIONS[:weather] | |
} | |
validates :status_landform, inclusion: { | |
in: EntryStatus::OPTIONS[:landform] | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment