aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorcedricnjanga2017-09-20 17:11:27 +0200
committercedricnjanga2017-09-20 17:11:27 +0200
commite62e1036eeeca9df7397f0dbd930ececc7297ec1 (patch)
tree3bff5a676b9cd2a5cd8a6cb8ca1bccc017de24aa /app
parent2ef17c0f8150d834fdf266c85a3caeed57987dd8 (diff)
downloadchouette-core-e62e1036eeeca9df7397f0dbd930ececc7297ec1.tar.bz2
Add the rest of compliance control models
Diffstat (limited to 'app')
-rw-r--r--app/models/generic_attribute_pattern.rb23
-rw-r--r--app/models/generic_attribute_uniqueness.rb23
-rw-r--r--app/models/journey_pattern_control/vehicle_journey.rb13
-rw-r--r--app/models/line_control/route.rb13
-rw-r--r--app/models/route_control/journey_pattern.rb13
-rw-r--r--app/models/route_control/opposite_route_terminus.rb13
-rw-r--r--app/models/routing_constaint_zone_control/maximum_length.rb13
-rw-r--r--app/models/routing_constaint_zone_control/minimum_length.rb13
8 files changed, 124 insertions, 0 deletions
diff --git a/app/models/generic_attribute_pattern.rb b/app/models/generic_attribute_pattern.rb
new file mode 100644
index 000000000..0043f1563
--- /dev/null
+++ b/app/models/generic_attribute_pattern.rb
@@ -0,0 +1,23 @@
+#module ComplianceControls
+
+ class GenericAttributePattern < ComplianceControl
+
+ hstore_accessor :control_attributes, value: :string, pattern: :string
+
+ @@default_criticity = :warning
+ @@default_code = "3-Generic-3"
+
+ validate :pattern_match
+ def pattern_match
+ true
+ end
+
+ after_initialize do
+ self.name = 'GenericAttributeMinMax'
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+
+ end
+
+#end \ No newline at end of file
diff --git a/app/models/generic_attribute_uniqueness.rb b/app/models/generic_attribute_uniqueness.rb
new file mode 100644
index 000000000..dcf4a16c2
--- /dev/null
+++ b/app/models/generic_attribute_uniqueness.rb
@@ -0,0 +1,23 @@
+#module ComplianceControls
+
+ class GenericAttributeUniqueness < ComplianceControl
+
+ hstore_accessor :control_attributes, name: :string
+
+ @@default_criticity = :warning
+ @@default_code = "3-Generic-3"
+
+ validate :unique_values
+ def unique_values
+ true
+ end
+
+ after_initialize do
+ self.name = 'GenericAttributeMinMax'
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+
+ end
+
+#end \ No newline at end of file
diff --git a/app/models/journey_pattern_control/vehicle_journey.rb b/app/models/journey_pattern_control/vehicle_journey.rb
new file mode 100644
index 000000000..a90c16138
--- /dev/null
+++ b/app/models/journey_pattern_control/vehicle_journey.rb
@@ -0,0 +1,13 @@
+module JourneyPatternControl
+ class VehicleJourney < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-JourneyPattern-2"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/line_control/route.rb b/app/models/line_control/route.rb
new file mode 100644
index 000000000..8ac13a080
--- /dev/null
+++ b/app/models/line_control/route.rb
@@ -0,0 +1,13 @@
+module LineControl
+ class Route < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-Line-1"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/route_control/journey_pattern.rb b/app/models/route_control/journey_pattern.rb
new file mode 100644
index 000000000..0559fac42
--- /dev/null
+++ b/app/models/route_control/journey_pattern.rb
@@ -0,0 +1,13 @@
+module RouteControl
+ class JourneyPattern < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-Route-3"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/route_control/opposite_route_terminus.rb b/app/models/route_control/opposite_route_terminus.rb
new file mode 100644
index 000000000..e72229ca3
--- /dev/null
+++ b/app/models/route_control/opposite_route_terminus.rb
@@ -0,0 +1,13 @@
+module RouteControl
+ class OppositeRouteTerminus < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-Route-5"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/routing_constaint_zone_control/maximum_length.rb b/app/models/routing_constaint_zone_control/maximum_length.rb
new file mode 100644
index 000000000..fd63ffeda
--- /dev/null
+++ b/app/models/routing_constaint_zone_control/maximum_length.rb
@@ -0,0 +1,13 @@
+module RoutingConstaintZoneControl
+ class MaximumLength < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-ITL-2"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file
diff --git a/app/models/routing_constaint_zone_control/minimum_length.rb b/app/models/routing_constaint_zone_control/minimum_length.rb
new file mode 100644
index 000000000..c17bbc834
--- /dev/null
+++ b/app/models/routing_constaint_zone_control/minimum_length.rb
@@ -0,0 +1,13 @@
+module RoutingConstaintZoneControl
+ class MinimumLength < ComplianceControl
+
+ @@default_criticity = :warning
+ @@default_code = "3-ITL-3"
+
+ after_initialize do
+ self.name = self.class.name
+ self.code = @@default_code
+ self.criticity = @@default_criticity
+ end
+ end
+end \ No newline at end of file