aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-09-19 16:46:22 +0200
committerTeddy Wing2017-09-19 16:46:22 +0200
commit30fc0d3f1a9a158a0d45bbaf2f78e176f74ac943 (patch)
tree942faf06cecded71319340a0f1f9b19a47336060
parent2f555897bff3f8fa6dd5e9e0c6d48f0073edc349 (diff)
downloadchouette-core-30fc0d3f1a9a158a0d45bbaf2f78e176f74ac943.tar.bz2
ModelAttribute: Add `ModelAttribute`s for a bunch of models&attributes
We want to define `ModelAttribute`s for an initial set of `Chouette` models: * Chouette::Route * Chouette::JourneyPattern * Chouette::VehicleJourney * Chouette::Footnote * Chouette::TimeTable * Chouette::RoutingConstraintZone I added these by looking at the `schema.rb` as well as some form views for these models. Given that information, I made some guesses about what attributes it might make sense to add here. We want to end up with a collection of only editable attributes for these models, so this excludes things like `created_at`, foreign keys, and programmatically set fields. This is my guess at what those fields are. We can refine the list later. We'll be using this list for Compliance Control to get a set of fields of a given type in order to create custom validations using those fields. Refs #4401
-rw-r--r--lib/model_attribute.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/model_attribute.rb b/lib/model_attribute.rb
index b1297d43d..081d0cd0f 100644
--- a/lib/model_attribute.rb
+++ b/lib/model_attribute.rb
@@ -15,5 +15,44 @@ class ModelAttribute
@data_type = data_type
end
+ # Chouette::Route
+ define :route, :name, :string
+ define :route, :published_name, :string
+ define :route, :comment, :string
+ define :route, :number, :string
+ define :route, :direction, :string
+ define :route, :wayback, :string
+
+ # Chouette::JourneyPattern
define :journey_pattern, :name, :string
+ define :journey_pattern, :published_name, :string
+ define :journey_pattern, :comment, :string
+ define :journey_pattern, :registration_number, :string
+ define :journey_pattern, :section_status, :integer
+
+ # Chouette::VehicleJourney
+ define :vehicle_journey, :comment, :string
+ define :vehicle_journey, :status_value, :string
+ define :vehicle_journey, :transport_mode, :string
+ define :vehicle_journey, :facility, :string
+ define :vehicle_journey, :published_journey_name, :string
+ define :vehicle_journey, :published_journey_identifier, :string
+ define :vehicle_journey, :vehicle_type_identifier, :string
+ define :vehicle_journey, :number, :integer
+ define :vehicle_journey, :mobility_restricted_suitability, :boolean
+ define :vehicle_journey, :flexible_service, :boolean
+
+ # Chouette::Footnote
+ define :footnote, :code, :string
+ define :footnote, :label, :string
+
+ # Chouette::TimeTable
+ define :time_table, :version, :string
+ define :time_table, :comment, :string
+ define :time_table, :start_date, :date
+ define :time_table, :end_date, :date
+ define :time_table, :color, :string
+
+ # Chouette::RoutingConstraintZone
+ define :routing_constraint_zone, :name, :string
end