Class: Preneeds::MilitaryRankInput
- Inherits:
-
Common::Base
- Object
- Common::Base
- Preneeds::MilitaryRankInput
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/preneeds/military_rank_input.rb
Overview
Models the input needed to query Service#get_military_rank_for_branch_of_service For use within the BurialForm form.
Instance Attribute Summary collapse
-
#branch_of_service ⇒ String
Branch of service abbreviated code.
-
#end_date ⇒ XmlDate
End date of branch of service.
-
#start_date ⇒ XmlDate
Start date for branch of service.
Attributes inherited from Common::Base
Method Summary
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes
Constructor Details
This class inherits a constructor from Common::Base
Instance Attribute Details
#branch_of_service ⇒ String
Returns branch of service abbreviated code.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/preneeds/military_rank_input.rb', line 17 class MilitaryRankInput < Common::Base include ActiveModel::Validations # Some branches have no end_date, but api requires it just the same validates :start_date, :end_date, presence: true, format: /\A\d{4}-\d{2}-\d{2}\z/ validates :branch_of_service, format: /\A\w{2}\z/ attribute :branch_of_service, String attribute :start_date, XmlDate attribute :end_date, XmlDate end |
#end_date ⇒ XmlDate
Returns end date of branch of service.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/preneeds/military_rank_input.rb', line 17 class MilitaryRankInput < Common::Base include ActiveModel::Validations # Some branches have no end_date, but api requires it just the same validates :start_date, :end_date, presence: true, format: /\A\d{4}-\d{2}-\d{2}\z/ validates :branch_of_service, format: /\A\w{2}\z/ attribute :branch_of_service, String attribute :start_date, XmlDate attribute :end_date, XmlDate end |
#start_date ⇒ XmlDate
Returns start date for branch of service.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/preneeds/military_rank_input.rb', line 17 class MilitaryRankInput < Common::Base include ActiveModel::Validations # Some branches have no end_date, but api requires it just the same validates :start_date, :end_date, presence: true, format: /\A\d{4}-\d{2}-\d{2}\z/ validates :branch_of_service, format: /\A\w{2}\z/ attribute :branch_of_service, String attribute :start_date, XmlDate attribute :end_date, XmlDate end |