diff options
| author | Vlatka Pavisic | 2017-02-13 17:39:30 +0100 | 
|---|---|---|
| committer | Xinhui | 2017-02-20 11:52:06 +0100 | 
| commit | 86cd6fb168b94debc3fc0eb99ac61f1a9b9b0049 (patch) | |
| tree | 8b94bf10593393b9ad6bf73fb13b623abb615778 | |
| parent | 84e433dbdbd457c922725ea54cd703ed28da7ab6 (diff) | |
| download | chouette-core-86cd6fb168b94debc3fc0eb99ac61f1a9b9b0049.tar.bz2 | |
Refs #2596 : Replace creation_time with timestamps
63 files changed, 176 insertions, 141 deletions
| diff --git a/app/controllers/access_links_controller.rb b/app/controllers/access_links_controller.rb index d590aba00..d783c3212 100644 --- a/app/controllers/access_links_controller.rb +++ b/app/controllers/access_links_controller.rb @@ -90,7 +90,7 @@ class AccessLinksController < ChouetteController    private    def access_link_params -    params.require(:access_link).permit(:access_link_type,:access_point_id, :stop_area_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation, :link_orientation_type, :stop_area ) +    params.require(:access_link).permit(:access_link_type,:access_point_id, :stop_area_id, :objectid, :object_version, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation, :link_orientation_type, :stop_area )    end  end diff --git a/app/controllers/access_points_controller.rb b/app/controllers/access_points_controller.rb index 534b0c835..771f013e7 100644 --- a/app/controllers/access_points_controller.rb +++ b/app/controllers/access_points_controller.rb @@ -66,7 +66,7 @@ class AccessPointsController < ChouetteController    private    def access_point_params -    params.require(:access_point).permit( :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :stop_area_id, :coordinates ) +    params.require(:access_point).permit( :objectid, :object_version, :creator_id, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :stop_area_id, :coordinates )    end  end diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb index bf298786a..3ce59146c 100644 --- a/app/controllers/companies_controller.rb +++ b/app/controllers/companies_controller.rb @@ -61,7 +61,7 @@ class CompaniesController < BreadcrumbController    helper_method :current_referential    def company_params -    params.require(:company).permit( :objectid, :object_version, :creation_time, :creator_id, :name, :short_name, :organizational_unit, :operating_department_name, :code, :phone, :fax, :email, :registration_number, :url, :time_zone ) +    params.require(:company).permit( :objectid, :object_version, :creator_id, :name, :short_name, :organizational_unit, :operating_department_name, :code, :phone, :fax, :email, :registration_number, :url, :time_zone )    end    private diff --git a/app/controllers/connection_links_controller.rb b/app/controllers/connection_links_controller.rb index ca36a999f..4a01f1963 100644 --- a/app/controllers/connection_links_controller.rb +++ b/app/controllers/connection_links_controller.rb @@ -55,7 +55,7 @@ class ConnectionLinksController < ChouetteController    private    def connection_link_params -    params.require(:connection_link).permit( :connection_link_type,:departure_id, :arrival_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs ) +    params.require(:connection_link).permit( :connection_link_type,:departure_id, :arrival_id, :objectid, :object_version, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs )    end  end diff --git a/app/controllers/group_of_lines_controller.rb b/app/controllers/group_of_lines_controller.rb index 112ff2dd0..26ab1ae5d 100644 --- a/app/controllers/group_of_lines_controller.rb +++ b/app/controllers/group_of_lines_controller.rb @@ -80,7 +80,7 @@ class GroupOfLinesController < BreadcrumbController    end    def group_of_line_params -    params.require(:group_of_line).permit( :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :lines, :registration_number, :line_tokens) +    params.require(:group_of_line).permit( :objectid, :object_version, :creator_id, :name, :comment, :lines, :registration_number, :line_tokens)    end  end diff --git a/app/controllers/journey_patterns_controller.rb b/app/controllers/journey_patterns_controller.rb index 69f16321e..dd457332c 100644 --- a/app/controllers/journey_patterns_controller.rb +++ b/app/controllers/journey_patterns_controller.rb @@ -60,7 +60,7 @@ class JourneyPatternsController < ChouetteController    end    def journey_pattern_params -    params.require(:journey_pattern).permit(:route_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :registration_number, :published_name, :departure_stop_point_id, :arrival_stop_point_id, {:stop_point_ids => []}) +    params.require(:journey_pattern).permit(:route_id, :objectid, :object_version, :creator_id, :name, :comment, :registration_number, :published_name, :departure_stop_point_id, :arrival_stop_point_id, {:stop_point_ids => []})    end  end diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 9a0a007aa..4c36ecb21 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -106,7 +106,7 @@ class LinesController < BreadcrumbController    helper_method :current_referential    def line_params -    params.require(:line).permit( :transport_mode, :network_id, :company_id, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :transport_mode, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs, :flexible_service, :group_of_lines, :group_of_line_ids, :group_of_line_tokens, :url, :color, :text_color, :stable_id, { footnotes_attributes: [ :code, :label, :_destroy, :id ] } ) +    params.require(:line).permit( :transport_mode, :network_id, :company_id, :objectid, :object_version, :creator_id, :name, :number, :published_name, :transport_mode, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs, :flexible_service, :group_of_lines, :group_of_line_ids, :group_of_line_tokens, :url, :color, :text_color, :stable_id, { footnotes_attributes: [ :code, :label, :_destroy, :id ] } )    end  end diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index d9070e7e8..4249bb301 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -66,7 +66,7 @@ class NetworksController < BreadcrumbController    helper_method :current_referential    def network_params -    params.require(:network).permit(:objectid, :object_version, :creation_time, :creator_id, :version_date, :description, :name, :registration_number, :source_name, :source_type_name, :source_identifier, :comment ) +    params.require(:network).permit(:objectid, :object_version, :creator_id, :version_date, :description, :name, :registration_number, :source_name, :source_type_name, :source_identifier, :comment )    end    private diff --git a/app/controllers/referential_companies_controller.rb b/app/controllers/referential_companies_controller.rb index 882796951..0966389b4 100644 --- a/app/controllers/referential_companies_controller.rb +++ b/app/controllers/referential_companies_controller.rb @@ -45,7 +45,7 @@ class ReferentialCompaniesController < ChouetteController    end    def company_params -    params.require(:company).permit( :objectid, :object_version, :creation_time, :creator_id, :name, :short_name, :organizational_unit, :operating_department_name, :code, :phone, :fax, :email, :registration_number, :url, :time_zone ) +    params.require(:company).permit( :objectid, :object_version, :creator_id, :name, :short_name, :organizational_unit, :operating_department_name, :code, :phone, :fax, :email, :registration_number, :url, :time_zone )    end    private diff --git a/app/controllers/referential_group_of_lines_controller.rb b/app/controllers/referential_group_of_lines_controller.rb index 4decef558..73520d00a 100644 --- a/app/controllers/referential_group_of_lines_controller.rb +++ b/app/controllers/referential_group_of_lines_controller.rb @@ -71,7 +71,7 @@ class ReferentialGroupOfLinesController < ChouetteController    private    def group_of_line_params -    params.require(:group_of_line).permit( :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :lines, :registration_number, :line_tokens) +    params.require(:group_of_line).permit( :objectid, :object_version, :creator_id, :name, :comment, :lines, :registration_number, :line_tokens)    end  end diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index 4ffee27cb..81c00a0ae 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -107,7 +107,6 @@ class ReferentialLinesController < ChouetteController        :company_id,        :objectid,        :object_version, -      :creation_time,        :creator_id,        :name, :number,        :published_name, diff --git a/app/controllers/referential_networks_controller.rb b/app/controllers/referential_networks_controller.rb index 711b0cc69..30c7dd244 100644 --- a/app/controllers/referential_networks_controller.rb +++ b/app/controllers/referential_networks_controller.rb @@ -53,7 +53,7 @@ class ReferentialNetworksController < ChouetteController    end    def network_params -    params.require(:network).permit(:objectid, :object_version, :creation_time, :creator_id, :version_date, :description, :name, :registration_number, :source_name, :source_type_name, :source_identifier, :comment ) +    params.require(:network).permit(:objectid, :object_version, :creator_id, :version_date, :description, :name, :registration_number, :source_name, :source_type_name, :source_identifier, :comment )    end    private diff --git a/app/controllers/referential_stop_areas_controller.rb b/app/controllers/referential_stop_areas_controller.rb index 8f0d6fea3..4d33ebb2e 100644 --- a/app/controllers/referential_stop_areas_controller.rb +++ b/app/controllers/referential_stop_areas_controller.rb @@ -152,7 +152,7 @@ class ReferentialStopAreasController  < ChouetteController    end    def stop_area_params -    params.require(:stop_area).permit( :routing_stop_ids, :routing_line_ids, :children_ids, :stop_area_type, :parent_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :coordinates, :url, :time_zone ) +    params.require(:stop_area).permit( :routing_stop_ids, :routing_line_ids, :children_ids, :stop_area_type, :parent_id, :objectid, :object_version, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :coordinates, :url, :time_zone )    end  end diff --git a/app/controllers/routes_controller.rb b/app/controllers/routes_controller.rb index be6329006..72a1c1778 100644 --- a/app/controllers/routes_controller.rb +++ b/app/controllers/routes_controller.rb @@ -93,7 +93,7 @@ class RoutesController < ChouetteController    private    def route_params -    params.require(:route).permit( :line_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :opposite_route_id, :published_name, :number, :direction, :wayback, { stop_points_attributes: [ :id, :_destroy, :position, :stop_area_id, :for_boarding, :for_alighting ] } ) +    params.require(:route).permit( :line_id, :objectid, :object_version, :creator_id, :name, :comment, :opposite_route_id, :published_name, :number, :direction, :wayback, { stop_points_attributes: [ :id, :_destroy, :position, :stop_area_id, :for_boarding, :for_alighting ] } )    end  end diff --git a/app/controllers/routing_constraint_zones_controller.rb b/app/controllers/routing_constraint_zones_controller.rb index cd8cd5aa7..054456a52 100644 --- a/app/controllers/routing_constraint_zones_controller.rb +++ b/app/controllers/routing_constraint_zones_controller.rb @@ -16,7 +16,7 @@ class RoutingConstraintZonesController < ChouetteController    private    def routing_constraint_zone_params -    params.require(:routing_constraint_zone).permit(:name, { stop_area_ids: [] }, :line_id, :objectid, :object_version, :creation_time, :creator_id) +    params.require(:routing_constraint_zone).permit(:name, { stop_area_ids: [] }, :line_id, :objectid, :object_version, :creator_id)    end  end diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index fca33bdfb..ae3edbd3e 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -174,7 +174,7 @@ class StopAreasController < BreadcrumbController    helper_method :current_referential    def stop_area_params -    params.require(:stop_area).permit( :routing_stop_ids, :routing_line_ids, :children_ids, :stop_area_type, :parent_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :coordinates, :url, :time_zone ) +    params.require(:stop_area).permit( :routing_stop_ids, :routing_line_ids, :children_ids, :stop_area_type, :parent_id, :objectid, :object_version, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :zip_code, :city_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :coordinates, :url, :time_zone )    end  end diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index ec62dfb98..fa74fe9ee 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -121,6 +121,6 @@ class TimeTablesController < ChouetteController    private    def time_table_params -    params.require(:time_table).permit( :objectid, :object_version, :creation_time, :creator_id, :calendar_id, :version, :comment, :int_day_types, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday, :start_date, :end_date, { :dates_attributes => [:date, :in_out, :id, :_destroy] }, { :periods_attributes => [:period_start, :period_end, :_destroy, :id] }, :tag_list, :tag_search ) +    params.require(:time_table).permit( :objectid, :object_version, :creator_id, :calendar_id, :version, :comment, :int_day_types, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday, :start_date, :end_date, { :dates_attributes => [:date, :in_out, :id, :_destroy] }, { :periods_attributes => [:period_start, :period_end, :_destroy, :id] }, :tag_list, :tag_search )    end  end diff --git a/app/helpers/history_helper.rb b/app/helpers/history_helper.rb index 3ad38a11e..56c651c1d 100644 --- a/app/helpers/history_helper.rb +++ b/app/helpers/history_helper.rb @@ -4,9 +4,7 @@ module HistoryHelper      field_set_tag t("layouts.history_tag.title"), :class => "history_tag" do        content_tag :ul do          [(content_tag :li do -          if object.has_attribute?(:creation_time) -            object.human_attribute_name('creation_time') + ' : ' + l(object.creation_time, :format => :short) -          else +          if object.has_attribute?(:created_at)              object.class.human_attribute_name('created_at') + ' : ' + l(object.created_at, :format => :short)            end          end), diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb index 9b48cde17..cada56384 100644 --- a/app/models/chouette/stop_area.rb +++ b/app/models/chouette/stop_area.rb @@ -58,7 +58,6 @@ class Chouette::StopArea < Chouette::ActiveRecord    before_validation :prepare_auto_columns    def prepare_auto_columns      self.object_version = 1 -    self.creation_time = Time.now      self.creator_id = 'chouette'    end diff --git a/app/models/concerns/default_attributes_support.rb b/app/models/concerns/default_attributes_support.rb index ba5611fe3..ecad26856 100644 --- a/app/models/concerns/default_attributes_support.rb +++ b/app/models/concerns/default_attributes_support.rb @@ -47,7 +47,6 @@ module DefaultAttributesSupport      else        self.object_version += 1      end -    self.creation_time = Time.now      self.creator_id = 'chouette'    end @@ -102,12 +101,4 @@ module DefaultAttributesSupport      self.object_version ||= 1    end -  def timestamp_attributes_for_update #:nodoc: -    [:creation_time] -  end - -  def timestamp_attributes_for_create #:nodoc: -    [:creation_time] -  end -  end diff --git a/app/models/concerns/default_netex_attributes_support.rb b/app/models/concerns/default_netex_attributes_support.rb index 89007f2a2..4cf77ea65 100644 --- a/app/models/concerns/default_netex_attributes_support.rb +++ b/app/models/concerns/default_netex_attributes_support.rb @@ -32,7 +32,6 @@ module DefaultNetexAttributesSupport      else        self.object_version += 1      end -    self.creation_time = Time.now      self.creator_id = 'chouette'    end @@ -70,12 +69,4 @@ module DefaultNetexAttributesSupport      self.object_version ||= 1    end -  def timestamp_attributes_for_update #:nodoc: -    [:creation_time] -  end - -  def timestamp_attributes_for_create #:nodoc: -    [:creation_time] -  end -  end diff --git a/app/views/api/kml/access_links/index.kml.slim b/app/views/api/kml/access_links/index.kml.slim index f402a7aa4..1bcfdacf1 100644 --- a/app/views/api/kml/access_links/index.kml.slim +++ b/app/views/api/kml/access_links/index.kml.slim @@ -1,14 +1,14 @@  doctype XML -kml xmlns="http://www.opengis.net/kml/2.2"  +kml xmlns="http://www.opengis.net/kml/2.2"    document      name = h(Chouette::AccessLink.model_name.human) -     +      - @access_links.each do |access_link|        placemark id="#{access_link.objectid}"          name = h(access_link.name)          extendeddata -          - [ :access_link_type, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation].each do |prop| +          - [ :access_link_type, :objectid, :object_version, :created_at, :updated_at, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs, :link_orientation].each do |prop|              data name="#{prop.to_s}"                value = h(access_link.send( prop)) @@ -18,4 +18,4 @@ kml xmlns="http://www.opengis.net/kml/2.2"            data name="stop_area_objectid"              value = h(access_link.stop_area.objectid) -        = access_link.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file +        = access_link.geometry_presenter.geometry.kml_representation.html_safe diff --git a/app/views/api/kml/access_points/index.kml.slim b/app/views/api/kml/access_points/index.kml.slim index 4f47272e6..1a162f7ed 100644 --- a/app/views/api/kml/access_points/index.kml.slim +++ b/app/views/api/kml/access_points/index.kml.slim @@ -1,19 +1,19 @@  doctype XML -kml xmlns="http://www.opengis.net/kml/2.2"  +kml xmlns="http://www.opengis.net/kml/2.2"    document      name = h(Chouette::AccessPoint.model_name.human)      name access -     +      - @access_points.each do |access_point|        placemark id="#{access_point.objectid}"          name = h(access_point.name)          extendeddata -          - [ :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability].each do |prop| +          - [ :objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :openning_time, :closing_time, :access_type, :access_point_type, :mobility_restricted_suitability, :stairs_availability, :lift_availability].each do |prop|              data name="#{prop.to_s}"                value = h(access_point.send( prop))            data name="stop_area_objectid"              value = h(access_point.stop_area.objectid) -   -        = access_point.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file + +        = access_point.geometry_presenter.geometry.kml_representation.html_safe diff --git a/app/views/api/kml/connection_links/index.kml.slim b/app/views/api/kml/connection_links/index.kml.slim index b5a6e9560..7305fbc78 100644 --- a/app/views/api/kml/connection_links/index.kml.slim +++ b/app/views/api/kml/connection_links/index.kml.slim @@ -1,6 +1,6 @@  doctype XML -kml xmlns="http://www.opengis.net/kml/2.2"  +kml xmlns="http://www.opengis.net/kml/2.2"    document      name = h(Chouette::ConnectionLink.model_name.human) @@ -8,7 +8,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"        placemark id="#{connection_link.objectid}"          name = h(connection_link.name)          extendeddata -          - [ :connection_link_type, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| +          - [ :connection_link_type, :objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :link_distance, :link_type, :default_duration, :frequent_traveller_duration, :occasional_traveller_duration, :mobility_restricted_traveller_duration, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|              data name="#{prop.to_s}"                value = h(connection_link.send( prop)) @@ -18,4 +18,4 @@ kml xmlns="http://www.opengis.net/kml/2.2"            data name="arrival_objectid"              value = h(connection_link.arrival.objectid) -        = connection_link.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file +        = connection_link.geometry_presenter.geometry.kml_representation.html_safe diff --git a/app/views/api/kml/journey_patterns/show.kml.slim b/app/views/api/kml/journey_patterns/show.kml.slim index f7e6dc9f4..15fb96daa 100644 --- a/app/views/api/kml/journey_patterns/show.kml.slim +++ b/app/views/api/kml/journey_patterns/show.kml.slim @@ -1,10 +1,10 @@  doctype XML -kml xmlns="http://www.opengis.net/kml/2.2"  +kml xmlns="http://www.opengis.net/kml/2.2"    document      name = "#{h(Chouette::JourneyPattern.model_name.human)} : #{h(@journey_pattern.name)}"      extendeddata -      - [:objectid, :object_version, :creation_time, :creator_id, :name, :comment, :registration_number, :published_name].each do |prop| +      - [:objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :registration_number, :published_name].each do |prop|          data name="#{prop.to_s}"            value = h(@journey_pattern.send( prop)) @@ -17,15 +17,15 @@ kml xmlns="http://www.opengis.net/kml/2.2"          placemark id="#{stop_area.objectid}"            name = h(stop_area.name)            extendeddata -            - [ :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| +            - [ :objectid, :object_version, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|                data name="#{prop.to_s}"                  value = h(stop_area.send( prop)) -               +              - if stop_area.parent                data name="parent_objectid"                  value = h(stop_area.parent.objectid) -             +              data name="stop"                value = @journey_pattern.stop_points.include?( stop_point) ? "true" : "false" -          = stop_area.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file +          = stop_area.geometry_presenter.geometry.kml_representation.html_safe diff --git a/app/views/api/kml/lines/show.kml.slim b/app/views/api/kml/lines/show.kml.slim index d314b8f19..d1e48323d 100644 --- a/app/views/api/kml/lines/show.kml.slim +++ b/app/views/api/kml/lines/show.kml.slim @@ -1,13 +1,13 @@  doctype XML -kml xmlns="http://www.opengis.net/kml/2.2"  +kml xmlns="http://www.opengis.net/kml/2.2"    document      name = "#{h(Chouette::Line.model_name.human)} : #{h(@line.name)}" -     +      placemark id="#{@line.objectid}"        name = h(@line.name)        extendeddata -        - [ :transport_mode, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop| +        - [ :transport_mode, :objectid, :created_at, :updated_at, :object_version, :creator_id, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop|            data name="#{prop.to_s}"              value = h(@line.send( prop)) @@ -17,4 +17,4 @@ kml xmlns="http://www.opengis.net/kml/2.2"          data name="network_objectid"            value = h(@line.network.objectid) -      = @line.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file +      = @line.geometry_presenter.geometry.kml_representation.html_safe diff --git a/app/views/api/kml/routes/show.kml.slim b/app/views/api/kml/routes/show.kml.slim index 51d2817c8..8a2843bc0 100644 --- a/app/views/api/kml/routes/show.kml.slim +++ b/app/views/api/kml/routes/show.kml.slim @@ -6,7 +6,7 @@ kml xmlns="http://www.opengis.net/kml/2.2"      placemark id="#{@route.objectid}"        name = h(@route.name)        extendeddata -        - [:direction, :wayback, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :published_name, :number, :direction_text, :wayback_text].each do |prop| +        - [:direction, :wayback, :objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :published_name, :number, :direction_text, :wayback_text].each do |prop|            data name="#{prop.to_s}"              value = h(@route.send( prop)) diff --git a/app/views/api/kml/stop_areas/index.kml.slim b/app/views/api/kml/stop_areas/index.kml.slim index 64f7e08be..a08dbf963 100644 --- a/app/views/api/kml/stop_areas/index.kml.slim +++ b/app/views/api/kml/stop_areas/index.kml.slim @@ -1,14 +1,14 @@  doctype XML -kml xmlns="http://www.opengis.net/kml/2.2"  +kml xmlns="http://www.opengis.net/kml/2.2"    document      name = h( I18n.t("area_types.#{@area_type.underscore}") ) -     +      - @stop_areas.select { |sa| sa.latitude && sa.longitude}.each do |stop_area|        placemark id="#{stop_area.objectid}"          name =  h(stop_area.name)          extendeddata -          - [:objectid, :object_version, :creation_time, :creator_id, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop| +          - [:objectid, :object_version, :creator_id, :created_at, :updated_at, :name, :comment, :area_type, :registration_number, :nearest_topic_name, :fare_code, :longitude, :latitude, :long_lat_type, :country_code, :street_name, :mobility_restricted_suitability, :stairs_availability, :lift_availability, :int_user_needs].each do |prop|              data name="#{prop.to_s}"                value = h(stop_area.send( prop)) @@ -16,4 +16,4 @@ kml xmlns="http://www.opengis.net/kml/2.2"              data name="parent_objectid"                value = h(stop_area.parent.objectid) -        = stop_area.geometry_presenter.geometry.kml_representation.html_safe
\ No newline at end of file +        = stop_area.geometry_presenter.geometry.kml_representation.html_safe diff --git a/app/views/api/v1/trident_objects/show.rabl b/app/views/api/v1/trident_objects/show.rabl index 7d58d9a55..e53a791ef 100644 --- a/app/views/api/v1/trident_objects/show.rabl +++ b/app/views/api/v1/trident_objects/show.rabl @@ -1,5 +1,5 @@  attributes :objectid => :object_id -[ :object_version, :creation_time, :creator_id].each do |attr| +[ :object_version, :created_at, :updated_at, :creator_id].each do |attr|    attributes attr, :unless => lambda { |m| m.send( attr).nil?}  end diff --git a/config/locales/access_links.en.yml b/config/locales/access_links.en.yml index a90085588..19687fe84 100644 --- a/config/locales/access_links.en.yml +++ b/config/locales/access_links.en.yml @@ -7,16 +7,16 @@ en:        destroy_confirm: "Are you sure you want destroy this access link?"      new:        title_access_point_to_stop_area: "Create an access link from access %{access_point} to stop area %{stop_area}" -      title_stop_area_to_access_point: "Create an access link from stop area %{stop_area} to access %{access_point}"  +      title_stop_area_to_access_point: "Create an access link from stop area %{stop_area} to access %{access_point}"      edit:        title_access_point_to_stop_area: "Update an access link from access %{access_point} to stop area %{stop_area}"        title_stop_area_to_access_point: "Update an access link from stop area %{stop_area} to access %{access_point} "      show:        title: "access link %{access_link}"        durations: "Durations (hh mm ss):" -  activerecord:         -    models:         -      access_link:  +  activerecord: +    models: +      access_link:          zero:  "access link"          one:   "access link"          other: "access links" @@ -37,7 +37,8 @@ en:          lift_availability: "Lift"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by "    formtastic:      titles: diff --git a/config/locales/access_links.fr.yml b/config/locales/access_links.fr.yml index efeb8b6f9..444052b65 100644 --- a/config/locales/access_links.fr.yml +++ b/config/locales/access_links.fr.yml @@ -37,7 +37,8 @@ fr:          lift_availability: "Ascenseur"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"    formtastic:      titles: diff --git a/config/locales/access_points.en.yml b/config/locales/access_points.en.yml index 997d84a34..b5b5e0c20 100644 --- a/config/locales/access_points.en.yml +++ b/config/locales/access_points.en.yml @@ -1,7 +1,7 @@  en:    access_points:      access_point: -      no_position: "No Position"  +      no_position: "No Position"      actions:        new: "Add a new access point"        edit: "Edit this access point" @@ -22,9 +22,9 @@ en:      index:        title: "Access points"        name_or_country_code: "Name" -  activerecord:         -    models:         -      access_point:  +  activerecord: +    models: +      access_point:          zero:  "access point"          one:   "access point"          other: "access points" @@ -50,8 +50,9 @@ en:          lift_availability: "Lift"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" -        creator_id: "Created by"  +        created_at: Created at +        updated_at: Updated at +        creator_id: "Created by"          coordinates: "Coordinates (lat,lng)"          zip_code: "Zip code"          city_name: "City" diff --git a/config/locales/access_points.fr.yml b/config/locales/access_points.fr.yml index f3a8d5b9d..81190d4a4 100644 --- a/config/locales/access_points.fr.yml +++ b/config/locales/access_points.fr.yml @@ -50,7 +50,8 @@ fr:          lift_availability: "Ascenseur"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"          coordinates: "Coordonnées (lat,lng)"          zip_code: "Code postal" diff --git a/config/locales/companies.en.yml b/config/locales/companies.en.yml index 55ad321d8..ac11a896a 100644 --- a/config/locales/companies.en.yml +++ b/config/locales/companies.en.yml @@ -38,7 +38,8 @@ en:          url: "Web page"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by "    formtastic:      titles: diff --git a/config/locales/companies.fr.yml b/config/locales/companies.fr.yml index 4d268a407..37d88c17a 100644 --- a/config/locales/companies.fr.yml +++ b/config/locales/companies.fr.yml @@ -38,7 +38,8 @@ fr:          url: "Page web associée"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"    formtastic:      titles: diff --git a/config/locales/connection_links.en.yml b/config/locales/connection_links.en.yml index ceb53cf0f..7f0ae18ae 100644 --- a/config/locales/connection_links.en.yml +++ b/config/locales/connection_links.en.yml @@ -27,12 +27,12 @@ en:      select_departure:        title: "Select start stop area for %{connection_link}"      select_arrival: -      title: "Select end stop area for %{connection_link}"  +      title: "Select end stop area for %{connection_link}"      select_areas:        title: "Select start and end stops for %{connection_link}" -  activerecord:         -    models:         -      connection_link:  +  activerecord: +    models: +      connection_link:          zero:  "connection link"          one:   "connection link"          other: "connection links" @@ -56,8 +56,9 @@ en:          lift_availability: "Lift"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" -        creator_id: "Created by"  +        created_at: Created at +        updated_at: Updated at +        creator_id: "Created by"    formtastic:      titles:        connection_link: diff --git a/config/locales/connection_links.fr.yml b/config/locales/connection_links.fr.yml index 76f1a9b7b..dad358006 100644 --- a/config/locales/connection_links.fr.yml +++ b/config/locales/connection_links.fr.yml @@ -56,7 +56,8 @@ fr:          lift_availability: "Ascenseur"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"    formtastic:      titles: diff --git a/config/locales/group_of_lines.en.yml b/config/locales/group_of_lines.en.yml index b1cc10acc..ebd596239 100644 --- a/config/locales/group_of_lines.en.yml +++ b/config/locales/group_of_lines.en.yml @@ -32,7 +32,8 @@ en:          line_count: "Number of lines"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by"    formtastic:      titles: @@ -61,4 +62,4 @@ en:            registration_number: "Positif integer, unique key, of no more than 8 digits."            objectid: "[prefix]:GroupOfLine:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character. Maximum length of the unique key = 6."    referential_group_of_lines: -    <<: *en_group_of_lines
\ No newline at end of file +    <<: *en_group_of_lines diff --git a/config/locales/group_of_lines.fr.yml b/config/locales/group_of_lines.fr.yml index 6e0f0640b..d7da6d881 100644 --- a/config/locales/group_of_lines.fr.yml +++ b/config/locales/group_of_lines.fr.yml @@ -32,7 +32,8 @@ fr:          line_count: "Nombre de lignes"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"    formtastic:      titles: @@ -61,4 +62,4 @@ fr:            registration_number: "Entier positif, clé unique, d'un maximum de 8 chiffres."            objectid: "[prefixe]:GroupOfLine:[clé_unique] caractères autorisés : alphanumériques et 'souligné' pour le préfixe, la clé unique accepte en plus le 'moins'. Longueur maximale de la clé unique = 6."    referential_group_of_lines: -    <<: *fr_group_of_lines
\ No newline at end of file +    <<: *fr_group_of_lines diff --git a/config/locales/journey_patterns.en.yml b/config/locales/journey_patterns.en.yml index b11c59bb1..d62d79e58 100644 --- a/config/locales/journey_patterns.en.yml +++ b/config/locales/journey_patterns.en.yml @@ -18,14 +18,14 @@ en:        title: "Update journey pattern %{journey_pattern}"      show:        title: "Journey Pattern %{journey_pattern}" -      stop_points: "Stop point on journey pattern list"  +      stop_points: "Stop point on journey pattern list"      index:        title: "Journey Patterns"      form:        warning: "Be careful, selection is also applied to the %{count} vehicle journeys associated to this journey pattern" -  activerecord:         -    models:         -      journey_pattern:  +  activerecord: +    models: +      journey_pattern:          zero:  "journey pattern"          one:   "journey pattern"          other: "journey patterns" @@ -33,37 +33,38 @@ en:        journey_pattern:          route: "Route"          name: "Name" -        published_name: "Published name"       +        published_name: "Published name"          comment: "Comments"          registration_number: "Registration number"          stop_point_ids: "Route's stop selection"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by"    formtastic:      titles:        journey_pattern:          name: "" -        registration_number: "Positif integer."  +        registration_number: "Positif integer."          objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character"        neptune:          journey_pattern:            name: "" -          registration_number: "Positif integer."  +          registration_number: "Positif integer."            objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character"        netex:          journey_pattern:            name: "" -          registration_number: "Positif integer."  +          registration_number: "Positif integer."            objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character"        gtfs:          journey_pattern:            name: "" -          registration_number: "Positif integer."  +          registration_number: "Positif integer."            objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character"        hub:          journey_pattern:            name: "Maximum length = 75." -          registration_number: "Positif integer, unique key, of no more than 8 digits."  +          registration_number: "Positif integer, unique key, of no more than 8 digits."            objectid: "[prefix]:JourneyPattern:[unique_key] : prefix contains only alphanumerical or underscore characters, unique_key accepts also minus character. Maximum length of the unique key = 30." diff --git a/config/locales/journey_patterns.fr.yml b/config/locales/journey_patterns.fr.yml index 83e77e474..698fd73b8 100644 --- a/config/locales/journey_patterns.fr.yml +++ b/config/locales/journey_patterns.fr.yml @@ -33,13 +33,14 @@ fr:        journey_pattern:          route: "Séquence d'arrêts"          name: "Nom" -        published_name: "Nom public"        +        published_name: "Nom public"          comment: "Commentaire"          registration_number: "Numéro d'enregistrement"          stop_point_ids: "Sélection des arrêts desservis"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"    formtastic:      titles: diff --git a/config/locales/lines.en.yml b/config/locales/lines.en.yml index 748064c3d..7ef224494 100644 --- a/config/locales/lines.en.yml +++ b/config/locales/lines.en.yml @@ -89,7 +89,8 @@ en:          comment: "Comments"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by"          footnotes: "Footnotes"          stable_id: External permanent idenifier" diff --git a/config/locales/lines.fr.yml b/config/locales/lines.fr.yml index b328b7885..3cd72d5c7 100644 --- a/config/locales/lines.fr.yml +++ b/config/locales/lines.fr.yml @@ -89,7 +89,8 @@ fr:          comment: "Commentaire"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"          footnotes: "Notes de bas de page"          stable_id: "Identifiant externe pérenne" diff --git a/config/locales/networks.en.yml b/config/locales/networks.en.yml index fdec3d45a..a5962e2a6 100644 --- a/config/locales/networks.en.yml +++ b/config/locales/networks.en.yml @@ -35,7 +35,8 @@ en:          source_identifier: "Source identifier"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by "    formtastic:      titles: diff --git a/config/locales/networks.fr.yml b/config/locales/networks.fr.yml index 0621a6689..bc9db32d9 100644 --- a/config/locales/networks.fr.yml +++ b/config/locales/networks.fr.yml @@ -35,7 +35,8 @@ fr:          source_identifier: "Identifiant du système origine"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"    formtastic:      titles: diff --git a/config/locales/route_sections.en.yml b/config/locales/route_sections.en.yml index 76fbb790d..7f4a56fc4 100644 --- a/config/locales/route_sections.en.yml +++ b/config/locales/route_sections.en.yml @@ -46,3 +46,5 @@ en:          arrival: "Arrival point"          points: "Via"          distance: "Distance" +        created_at: Created at +        updated_at: Updated at diff --git a/config/locales/route_sections.fr.yml b/config/locales/route_sections.fr.yml index 9d4d3865b..77022c226 100644 --- a/config/locales/route_sections.fr.yml +++ b/config/locales/route_sections.fr.yml @@ -46,3 +46,5 @@ fr:          arrival: "Arrêt d'arrivée"          points: "Via"          distance: "Distance" +        created_at: "Créé le" +        updated_at: "Modifié le" diff --git a/config/locales/routes.en.yml b/config/locales/routes.en.yml index d2502ef6c..0a048de79 100644 --- a/config/locales/routes.en.yml +++ b/config/locales/routes.en.yml @@ -62,7 +62,8 @@ en:          opposite_route_id: "Reversed route"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by"          no_journey_pattern: "No journey pattern"    formtastic: diff --git a/config/locales/routes.fr.yml b/config/locales/routes.fr.yml index 183531236..25d8fca85 100644 --- a/config/locales/routes.fr.yml +++ b/config/locales/routes.fr.yml @@ -62,7 +62,8 @@ fr:          opposite_route_id: "Itinéraire associé en sens opposé"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"          no_journey_pattern: "Pas de mission"    formtastic: diff --git a/config/locales/routing_constraint_zones.en.yml b/config/locales/routing_constraint_zones.en.yml index 7afff4b16..2998431fa 100644 --- a/config/locales/routing_constraint_zones.en.yml +++ b/config/locales/routing_constraint_zones.en.yml @@ -7,6 +7,8 @@ en:            name: Name            stop_areas: Stop areas            line: Line +          created_at: Created at +          updated_at: Updated at    routing_constraint_zones:      actions:        new: New routing constraint zone diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml index aca828dcb..276da2ce0 100644 --- a/config/locales/routing_constraint_zones.fr.yml +++ b/config/locales/routing_constraint_zones.fr.yml @@ -7,6 +7,8 @@ fr:            name: Nom            stop_areas: Arrêts            line: Ligne +          created_at: "Créé le" +          updated_at: "Modifié le"    routing_constraint_zones:      actions:        new: Ajouter une zone de contrainte diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index dc1716198..999457e52 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -105,7 +105,8 @@ en:          url: "Web page"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by"          children_ids: "Children"          routing_stop_ids: "Attached stops" diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml index 946199c68..8c1817d7d 100644 --- a/config/locales/stop_areas.fr.yml +++ b/config/locales/stop_areas.fr.yml @@ -105,7 +105,8 @@ fr:          url: "Page web associée"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"          children_ids: "Fils"          routing_stop_ids: "Arrêts concernés par l'ITL" diff --git a/config/locales/stop_points.en.yml b/config/locales/stop_points.en.yml index 7221eaef5..5fc5b8b5c 100644 --- a/config/locales/stop_points.en.yml +++ b/config/locales/stop_points.en.yml @@ -24,15 +24,17 @@ en:        no_object: "Nothing"        lines: "Lines"        address: "Address" -  activerecord:         -    models:         -      stop_point:  +  activerecord: +    models: +      stop_point:          zero:  "stop point on route"          one:   "stop point on route"          other: "stop points on route"      attributes:        stop_point:          lines: "lines" +        created_at: Created at +        updated_at: Updated at    simple_form:      labels:        stop_point: diff --git a/config/locales/stop_points.fr.yml b/config/locales/stop_points.fr.yml index c2516bc63..128c0416c 100644 --- a/config/locales/stop_points.fr.yml +++ b/config/locales/stop_points.fr.yml @@ -33,6 +33,8 @@ fr:      attributes:        stop_point:          lines: "Lignes" +        created_at: "Créé le" +        updated_at: "Modifié le"    simple_form:      labels:        stop_point: diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml index 1c9d86b47..e783f5b18 100644 --- a/config/locales/time_tables.en.yml +++ b/config/locales/time_tables.en.yml @@ -76,7 +76,8 @@ en:          sunday: "Sunday"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by "          calendars: "Calendar view"          calendar_details: "Calendar details" diff --git a/config/locales/time_tables.fr.yml b/config/locales/time_tables.fr.yml index 408f08fd9..6e0cb0f28 100644 --- a/config/locales/time_tables.fr.yml +++ b/config/locales/time_tables.fr.yml @@ -76,7 +76,8 @@ fr:          sunday: "Dimanche"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"          calendars: "Calendrier"          calendar_details: "Données du calendrier" diff --git a/config/locales/timebands.en.yml b/config/locales/timebands.en.yml index fae2f1d30..1ac68644d 100644 --- a/config/locales/timebands.en.yml +++ b/config/locales/timebands.en.yml @@ -24,3 +24,5 @@ en:          name: "Title"          start_time: "Start time"          end_time: "End time" +        created_at: Created at +        updated_at: Updated at diff --git a/config/locales/timebands.fr.yml b/config/locales/timebands.fr.yml index 2653fe686..6a85c7a1a 100644 --- a/config/locales/timebands.fr.yml +++ b/config/locales/timebands.fr.yml @@ -24,3 +24,5 @@ fr:          name: "Titre"          start_time: "Heure de début"          end_time: "Heure de fin" +        created_at: "Créé le" +        updated_at: "Modifié le" diff --git a/config/locales/vehicle_journeys.en.yml b/config/locales/vehicle_journeys.en.yml index abaa85d29..7f3871fbf 100644 --- a/config/locales/vehicle_journeys.en.yml +++ b/config/locales/vehicle_journeys.en.yml @@ -102,7 +102,8 @@ en:          journey_frequency_ids: "Timeband"          objectid: "Neptune identifier"          object_version: "Version" -        creation_time: "Created on" +        created_at: Created at +        updated_at: Updated at          creator_id: "Created by"          footnote_ids: "Footnotes"      errors: diff --git a/config/locales/vehicle_journeys.fr.yml b/config/locales/vehicle_journeys.fr.yml index 5cd1b3087..9597b992c 100644 --- a/config/locales/vehicle_journeys.fr.yml +++ b/config/locales/vehicle_journeys.fr.yml @@ -102,7 +102,8 @@ fr:          journey_frequency_ids: "Créneau horaire"          objectid: "Identifiant Neptune"          object_version: "Version" -        creation_time: "Créé le" +        created_at: "Créé le" +        updated_at: "Modifié le"          creator_id: "Créé par"          footnote_ids: "Notes de bas de page"      errors: diff --git a/db/migrate/20170213135212_add_timestamps_to_some_models.rb b/db/migrate/20170213135212_add_timestamps_to_some_models.rb index 1502975fe..4c5797058 100644 --- a/db/migrate/20170213135212_add_timestamps_to_some_models.rb +++ b/db/migrate/20170213135212_add_timestamps_to_some_models.rb @@ -1,13 +1,17 @@  class AddTimestampsToSomeModels < ActiveRecord::Migration    def change -    models = %i(vehicle_journeys timebands time_tables stop_points stop_areas routing_constraint_zones routes route_sections pt_links networks lines +    models = %i(vehicle_journeys timebands time_tables stop_points routing_constraint_zones routes route_sections pt_links networks lines      journey_patterns group_of_lines connection_links companies access_points access_links)      models.each do |table|        if !column_exists?(table, :created_at) && column_exists?(table, :creation_time)          add_timestamps table -        Object.const_get("Chouette::#{table.to_s.classify}").update_all 'created_at = creation_time' + +        Object.const_get("Chouette::#{table.to_s.classify}").all.each do |record| +          record.update(created_at: record.creation_time) if record.respond_to? :creation_time +        end        end +        remove_column table, :creation_time if column_exists?(table, :creation_time)      end    end diff --git a/db/schema.rb b/db/schema.rb index 217983cdd..2a1c0334c 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: 20170203144307) do +ActiveRecord::Schema.define(version: 20170213163747) do    # These are extensions that must be enabled in order to support this database    enable_extension "plpgsql" @@ -23,7 +23,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "stop_area_id",                           limit: 8      t.string   "objectid",                                                                  null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment" @@ -38,6 +37,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.string   "link_type"      t.integer  "int_user_needs"      t.string   "link_orientation" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "access_links", ["objectid"], :name => "access_links_objectid_key", :unique => true @@ -45,7 +46,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do    create_table "access_points", force: true do |t|      t.string   "objectid"      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment" @@ -65,6 +65,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.string   "zip_code"      t.string   "city_name"      t.text     "import_xml" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "access_points", ["objectid"], :name => "access_points_objectid_key", :unique => true @@ -117,7 +119,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do    create_table "companies", force: true do |t|      t.string   "objectid",                  null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "short_name" @@ -132,6 +133,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.string   "time_zone"      t.integer  "line_referential_id"      t.text     "import_xml" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "companies", ["line_referential_id"], :name => "index_companies_on_line_referential_id" @@ -143,7 +146,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "arrival_id",                             limit: 8      t.string   "objectid",                                                                  null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment" @@ -157,6 +159,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.boolean  "stairs_availability"      t.boolean  "lift_availability"      t.integer  "int_user_needs" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "connection_links", ["objectid"], :name => "connection_links_objectid_key", :unique => true @@ -221,13 +225,14 @@ ActiveRecord::Schema.define(version: 20170203144307) do    create_table "group_of_lines", force: true do |t|      t.string   "objectid",            null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment"      t.string   "registration_number"      t.integer  "line_referential_id"      t.text     "import_xml" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "group_of_lines", ["line_referential_id"], :name => "index_group_of_lines_on_line_referential_id" @@ -268,7 +273,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "route_id",                limit: 8      t.string   "objectid",                                      null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment" @@ -277,6 +281,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      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.datetime "created_at" +    t.datetime "updated_at"    end    add_index "journey_patterns", ["objectid"], :name => "journey_patterns_objectid_key", :unique => true @@ -328,7 +334,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "company_id",                      limit: 8      t.string   "objectid",                                                  null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "number" @@ -348,6 +353,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.text     "import_xml"      t.string   "transport_submode"      t.integer  "secondary_company_ids",                                                  array: true +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "lines", ["line_referential_id"], :name => "index_lines_on_line_referential_id" @@ -358,7 +365,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do    create_table "networks", force: true do |t|      t.string   "objectid",            null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.date     "version_date"      t.string   "description" @@ -370,6 +376,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.string   "comment"      t.text     "import_xml"      t.integer  "line_referential_id" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "networks", ["line_referential_id"], :name => "index_networks_on_line_referential_id" @@ -394,11 +402,12 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "route_id",         limit: 8      t.string   "objectid",                                            null: false      t.integer  "object_version" -    t.datetime "creation_time"      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    add_index "pt_links", ["objectid"], :name => "pt_links_objectid_key", :unique => true @@ -458,19 +467,19 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "arrival_id",         limit: 8      t.string   "objectid",                                                       null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.float    "distance"      t.boolean  "no_processing"      t.spatial  "input_geometry",     limit: {:srid=>4326, :type=>"line_string"}      t.spatial  "processed_geometry", limit: {:srid=>4326, :type=>"line_string"} +    t.datetime "created_at" +    t.datetime "updated_at"    end    create_table "routes", force: true do |t|      t.integer  "line_id",           limit: 8      t.string   "objectid",                    null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment" @@ -479,6 +488,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.string   "number"      t.string   "direction"      t.string   "wayback" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "routes", ["objectid"], :name => "routes_objectid_key", :unique => true @@ -491,7 +502,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.datetime "updated_at"      t.string   "objectid",       null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"    end @@ -548,7 +558,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "parent_id",                       limit: 8      t.string   "objectid",                                                            null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.string   "comment" @@ -573,6 +582,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.string   "status"      t.text     "import_xml"      t.datetime "deleted_at" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "stop_areas", ["name"], :name => "index_stop_areas_on_name" @@ -590,11 +601,12 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "stop_area_id",   limit: 8      t.string   "objectid",                 null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.integer  "position"      t.string   "for_boarding"      t.string   "for_alighting" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "stop_points", ["objectid"], :name => "stop_points_objectid_key", :unique => true @@ -640,7 +652,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do    create_table "time_tables", force: true do |t|      t.string   "objectid",                   null: false      t.integer  "object_version", default: 1 -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "version"      t.string   "comment" @@ -648,6 +659,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.date     "start_date"      t.date     "end_date"      t.integer  "calendar_id" +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "time_tables", ["calendar_id"], :name => "index_time_tables_on_calendar_id" @@ -664,7 +677,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do    create_table "timebands", force: true do |t|      t.string   "objectid",       null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "name"      t.time     "start_time",     null: false @@ -733,7 +745,6 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.integer  "company_id",                      limit: 8      t.string   "objectid",                                              null: false      t.integer  "object_version" -    t.datetime "creation_time"      t.string   "creator_id"      t.string   "comment"      t.string   "status_value" @@ -746,6 +757,8 @@ ActiveRecord::Schema.define(version: 20170203144307) do      t.boolean  "mobility_restricted_suitability"      t.boolean  "flexible_service"      t.integer  "journey_category",                          default: 0, null: false +    t.datetime "created_at" +    t.datetime "updated_at"    end    add_index "vehicle_journeys", ["objectid"], :name => "vehicle_journeys_objectid_key", :unique => true | 
