From 6dd60124b8b136b4b32abb835b16588e1b2492c0 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Fri, 15 Sep 2017 16:10:04 +0200 Subject: Initialize first model for compliance_control STI Refs #3550 @4 --- Gemfile | 1 + Gemfile.lock | 3 ++ app/models/compliance_control.rb | 5 ++- app/models/generic_attribute_min_max.rb | 27 ++++++++++++ ..._change_crticity_type_for_compliance_control.rb | 5 +++ db/schema.rb | 51 ++++++---------------- 6 files changed, 53 insertions(+), 39 deletions(-) create mode 100644 app/models/generic_attribute_min_max.rb create mode 100644 db/migrate/20170915100935_change_crticity_type_for_compliance_control.rb diff --git a/Gemfile b/Gemfile index 2334c3fd4..5965602c4 100644 --- a/Gemfile +++ b/Gemfile @@ -120,6 +120,7 @@ gem 'acts-as-taggable-on', '~> 4.0.0' gem 'acts_as_list', '~> 0.6.0' gem 'acts_as_tree', '~> 2.1.0', require: 'acts_as_tree' +gem "hstore_accessor", "~> 1.1" gem 'rabl' gem 'carrierwave', '~> 1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 1e2ac3cf8..fef3270a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -255,6 +255,8 @@ GEM hashdiff (0.3.4) highline (1.7.8) hike (1.2.3) + hstore_accessor (1.1.0) + activerecord (>= 4.0.0) htmlbeautifier (1.3.1) httparty (0.14.0) multi_xml (>= 0.5.2) @@ -602,6 +604,7 @@ DEPENDENCIES georuby-ext (= 0.0.5) google-analytics-rails has_array_of! + hstore_accessor (~> 1.1) htmlbeautifier i18n-tasks inherited_resources diff --git a/app/models/compliance_control.rb b/app/models/compliance_control.rb index 64556b524..12ff4737a 100644 --- a/app/models/compliance_control.rb +++ b/app/models/compliance_control.rb @@ -2,8 +2,11 @@ class ComplianceControl < ActiveRecord::Base belongs_to :compliance_control_set belongs_to :compliance_control_block - enum criticity: [:info, :warning, :error] + extend Enumerize + enumerize :criticity, in: %i(info warning error), scope: true, default: :info + validates :criticity, presence: true validates :name, presence: true validates :code, presence: true + validates :compliance_control_set, presence: true end diff --git a/app/models/generic_attribute_min_max.rb b/app/models/generic_attribute_min_max.rb new file mode 100644 index 000000000..e9a127c56 --- /dev/null +++ b/app/models/generic_attribute_min_max.rb @@ -0,0 +1,27 @@ +#module ComplianceControls + + class GenericAttributeMinMax < ComplianceControl + + + hstore_accessor :control_attributes, minimum: :integer, maximum: :integer + #attribute :minimum, type: :integer, optionnal: true + #attribute :maximum, type: :integer, optionnal: true + # #attribute :target, type: ModelAttribute + + @@default_criticity = :warning + @@default_code = "3-Generic-2" + + validate :min_max_values + def min_max_values + true + end + + after_initialize do + self.name = 'GenericAttributeMinMax' + self.code = @@default_code + self.criticity = @@default_criticity + end + + end + +#end diff --git a/db/migrate/20170915100935_change_crticity_type_for_compliance_control.rb b/db/migrate/20170915100935_change_crticity_type_for_compliance_control.rb new file mode 100644 index 000000000..f3e7e7339 --- /dev/null +++ b/db/migrate/20170915100935_change_crticity_type_for_compliance_control.rb @@ -0,0 +1,5 @@ +class ChangeCrticityTypeForComplianceControl < ActiveRecord::Migration + def change + change_column :compliance_controls, :criticity, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 5e2edf33d..7b6731d3f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170913074922) do +ActiveRecord::Schema.define(version: 20170915100935) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -237,7 +237,7 @@ ActiveRecord::Schema.define(version: 20170913074922) do t.json "control_attributes" t.string "name" t.string "code" - t.integer "criticity" + t.string "criticity" t.text "comment" t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -270,22 +270,6 @@ ActiveRecord::Schema.define(version: 20170913074922) do add_index "connection_links", ["objectid"], name: "connection_links_objectid_key", unique: true, using: :btree - create_table "delayed_jobs", id: :bigserial, force: :cascade do |t| - t.integer "priority", default: 0 - t.integer "attempts", default: 0 - t.text "handler" - t.text "last_error" - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" - t.string "locked_by", limit: 255 - t.string "queue", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree - create_table "exports", id: :bigserial, force: :cascade do |t| t.integer "referential_id", limit: 8 t.string "status" @@ -407,11 +391,11 @@ ActiveRecord::Schema.define(version: 20170913074922) do t.datetime "started_at" t.datetime "ended_at" t.string "token_download" - t.string "type", limit: 255 + t.string "type" t.integer "parent_id", limit: 8 t.string "parent_type" - t.integer "current_step", default: 0 - t.integer "total_steps", default: 0 + t.integer "current_step", default: 0 + t.integer "total_steps", default: 0 t.datetime "notified_parent_at" t.string "creator" end @@ -564,11 +548,6 @@ ActiveRecord::Schema.define(version: 20170913074922) do add_index "networks", ["objectid"], name: "networks_objectid_key", unique: true, using: :btree add_index "networks", ["registration_number"], name: "networks_registration_number_key", using: :btree - create_table "object_id_factories", id: :bigserial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "organisations", id: :bigserial, force: :cascade do |t| t.string "name" t.datetime "created_at" @@ -745,7 +724,7 @@ ActiveRecord::Schema.define(version: 20170913074922) do create_table "stop_areas", id: :bigserial, force: :cascade do |t| t.integer "parent_id", limit: 8 - t.string "objectid", null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 t.string "creator_id" t.string "name" @@ -754,8 +733,8 @@ ActiveRecord::Schema.define(version: 20170913074922) do t.string "registration_number" t.string "nearest_topic_name" t.integer "fare_code" - t.decimal "longitude", precision: 19, scale: 16 - t.decimal "latitude", precision: 19, scale: 16 + t.decimal "longitude", precision: 19, scale: 16 + t.decimal "latitude", precision: 19, scale: 16 t.string "long_lat_type" t.string "country_code" t.string "street_name" @@ -773,7 +752,7 @@ ActiveRecord::Schema.define(version: 20170913074922) do t.datetime "deleted_at" t.datetime "created_at" t.datetime "updated_at" - t.string "stif_type", limit: 255 + t.string "stif_type" end add_index "stop_areas", ["name"], name: "index_stop_areas_on_name", using: :btree @@ -844,18 +823,18 @@ ActiveRecord::Schema.define(version: 20170913074922) do add_index "time_table_periods", ["time_table_id"], name: "index_time_table_periods_on_time_table_id", using: :btree create_table "time_tables", id: :bigserial, force: :cascade do |t| - t.string "objectid", null: false - t.integer "object_version", limit: 8, default: 1 + t.string "objectid", null: false + t.integer "object_version", limit: 8, default: 1 t.string "creator_id" t.string "version" t.string "comment" - t.integer "int_day_types", default: 0 + t.integer "int_day_types", default: 0 t.date "start_date" t.date "end_date" t.integer "calendar_id", limit: 8 t.datetime "created_at" t.datetime "updated_at" - t.string "color", limit: 255 + t.string "color" t.integer "created_from_id" t.string "checksum" t.text "checksum_source" @@ -999,13 +978,9 @@ ActiveRecord::Schema.define(version: 20170913074922) do add_foreign_key "compliance_controls", "compliance_control_blocks" add_foreign_key "compliance_controls", "compliance_control_sets" add_foreign_key "group_of_lines_lines", "group_of_lines", name: "groupofline_group_fkey", on_delete: :cascade - add_foreign_key "journey_frequencies", "timebands", name: "journey_frequencies_timeband_id_fk", on_delete: :nullify add_foreign_key "journey_frequencies", "timebands", on_delete: :nullify - add_foreign_key "journey_frequencies", "vehicle_journeys", name: "journey_frequencies_vehicle_journey_id_fk", on_delete: :nullify add_foreign_key "journey_frequencies", "vehicle_journeys", on_delete: :nullify - add_foreign_key "journey_pattern_sections", "journey_patterns", name: "journey_pattern_sections_journey_pattern_id_fk", on_delete: :cascade add_foreign_key "journey_pattern_sections", "journey_patterns", on_delete: :cascade - add_foreign_key "journey_pattern_sections", "route_sections", name: "journey_pattern_sections_route_section_id_fk", on_delete: :cascade add_foreign_key "journey_pattern_sections", "route_sections", on_delete: :cascade add_foreign_key "journey_patterns", "routes", name: "jp_route_fkey", on_delete: :cascade add_foreign_key "journey_patterns", "stop_points", column: "arrival_stop_point_id", name: "arrival_point_fkey", on_delete: :nullify -- cgit v1.2.3 From 53905e28c067d6202252a476700e4847e0b7b4c1 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Sun, 17 Sep 2017 16:03:53 +0200 Subject: Avoid error when Import#started_at isn't defined --- app/views/imports/index.html.slim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/imports/index.html.slim b/app/views/imports/index.html.slim index 2203d3584..a6da730f1 100644 --- a/app/views/imports/index.html.slim +++ b/app/views/imports/index.html.slim @@ -24,7 +24,7 @@ ), \ TableBuilderHelper::Column.new( \ key: :started_at, \ - attribute: Proc.new { |n| l(n.started_at, format: :long) }, \ + attribute: Proc.new { |n| l(n.started_at, format: :long) if n.started_at }, \ ), \ TableBuilderHelper::Column.new( \ key: :name, \ -- cgit v1.2.3 From d271f0d7486ef2d1570e86ddb41a3cfcb4525221 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 18 Sep 2017 11:56:01 +0200 Subject: Fix import messages values Refs #1726 --- config/locales/import_messages.en.yml | 2 +- config/locales/import_messages.fr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/import_messages.en.yml b/config/locales/import_messages.en.yml index 1ecdebcd1..4719add31 100644 --- a/config/locales/import_messages.en.yml +++ b/config/locales/import_messages.en.yml @@ -10,7 +10,7 @@ en: 2_netexstif_2_2: "Le fichier calendriers.xml contient une frame nommée %{error_value} non acceptée" 2_netexstif_3_1: "Le fichier %{source_filename} ne contient pas de frame nommée NETEX_OFFRE_LIGNE" 2_netexstif_3_2: "Le fichier %{source_filename} contient une frame nommée %{error_value} non acceptée" - 2_netexstif_3_3: "la frame NETEX_OFFRE_LIGNE du fichier %{source_filename} ne contient pas la frame %{NETEX_STRUCTURE|NETEX_HORAIRE} obligatoire" + 2_netexstif_3_3: "la frame NETEX_OFFRE_LIGNE du fichier %{source_filename} ne contient pas la frame %{error_value} obligatoire" 2_netexstif_3_4: "la frame NETEX_OFFRE_LIGNE du fichier %{source_filename} contient une frame %{error_value} non acceptée" 2_netexstif_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'identifiant %{source_objectid} de l'objet %{source_label} ne respecte pas la syntaxe [CODESPACE]:%{source_label}:[identifiant Technique]:LOC" 2_netexstif_6: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet %{source_label} d'identifiant %{source_objectid} a un état de modification interdit : 'delete'" diff --git a/config/locales/import_messages.fr.yml b/config/locales/import_messages.fr.yml index 770cb2c30..6addccfe3 100644 --- a/config/locales/import_messages.fr.yml +++ b/config/locales/import_messages.fr.yml @@ -10,7 +10,7 @@ fr: 2_netexstif_2_2: "Le fichier calendriers.xml contient une frame nommée %{error_value} non acceptée" 2_netexstif_3_1: "Le fichier %{source_filename} ne contient pas de frame nommée NETEX_OFFRE_LIGNE" 2_netexstif_3_2: "Le fichier %{source_filename} contient une frame nommée %{error_value} non acceptée" - 2_netexstif_3_3: "la frame NETEX_OFFRE_LIGNE du fichier %{source_filename} ne contient pas la frame %{NETEX_STRUCTURE|NETEX_HORAIRE} obligatoire" + 2_netexstif_3_3: "la frame NETEX_OFFRE_LIGNE du fichier %{source_filename} ne contient pas la frame %{error_value} obligatoire" 2_netexstif_3_4: "la frame NETEX_OFFRE_LIGNE du fichier %{source_filename} contient une frame %{error_value} non acceptée" 2_netexstif_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'identifiant %{source_objectid} de l'objet %{source_label} ne respecte pas la syntaxe [CODESPACE]:%{source_label}:[identifiant Technique]:LOC" 2_netexstif_6: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet %{source_label} d'identifiant %{source_objectid} a un état de modification interdit : 'delete'" -- cgit v1.2.3 From 196f739a0d9ac8a911b5ac032dca383d646872f3 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 18 Sep 2017 15:00:00 +0200 Subject: Fix table name compliance_check_result to compliance_check_message Refs #4390 @2 --- app/models/compliance_check_message.rb | 4 +++ app/models/compliance_check_result.rb | 4 --- config/locales/compliance_check_results.en.yml | 3 +- config/locales/compliance_check_results.fr.yml | 3 +- ...nce_check_result_to_compliance_check_message.rb | 5 ++++ db/schema.rb | 34 +++++++++++----------- lib/tasks/erd.rake | 4 +-- spec/factories/compliance_check_messages.rb | 7 +++++ spec/factories/compliance_check_results.rb | 7 ----- spec/models/compliance_check_message_spec.rb | 10 +++++++ spec/models/compliance_check_result_spec.rb | 10 ------- 11 files changed, 47 insertions(+), 44 deletions(-) create mode 100644 app/models/compliance_check_message.rb delete mode 100644 app/models/compliance_check_result.rb create mode 100644 db/migrate/20170918103913_alter_table_compliance_check_result_to_compliance_check_message.rb create mode 100644 spec/factories/compliance_check_messages.rb delete mode 100644 spec/factories/compliance_check_results.rb create mode 100644 spec/models/compliance_check_message_spec.rb delete mode 100644 spec/models/compliance_check_result_spec.rb diff --git a/app/models/compliance_check_message.rb b/app/models/compliance_check_message.rb new file mode 100644 index 000000000..86899eb15 --- /dev/null +++ b/app/models/compliance_check_message.rb @@ -0,0 +1,4 @@ +class ComplianceCheckMessage < ActiveRecord::Base + belongs_to :compliance_check + belongs_to :compliance_check_resource +end diff --git a/app/models/compliance_check_result.rb b/app/models/compliance_check_result.rb deleted file mode 100644 index 161e45189..000000000 --- a/app/models/compliance_check_result.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ComplianceCheckResult < ActiveRecord::Base - belongs_to :compliance_check - belongs_to :compliance_check_resource -end diff --git a/config/locales/compliance_check_results.en.yml b/config/locales/compliance_check_results.en.yml index e0541ab36..cd22aefb1 100644 --- a/config/locales/compliance_check_results.en.yml +++ b/config/locales/compliance_check_results.en.yml @@ -1,3 +1,2 @@ en: - compliance_check_results: - + compliance_check_messages: diff --git a/config/locales/compliance_check_results.fr.yml b/config/locales/compliance_check_results.fr.yml index b3ddc53f2..d3fbf0900 100644 --- a/config/locales/compliance_check_results.fr.yml +++ b/config/locales/compliance_check_results.fr.yml @@ -1,3 +1,2 @@ fr: - compliance_check_results: - + compliance_check_messages: diff --git a/db/migrate/20170918103913_alter_table_compliance_check_result_to_compliance_check_message.rb b/db/migrate/20170918103913_alter_table_compliance_check_result_to_compliance_check_message.rb new file mode 100644 index 000000000..c0dc6225a --- /dev/null +++ b/db/migrate/20170918103913_alter_table_compliance_check_result_to_compliance_check_message.rb @@ -0,0 +1,5 @@ +class AlterTableComplianceCheckResultToComplianceCheckMessage < ActiveRecord::Migration + def change + rename_table :compliance_check_results, :compliance_check_messages + end +end diff --git a/db/schema.rb b/db/schema.rb index 7b6731d3f..2b62fa7f1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170915100935) do +ActiveRecord::Schema.define(version: 20170918103913) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -155,17 +155,7 @@ ActiveRecord::Schema.define(version: 20170915100935) do add_index "compliance_check_blocks", ["compliance_check_set_id"], name: "index_compliance_check_blocks_on_compliance_check_set_id", using: :btree - create_table "compliance_check_resources", id: :bigserial, force: :cascade do |t| - t.string "status" - t.string "name" - t.string "type" - t.string "reference" - t.hstore "metrics" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "compliance_check_results", id: :bigserial, force: :cascade do |t| + create_table "compliance_check_messages", id: :bigserial, force: :cascade do |t| t.integer "compliance_check_id" t.integer "compliance_check_resource_id" t.string "message_key" @@ -175,8 +165,18 @@ ActiveRecord::Schema.define(version: 20170915100935) do t.datetime "updated_at", null: false end - add_index "compliance_check_results", ["compliance_check_id"], name: "index_compliance_check_results_on_compliance_check_id", using: :btree - add_index "compliance_check_results", ["compliance_check_resource_id"], name: "index_compliance_check_results_on_compliance_check_resource_id", using: :btree + add_index "compliance_check_messages", ["compliance_check_id"], name: "index_compliance_check_messages_on_compliance_check_id", using: :btree + add_index "compliance_check_messages", ["compliance_check_resource_id"], name: "index_compliance_check_messages_on_compliance_check_resource_id", using: :btree + + create_table "compliance_check_resources", id: :bigserial, force: :cascade do |t| + t.string "status" + t.string "name" + t.string "type" + t.string "reference" + t.hstore "metrics" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end create_table "compliance_check_sets", id: :bigserial, force: :cascade do |t| t.integer "referential_id" @@ -394,9 +394,9 @@ ActiveRecord::Schema.define(version: 20170915100935) do t.string "type" t.integer "parent_id", limit: 8 t.string "parent_type" + t.datetime "notified_parent_at" t.integer "current_step", default: 0 t.integer "total_steps", default: 0 - t.datetime "notified_parent_at" t.string "creator" end @@ -966,8 +966,8 @@ ActiveRecord::Schema.define(version: 20170915100935) do add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey" add_foreign_key "api_keys", "organisations" add_foreign_key "compliance_check_blocks", "compliance_check_sets" - add_foreign_key "compliance_check_results", "compliance_check_resources" - add_foreign_key "compliance_check_results", "compliance_checks" + add_foreign_key "compliance_check_messages", "compliance_check_resources" + add_foreign_key "compliance_check_messages", "compliance_checks" add_foreign_key "compliance_check_sets", "compliance_control_sets" add_foreign_key "compliance_check_sets", "referentials" add_foreign_key "compliance_check_sets", "workbenches" diff --git a/lib/tasks/erd.rake b/lib/tasks/erd.rake index a9b1a3454..6b79967de 100644 --- a/lib/tasks/erd.rake +++ b/lib/tasks/erd.rake @@ -3,10 +3,10 @@ namespace :generate do desc "Create model diagrams for Chouette" task :model_diagram => :environment do sh "bundle exec rake erd only='Organisation,Referential,User,Workbench' filename='organisation' title='Organisation'" - sh "bundle exec rake erd only='Calendar,Referential,Chouette::Line,Chouette::Route,Chouette::JourneyPattern,Chouette::VehicleJourney,Chouette::VehicleJourneyAtStop,Chouette::TimeTable,Chouette::TimeTableDate,Chouette::TimeTablePeriod,Chouette::Footnote,Chouette::Network,Chouette::Company,Chouette::StopPoint,Chouette::StopArea' filename='offer_datas' title='Offer Datas'" + sh "bundle exec rake erd only='Calendar,Referential,ReferentialMetadata,Chouette::Line,Chouette::Route,Chouette::JourneyPattern,Chouette::VehicleJourney,Chouette::VehicleJourneyAtStop,Chouette::TimeTable,Chouette::TimeTableDate,Chouette::TimeTablePeriod,Chouette::Footnote,Chouette::Network,Chouette::Company,Chouette::StopPoint,Chouette::StopArea' filename='offer_datas' title='Offer Datas'" sh "bundle exec rake erd only='Organisation,StopAreaReferential,StopAreaReferentialSync,StopAreaReferentialSyncMessage,StopAreaReferentialMembership,LineReferential,LineReferentialSync,LineReferentialSyncMessage,LineReferentialMembership' filename='referentiels_externes' title='Référentiels externes'" sh "bundle exec rake erd only='NetexImport,Import,WorkbenchImport,ImportResource,ImportMessage' filename='import' title='Import'" - #sh "bundle exec rake erd only='' filename='validation' title='Validation'" + sh "bundle exec rake erd only='ComplianceControlSet,ComplianceControlBlock,ComplianceControl,ComplianceCheckSet,ComplianceCheckBlock,ComplianceCheck,ComplianceCheckResource,ComplianceCheckMessage' filename='validation' title='Validation'" #sh "bundle exec rake erd only='VehicleJourney,VehicleJourneyExport' filename='export' title='Export'" #sh "bundle exec rake erd only='' filename='intégration' title='Integration'" #sh "bundle exec rake erd only='' filename='fusion' title='Fusion'" diff --git a/spec/factories/compliance_check_messages.rb b/spec/factories/compliance_check_messages.rb new file mode 100644 index 000000000..1a047a242 --- /dev/null +++ b/spec/factories/compliance_check_messages.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :compliance_check_message do + association :compliance_check + association :compliance_check_resource + message_key "message_key" + end +end diff --git a/spec/factories/compliance_check_results.rb b/spec/factories/compliance_check_results.rb deleted file mode 100644 index a56d77ce4..000000000 --- a/spec/factories/compliance_check_results.rb +++ /dev/null @@ -1,7 +0,0 @@ -FactoryGirl.define do - factory :compliance_check_result do - association :compliance_check - association :compliance_check_resource - message_key "message_key" - end -end diff --git a/spec/models/compliance_check_message_spec.rb b/spec/models/compliance_check_message_spec.rb new file mode 100644 index 000000000..8b424595e --- /dev/null +++ b/spec/models/compliance_check_message_spec.rb @@ -0,0 +1,10 @@ +require 'rails_helper' + +RSpec.describe ComplianceCheckMessage, type: :model do + it 'should have a valid factory' do + expect(FactoryGirl.build(:compliance_check_message)).to be_valid + end + + it { should belong_to :compliance_check } + it { should belong_to :compliance_check_resource } +end diff --git a/spec/models/compliance_check_result_spec.rb b/spec/models/compliance_check_result_spec.rb deleted file mode 100644 index 95586862f..000000000 --- a/spec/models/compliance_check_result_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'rails_helper' - -RSpec.describe ComplianceCheckResult, type: :model do - it 'should have a valid factory' do - expect(FactoryGirl.build(:compliance_check_result)).to be_valid - end - - it { should belong_to :compliance_check } - it { should belong_to :compliance_check_resource } -end -- cgit v1.2.3 From 1defcfa262845b2acd75ceac2d200f11ddf3a54e Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Tue, 19 Sep 2017 09:58:46 +0200 Subject: Fix locales import messages Refs #4541 @1 --- config/locales/import_messages.en.yml | 3 ++- config/locales/import_messages.fr.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/locales/import_messages.en.yml b/config/locales/import_messages.en.yml index 4719add31..e1ef8a078 100644 --- a/config/locales/import_messages.en.yml +++ b/config/locales/import_messages.en.yml @@ -46,5 +46,6 @@ en: 2_netexstif_servicejourney_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} , objet ServiceJourney d'identifiant %{source_objectid} : le passingTime de rang %{error_value} fournit des horaires antérieurs au passingTime précédent." 2_netexstif_servicejourneypattern_1: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} ne référence pas de Route" 2_netexstif_servicejourneypattern_2: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} doit contenir au moins 2 StopPointInJourneyPattern" - 2_netexstif_servicejourneypattern_3: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} n'a pas de valeur pour l'attribut ServiceJourneyPatternType" + 2_netexstif_servicejourneypattern_3_1: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} n'a pas de valeur pour l'attribut ServiceJourneyPatternType" + 2_netexstif_servicejourneypattern_3_2: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} a une valeur interdite %{error_value} pour l'attribut ServiceJourneyPatternType différente de 'passenger'" 2_netexstif_servicejourneypattern_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number}, objet ServiceJourneyPattern d'identifiant %{source_objectid} : les attributs 'order' des StopPointInJourneyPattern ne sont pas croissants." diff --git a/config/locales/import_messages.fr.yml b/config/locales/import_messages.fr.yml index 6addccfe3..8d6a4ee91 100644 --- a/config/locales/import_messages.fr.yml +++ b/config/locales/import_messages.fr.yml @@ -46,5 +46,6 @@ fr: 2_netexstif_servicejourney_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} , objet ServiceJourney d'identifiant %{source_objectid} : le passingTime de rang %{error_value} fournit des horaires antérieurs au passingTime précédent." 2_netexstif_servicejourneypattern_1: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} ne référence pas de Route" 2_netexstif_servicejourneypattern_2: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} doit contenir au moins 2 StopPointInJourneyPattern" - 2_netexstif_servicejourneypattern_3: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} n'a pas de valeur pour l'attribut ServiceJourneyPatternType" + 2_netexstif_servicejourneypattern_3_1: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} n'a pas de valeur pour l'attribut ServiceJourneyPatternType" + 2_netexstif_servicejourneypattern_3_2: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} a une valeur interdite %{error_value} pour l'attribut ServiceJourneyPatternType différente de 'passenger'" 2_netexstif_servicejourneypattern_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number}, objet ServiceJourneyPattern d'identifiant %{source_objectid} : les attributs 'order' des StopPointInJourneyPattern ne sont pas croissants." -- cgit v1.2.3