diff options
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | app/views/lines/show.html.slim | 3 | ||||
| -rw-r--r-- | app/views/referential_lines/show.html.slim | 5 | ||||
| -rw-r--r-- | config/locales/lines.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/lines.fr.yml | 1 | ||||
| -rw-r--r-- | db/migrate/20170428133742_add_seasonal_to_lines.rb | 5 | ||||
| -rw-r--r-- | db/schema.rb | 471 | ||||
| -rw-r--r-- | lib/stif/codif_line_synchronization.rb | 3 |
8 files changed, 244 insertions, 247 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 49ab0c9ac..3acf91cc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -32,7 +32,7 @@ GIT GIT remote: git@github.com:AF83/stif-codifline-api.git - revision: 9afe38cce298165765d98936f6d63f8d3cc33bce + revision: 02108a647514ca36e4377deecf3ffcce99359139 specs: codifligne (0.0.2) nokogiri (~> 1.6) diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index 0100b3c01..dbc019e72 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -34,4 +34,5 @@ 'Code public' => (@line.registration_number ? @line.registration_number : '-'), @line.human_attribute_name(:transport_mode) => (@line.transport_mode ? t("enumerize.line.transport_mode.#{@line.transport_mode}") : '-'), @line.human_attribute_name(:transport_submode) => (@line.transport_submode ? t("enumerize.line.transport_submode.#{@line.transport_submode}") : '-'), - @line.human_attribute_name(:url) => (@line.url ? @line.url : '-') } + @line.human_attribute_name(:url) => (@line.url ? @line.url : '-'), + @line.human_attribute_name(:seasonal) => (@line.seasonal? ? t('true') : t('false')),} diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim index 34f687995..b60342f19 100644 --- a/app/views/referential_lines/show.html.slim +++ b/app/views/referential_lines/show.html.slim @@ -41,7 +41,8 @@ 'Code public' => (@line.registration_number ? @line.registration_number : '-'), @line.human_attribute_name(:transport_mode) => (@line.transport_mode ? t("enumerize.line.transport_mode.#{@line.transport_mode}") : '-'), @line.human_attribute_name(:transport_submode) => (@line.transport_submode ? t("enumerize.line.transport_submode.#{@line.transport_submode}") : '-'), - @line.human_attribute_name(:url) => (@line.url ? @line.url : '-') } + @line.human_attribute_name(:url) => (@line.url ? @line.url : '-'), + @line.human_attribute_name(:seasonal) => (@line.seasonal? ? t('true') : t('false')),} .row .col-lg-12 @@ -51,7 +52,7 @@ = search_form_for @q, url: referential_line_path(@referential, @line), class: 'form form-filter' do |f| .input-group.search_bar = f.search_field :name_cont, class: 'form-control', placeholder: "Indiquez un nom d'itinéraire..." - + span.input-group-btn button.btn.btn-default type='submit' span.fa.fa-search diff --git a/config/locales/lines.en.yml b/config/locales/lines.en.yml index f3e0ee4a2..cfeba10ca 100644 --- a/config/locales/lines.en.yml +++ b/config/locales/lines.en.yml @@ -74,6 +74,7 @@ en: number: "Number" transport_mode: "Transport mode" transport_submode: "Transport Submode" + seasonal: "Seasonal" url: "Web page" color: "Line color" text_color: "Text color" diff --git a/config/locales/lines.fr.yml b/config/locales/lines.fr.yml index 978e516dd..134a669ec 100644 --- a/config/locales/lines.fr.yml +++ b/config/locales/lines.fr.yml @@ -73,6 +73,7 @@ fr: number: "Nom court" transport_mode: "Mode de transport" transport_submode: "Sous mode de transport" + seasonal: "Saisonnière" url: "Page web associée" color: "Couleur du tracé" text_color: "Couleur du texte" diff --git a/db/migrate/20170428133742_add_seasonal_to_lines.rb b/db/migrate/20170428133742_add_seasonal_to_lines.rb new file mode 100644 index 000000000..89f54856c --- /dev/null +++ b/db/migrate/20170428133742_add_seasonal_to_lines.rb @@ -0,0 +1,5 @@ +class AddSeasonalToLines < ActiveRecord::Migration + def change + add_column :lines, :seasonal, :boolean + end +end diff --git a/db/schema.rb b/db/schema.rb index 161f0a839..3214c1e78 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: 20170414080922) do +ActiveRecord::Schema.define(version: 20170428133742) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -21,12 +21,12 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "access_links", id: :bigserial, force: :cascade do |t| t.integer "access_point_id", limit: 8 t.integer "stop_area_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.decimal "link_distance", precision: 19, scale: 2 + t.string "creator_id" + t.string "name" + t.string "comment" + t.decimal "link_distance", precision: 19, scale: 2 t.boolean "lift_availability" t.boolean "mobility_restricted_suitability" t.boolean "stairs_availability" @@ -34,9 +34,9 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.time "frequent_traveller_duration" t.time "occasional_traveller_duration" t.time "mobility_restricted_traveller_duration" - t.string "link_type", limit: 255 + t.string "link_type" t.integer "int_user_needs" - t.string "link_orientation", limit: 255 + t.string "link_orientation" t.datetime "created_at" t.datetime "updated_at" end @@ -44,26 +44,26 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "access_links", ["objectid"], name: "access_links_objectid_key", unique: true, using: :btree create_table "access_points", id: :bigserial, force: :cascade do |t| - t.string "objectid", limit: 255 + t.string "objectid" t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.decimal "longitude", precision: 19, scale: 16 - t.decimal "latitude", precision: 19, scale: 16 - t.string "long_lat_type", limit: 255 - t.string "country_code", limit: 255 - t.string "street_name", limit: 255 - t.string "contained_in", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" + 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" + t.string "contained_in" t.time "openning_time" t.time "closing_time" - t.string "access_type", limit: 255 + t.string "access_type" t.boolean "lift_availability" t.boolean "mobility_restricted_suitability" t.boolean "stairs_availability" t.integer "stop_area_id", limit: 8 - t.string "zip_code", limit: 255 - t.string "city_name", limit: 255 + t.string "zip_code" + t.string "city_name" t.text "import_xml" t.datetime "created_at" t.datetime "updated_at" @@ -73,18 +73,18 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "api_keys", id: :bigserial, force: :cascade do |t| t.integer "referential_id", limit: 8 - t.string "token", limit: 255 - t.string "name", limit: 255 + t.string "token" + t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "calendars", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 - t.string "short_name", limit: 255 - t.daterange "date_ranges", array: true - t.date "dates", array: true - t.boolean "shared", default: false + t.string "name" + t.string "short_name" + t.daterange "date_ranges", array: true + t.date "dates", array: true + t.boolean "shared", default: false t.integer "organisation_id", limit: 8 t.datetime "created_at" t.datetime "updated_at" @@ -94,7 +94,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "calendars", ["short_name"], name: "index_calendars_on_short_name", unique: true, using: :btree create_table "clean_up_results", id: :bigserial, force: :cascade do |t| - t.string "message_key", limit: 255 + t.string "message_key" t.hstore "message_attributs" t.integer "clean_up_id", limit: 8 t.datetime "created_at" @@ -104,7 +104,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "clean_up_results", ["clean_up_id"], name: "index_clean_up_results_on_clean_up_id", using: :btree create_table "clean_ups", id: :bigserial, force: :cascade do |t| - t.string "status", limit: 255 + t.string "status" t.datetime "started_at" t.datetime "ended_at" t.integer "referential_id", limit: 8 @@ -117,20 +117,20 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "clean_ups", ["referential_id"], name: "index_clean_ups_on_referential_id", using: :btree create_table "companies", id: :bigserial, force: :cascade do |t| - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "short_name", limit: 255 - t.string "organizational_unit", limit: 255 - t.string "operating_department_name", limit: 255 - t.string "code", limit: 255 - t.string "phone", limit: 255 - t.string "fax", limit: 255 - t.string "email", limit: 255 - t.string "registration_number", limit: 255 - t.string "url", limit: 255 - t.string "time_zone", limit: 255 + t.string "creator_id" + t.string "name" + t.string "short_name" + t.string "organizational_unit" + t.string "operating_department_name" + t.string "code" + t.string "phone" + t.string "fax" + t.string "email" + t.string "registration_number" + t.string "url" + t.string "time_zone" t.integer "line_referential_id", limit: 8 t.text "import_xml" t.datetime "created_at" @@ -144,13 +144,13 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "connection_links", id: :bigserial, force: :cascade do |t| t.integer "departure_id", limit: 8 t.integer "arrival_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.decimal "link_distance", precision: 19, scale: 2 - t.string "link_type", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" + t.decimal "link_distance", precision: 19, scale: 2 + t.string "link_type" t.time "default_duration" t.time "frequent_traveller_duration" t.time "occasional_traveller_duration" @@ -165,31 +165,15 @@ ActiveRecord::Schema.define(version: 20170414080922) 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", limit: 255 - t.string "type", limit: 255 - t.string "options", limit: 255 + t.string "status" + t.string "type" + t.string "options" t.datetime "created_at" t.datetime "updated_at" - t.string "references_type", limit: 255 - t.string "reference_ids", limit: 255 + t.string "references_type" + t.string "reference_ids" end add_index "exports", ["referential_id"], name: "index_exports_on_referential_id", using: :btree @@ -199,23 +183,23 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.integer "line_id", limit: 8 t.integer "connection_link_id", limit: 8 t.integer "stop_point_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 t.datetime "creation_time" - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.string "description", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" + t.string "description" t.boolean "free_access" - t.decimal "longitude", precision: 19, scale: 16 - t.decimal "latitude", precision: 19, scale: 16 - t.string "long_lat_type", limit: 255 - t.decimal "x", precision: 19, scale: 2 - t.decimal "y", precision: 19, scale: 2 - t.string "projection_type", limit: 255 - t.string "country_code", limit: 255 - t.string "street_name", limit: 255 - t.string "contained_in", limit: 255 + t.decimal "longitude", precision: 19, scale: 16 + t.decimal "latitude", precision: 19, scale: 16 + t.string "long_lat_type" + t.decimal "x", precision: 19, scale: 2 + t.decimal "y", precision: 19, scale: 2 + t.string "projection_type" + t.string "country_code" + t.string "street_name" + t.string "contained_in" end add_index "facilities", ["objectid"], name: "facilities_objectid_key", unique: true, using: :btree @@ -227,8 +211,8 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "footnotes", id: :bigserial, force: :cascade do |t| t.integer "line_id", limit: 8 - t.string "code", limit: 255 - t.string "label", limit: 255 + t.string "code" + t.string "label" t.datetime "created_at" t.datetime "updated_at" end @@ -239,12 +223,12 @@ ActiveRecord::Schema.define(version: 20170414080922) do end create_table "group_of_lines", id: :bigserial, force: :cascade do |t| - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.string "registration_number", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" + t.string "registration_number" t.integer "line_referential_id", limit: 8 t.text "import_xml" t.datetime "created_at" @@ -261,7 +245,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "import_messages", id: :bigserial, force: :cascade do |t| t.integer "criticity" - t.string "message_key", limit: 255 + t.string "message_key" t.hstore "message_attributs" t.integer "import_id", limit: 8 t.integer "resource_id", limit: 8 @@ -275,30 +259,30 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "import_resources", id: :bigserial, force: :cascade do |t| t.integer "import_id", limit: 8 - t.string "status", limit: 255 + t.string "status" t.datetime "created_at" t.datetime "updated_at" - t.string "type", limit: 255 - t.string "reference", limit: 255 - t.string "name", limit: 255 + t.string "type" + t.string "reference" + t.string "name" t.hstore "metrics" end add_index "import_resources", ["import_id"], name: "index_import_resources_on_import_id", using: :btree create_table "imports", id: :bigserial, force: :cascade do |t| - t.string "status", limit: 255 - t.string "current_step_id", limit: 255 + t.string "status" + t.string "current_step_id" t.float "current_step_progress" t.integer "workbench_id", limit: 8 t.integer "referential_id", limit: 8 - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.string "file", limit: 255 + t.string "file" t.datetime "started_at" t.datetime "ended_at" - t.string "token_download", limit: 255 + t.string "token_download" t.string "type", limit: 255 end @@ -333,16 +317,16 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "journey_patterns", id: :bigserial, force: :cascade do |t| t.integer "route_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.string "registration_number", limit: 255 - t.string "published_name", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" + t.string "registration_number" + t.string "published_name" t.integer "departure_stop_point_id", limit: 8 t.integer "arrival_stop_point_id", limit: 8 - t.integer "section_status", default: 0, null: false + t.integer "section_status", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" end @@ -364,7 +348,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "line_referential_sync_messages", id: :bigserial, force: :cascade do |t| t.integer "criticity" - t.string "message_key", limit: 255 + t.string "message_key" t.hstore "message_attributs" t.integer "line_referential_sync_id", limit: 8 t.datetime "created_at" @@ -379,44 +363,45 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.datetime "updated_at" t.datetime "started_at" t.datetime "ended_at" - t.string "status", limit: 255 + t.string "status" end add_index "line_referential_syncs", ["line_referential_id"], name: "index_line_referential_syncs_on_line_referential_id", using: :btree create_table "line_referentials", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.integer "sync_interval", default: 1 + t.integer "sync_interval", default: 1 end create_table "lines", id: :bigserial, force: :cascade do |t| t.integer "network_id", limit: 8 t.integer "company_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "number", limit: 255 - t.string "published_name", limit: 255 - t.string "transport_mode", limit: 255 - t.string "registration_number", limit: 255 - t.string "comment", limit: 255 + t.string "creator_id" + t.string "name" + t.string "number" + t.string "published_name" + t.string "transport_mode" + t.string "registration_number" + t.string "comment" t.boolean "mobility_restricted_suitability" t.integer "int_user_needs" t.boolean "flexible_service" - t.string "url", limit: 255 + t.string "url" t.string "color", limit: 6 t.string "text_color", limit: 6 - t.string "stable_id", limit: 255 + t.string "stable_id" t.integer "line_referential_id", limit: 8 - t.boolean "deactivated", default: false + t.boolean "deactivated", default: false t.text "import_xml" - t.string "transport_submode", limit: 255 - t.integer "secondary_company_ids", limit: 8, array: true + t.string "transport_submode" + t.integer "secondary_company_ids", limit: 8, array: true t.datetime "created_at" t.datetime "updated_at" + t.boolean "seasonal" end add_index "lines", ["line_referential_id"], name: "index_lines_on_line_referential_id", using: :btree @@ -425,17 +410,17 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "lines", ["secondary_company_ids"], name: "index_lines_on_secondary_company_ids", using: :gin create_table "networks", id: :bigserial, force: :cascade do |t| - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 + t.string "creator_id" t.date "version_date" - t.string "description", limit: 255 - t.string "name", limit: 255 - t.string "registration_number", limit: 255 - t.string "source_name", limit: 255 - t.string "source_type", limit: 255 - t.string "source_identifier", limit: 255 - t.string "comment", limit: 255 + t.string "description" + t.string "name" + t.string "registration_number" + t.string "source_name" + t.string "source_type" + t.string "source_identifier" + t.string "comment" t.text "import_xml" t.integer "line_referential_id", limit: 8 t.datetime "created_at" @@ -447,11 +432,11 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "networks", ["registration_number"], name: "networks_registration_number_key", using: :btree create_table "organisations", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.string "data_format", limit: 255, default: "neptune" - t.string "code", limit: 255 + t.string "data_format", default: "neptune" + t.string "code" t.datetime "synced_at" t.hstore "sso_attributes" end @@ -462,12 +447,12 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.integer "start_of_link_id", limit: 8 t.integer "end_of_link_id", limit: 8 t.integer "route_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.decimal "link_distance", precision: 19, scale: 2 + t.string "creator_id" + t.string "name" + t.string "comment" + t.decimal "link_distance", precision: 19, scale: 2 t.datetime "created_at" t.datetime "updated_at" end @@ -475,7 +460,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "pt_links", ["objectid"], name: "pt_links_objectid_key", unique: true, using: :btree create_table "referential_clonings", id: :bigserial, force: :cascade do |t| - t.string "status", limit: 255 + t.string "status" t.datetime "started_at" t.datetime "ended_at" t.integer "source_referential_id", limit: 8 @@ -496,30 +481,30 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.daterange "periodes", array: true end - add_index "referential_metadata", ["line_ids"], name: "index_referential_metadata_on_line_ids", using: :btree + add_index "referential_metadata", ["line_ids"], name: "index_referential_metadata_on_line_ids", using: :gin add_index "referential_metadata", ["referential_id"], name: "index_referential_metadata_on_referential_id", using: :btree add_index "referential_metadata", ["referential_source_id"], name: "index_referential_metadata_on_referential_source_id", using: :btree create_table "referentials", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 - t.string "slug", limit: 255 + t.string "name" + t.string "slug" t.datetime "created_at" t.datetime "updated_at" - t.string "prefix", limit: 255 - t.string "projection_type", limit: 255 - t.string "time_zone", limit: 255 - t.string "bounds", limit: 255 + t.string "prefix" + t.string "projection_type" + t.string "time_zone" + t.string "bounds" t.integer "organisation_id", limit: 8 t.text "geographical_bounds" t.integer "user_id", limit: 8 - t.string "user_name", limit: 255 - t.string "data_format", limit: 255 + t.string "user_name" + t.string "data_format" t.integer "line_referential_id", limit: 8 t.integer "stop_area_referential_id", limit: 8 t.integer "workbench_id", limit: 8 t.datetime "archived_at" t.integer "created_from_id", limit: 8 - t.boolean "ready", default: false + t.boolean "ready", default: false end add_index "referentials", ["created_from_id"], name: "index_referentials_on_created_from_id", using: :btree @@ -527,29 +512,29 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "route_sections", id: :bigserial, force: :cascade do |t| t.integer "departure_id", limit: 8 t.integer "arrival_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.geometry "input_geometry", limit: {:srid=>4326, :type=>"line_string"} + t.geometry "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 + t.string "creator_id" t.float "distance" t.boolean "no_processing" - t.geometry "input_geometry", limit: {:srid=>4326, :type=>"line_string"} - t.geometry "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} t.datetime "created_at" t.datetime "updated_at" end create_table "routes", id: :bigserial, force: :cascade do |t| t.integer "line_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" t.integer "opposite_route_id", limit: 8 - t.string "published_name", limit: 255 - t.string "number", limit: 255 - t.string "direction", limit: 255 - t.string "wayback", limit: 255 + t.string "published_name" + t.string "number" + t.string "direction" + t.string "wayback" t.datetime "created_at" t.datetime "updated_at" end @@ -557,14 +542,14 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "routes", ["objectid"], name: "routes_objectid_key", unique: true, using: :btree create_table "routing_constraint_zones", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 + t.string "creator_id" t.integer "route_id", limit: 8 - t.integer "stop_point_ids", limit: 8, array: true + t.integer "stop_point_ids", limit: 8, array: true end create_table "routing_constraints_lines", id: false, force: :cascade do |t| @@ -574,7 +559,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "rule_parameter_sets", id: :bigserial, force: :cascade do |t| t.text "parameters" - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" t.integer "organisation_id", limit: 8 @@ -588,7 +573,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "stop_area_referential_sync_messages", id: :bigserial, force: :cascade do |t| t.integer "criticity" - t.string "message_key", limit: 255 + t.string "message_key" t.hstore "message_attributs" t.integer "stop_area_referential_sync_id", limit: 8 t.datetime "created_at" @@ -603,43 +588,43 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.datetime "updated_at" t.datetime "ended_at" t.datetime "started_at" - t.string "status", limit: 255 + t.string "status" end add_index "stop_area_referential_syncs", ["stop_area_referential_id"], name: "index_stop_area_referential_syncs_on_stop_area_referential_id", using: :btree create_table "stop_area_referentials", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "stop_areas", id: :bigserial, force: :cascade do |t| t.integer "parent_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.string "comment", limit: 255 - t.string "area_type", limit: 255 - t.string "registration_number", limit: 255 - t.string "nearest_topic_name", limit: 255 + t.string "creator_id" + t.string "name" + t.string "comment" + t.string "area_type" + 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.string "long_lat_type", limit: 255 - t.string "country_code", limit: 255 - t.string "street_name", limit: 255 + t.string "long_lat_type" + t.string "country_code" + t.string "street_name" t.boolean "mobility_restricted_suitability" t.boolean "stairs_availability" t.boolean "lift_availability" t.integer "int_user_needs" - t.string "zip_code", limit: 255 - t.string "city_name", limit: 255 - t.string "url", limit: 255 - t.string "time_zone", limit: 255 + t.string "zip_code" + t.string "city_name" + t.string "url" + t.string "time_zone" t.integer "stop_area_referential_id", limit: 8 - t.string "status", limit: 255 + t.string "status" t.text "import_xml" t.datetime "deleted_at" t.datetime "created_at" @@ -660,12 +645,12 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "stop_points", id: :bigserial, force: :cascade do |t| t.integer "route_id", limit: 8 t.integer "stop_area_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 + t.string "creator_id" t.integer "position" - t.string "for_boarding", limit: 255 - t.string "for_alighting", limit: 255 + t.string "for_boarding" + t.string "for_alighting" t.datetime "created_at" t.datetime "updated_at" end @@ -675,9 +660,9 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "taggings", id: :bigserial, force: :cascade do |t| t.integer "tag_id", limit: 8 t.integer "taggable_id", limit: 8 - t.string "taggable_type", limit: 255 + t.string "taggable_type" t.integer "tagger_id", limit: 8 - t.string "tagger_type", limit: 255 + t.string "tagger_type" t.string "context", limit: 128 t.datetime "created_at" end @@ -686,8 +671,8 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree create_table "tags", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 - t.integer "taggings_count", default: 0 + t.string "name" + t.integer "taggings_count", default: 0 end add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree @@ -711,11 +696,11 @@ ActiveRecord::Schema.define(version: 20170414080922) 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", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8, default: 1 - t.string "creator_id", limit: 255 - t.string "version", limit: 255 - t.string "comment", limit: 255 + t.string "creator_id" + t.string "version" + t.string "comment" t.integer "int_day_types", default: 0 t.date "start_date" t.date "end_date" @@ -737,49 +722,49 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "time_tables_vehicle_journeys", ["vehicle_journey_id"], name: "index_time_tables_vehicle_journeys_on_vehicle_journey_id", using: :btree create_table "timebands", id: :bigserial, force: :cascade do |t| - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "name", limit: 255 - t.time "start_time", null: false - t.time "end_time", null: false + t.string "creator_id" + t.string "name" + t.time "start_time", null: false + t.time "end_time", null: false t.datetime "created_at" t.datetime "updated_at" end create_table "users", id: :bigserial, force: :cascade do |t| - t.string "email", limit: 255, default: "", null: false - t.string "encrypted_password", limit: 255, default: "" - t.string "reset_password_token", limit: 255 + t.string "email", default: "", null: false + t.string "encrypted_password", default: "" + t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0 + t.integer "sign_in_count", default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" - t.string "current_sign_in_ip", limit: 255 - t.string "last_sign_in_ip", limit: 255 + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" t.integer "organisation_id", limit: 8 - t.string "name", limit: 255 - t.string "confirmation_token", limit: 255 + t.string "name" + t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" - t.string "unconfirmed_email", limit: 255 - t.integer "failed_attempts", default: 0 - t.string "unlock_token", limit: 255 + t.string "unconfirmed_email" + t.integer "failed_attempts", default: 0 + t.string "unlock_token" t.datetime "locked_at" - t.string "authentication_token", limit: 255 - t.string "invitation_token", limit: 255 + t.string "authentication_token" + t.string "invitation_token" t.datetime "invitation_sent_at" t.datetime "invitation_accepted_at" t.integer "invitation_limit" t.integer "invited_by_id", limit: 8 - t.string "invited_by_type", limit: 255 + t.string "invited_by_type" t.datetime "invitation_created_at" - t.string "username", limit: 255 + t.string "username" t.datetime "synced_at" - t.string "permissions", limit: 255, array: true + t.string "permissions", array: true end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree @@ -790,12 +775,12 @@ ActiveRecord::Schema.define(version: 20170414080922) do create_table "vehicle_journey_at_stops", id: :bigserial, force: :cascade do |t| t.integer "vehicle_journey_id", limit: 8 t.integer "stop_point_id", limit: 8 - t.string "connecting_service_id", limit: 255 - t.string "boarding_alighting_possibility", limit: 255 + t.string "connecting_service_id" + t.string "boarding_alighting_possibility" t.time "arrival_time" t.time "departure_time" - t.string "for_boarding", limit: 255 - t.string "for_alighting", limit: 255 + t.string "for_boarding" + t.string "for_alighting" t.integer "departure_day_offset" t.integer "arrival_day_offset" end @@ -807,20 +792,20 @@ ActiveRecord::Schema.define(version: 20170414080922) do t.integer "route_id", limit: 8 t.integer "journey_pattern_id", limit: 8 t.integer "company_id", limit: 8 - t.string "objectid", limit: 255, null: false + t.string "objectid", null: false t.integer "object_version", limit: 8 - t.string "creator_id", limit: 255 - t.string "comment", limit: 255 - t.string "status_value", limit: 255 - t.string "transport_mode", limit: 255 - t.string "published_journey_name", limit: 255 - t.string "published_journey_identifier", limit: 255 - t.string "facility", limit: 255 - t.string "vehicle_type_identifier", limit: 255 + t.string "creator_id" + t.string "comment" + t.string "status_value" + t.string "transport_mode" + t.string "published_journey_name" + t.string "published_journey_identifier" + t.string "facility" + t.string "vehicle_type_identifier" t.integer "number", limit: 8 t.boolean "mobility_restricted_suitability" t.boolean "flexible_service" - t.integer "journey_category", default: 0, null: false + t.integer "journey_category", default: 0, null: false t.datetime "created_at" t.datetime "updated_at" end @@ -829,7 +814,7 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "vehicle_journeys", ["route_id"], name: "index_vehicle_journeys_on_route_id", using: :btree create_table "workbenches", id: :bigserial, force: :cascade do |t| - t.string "name", limit: 255 + t.string "name" t.integer "organisation_id", limit: 8 t.datetime "created_at" t.datetime "updated_at" @@ -841,18 +826,20 @@ ActiveRecord::Schema.define(version: 20170414080922) do add_index "workbenches", ["organisation_id"], name: "index_workbenches_on_organisation_id", using: :btree add_index "workbenches", ["stop_area_referential_id"], name: "index_workbenches_on_stop_area_referential_id", using: :btree - add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey", on_delete: :cascade + add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey" 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", "vehicle_journeys", name: "journey_frequencies_vehicle_journey_id_fk", 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", "route_sections", name: "journey_pattern_sections_route_section_id_fk", on_delete: :cascade + add_foreign_key "journey_frequencies", "timebands", on_delete: :nullify + add_foreign_key "journey_frequencies", "vehicle_journeys", on_delete: :nullify + add_foreign_key "journey_pattern_sections", "journey_patterns", 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 add_foreign_key "journey_patterns", "stop_points", column: "departure_stop_point_id", name: "departure_point_fkey", on_delete: :nullify add_foreign_key "journey_patterns_stop_points", "journey_patterns", name: "jpsp_jp_fkey", on_delete: :cascade add_foreign_key "journey_patterns_stop_points", "stop_points", name: "jpsp_stoppoint_fkey", on_delete: :cascade - add_foreign_key "routes", "routes", column: "opposite_route_id", name: "route_opposite_route_fkey", on_delete: :nullify + add_foreign_key "route_sections", "stop_areas", column: "arrival_id" + add_foreign_key "route_sections", "stop_areas", column: "departure_id" + add_foreign_key "routes", "routes", column: "opposite_route_id", name: "route_opposite_route_fkey" add_foreign_key "stop_areas", "stop_areas", column: "parent_id", name: "area_parent_fkey", on_delete: :nullify add_foreign_key "stop_areas_stop_areas", "stop_areas", column: "child_id", name: "stoparea_child_fkey", on_delete: :cascade add_foreign_key "stop_areas_stop_areas", "stop_areas", column: "parent_id", name: "stoparea_parent_fkey", on_delete: :cascade diff --git a/lib/stif/codif_line_synchronization.rb b/lib/stif/codif_line_synchronization.rb index 1f52fc558..feb313f45 100644 --- a/lib/stif/codif_line_synchronization.rb +++ b/lib/stif/codif_line_synchronization.rb @@ -87,7 +87,8 @@ module Stif objectid: api_line.stif_id, number: api_line.short_name, deactivated: (api_line.status == "inactive" ? true : false), - import_xml: api_line.xml + import_xml: api_line.xml, + seasonal: api_line.seasonal } params[:transport_mode] = api_line.transport_mode.to_s params[:transport_submode] = api_line.transport_submode.to_s |
