aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-02-27Refs #6063; Fix the journeys time editor6036-fix-journeys-editorZog
2018-02-27Small css fix on referential overviewsZog
2018-02-27Fix breadcrumb on merges controllerZog
2018-02-27Reorder route_stop_points when creating Chouette::StopPoint in route merge. ↵Alban Peignier
Refs #6040
2018-02-23Fix small bug on referential overviewZog
2018-02-22Don't load activerecord-nulldb-adapter if RAILS_DB_ADAPTER isn't nulldb. ↵Alban Peignier
Refs #6010
2018-02-22Add a spec to verify to Referential migration count after creation. Refs #6010Alban Peignier
2018-02-22Merge pull request #333 from ↵Alban Peignier
af83/5943-referential-vehicle_journeys-index--query-error-when-fi VehicleJourney#in_purchase_window: Use table namespace in query. Refs #5943
2018-02-22VehicleJourney#in_purchase_window: Use table namespace in queryTeddy Wing
We were getting this errorwhen filtering by purchase window on the `ReferentialVehicleJourneys#index` page. An example of a filter query that triggered the error: http://stif-boiv.dev:3000/referentials/4/vehicle_journeys?utf8=✓&q[published_journey_name_or_objectid_cont]=&q[company_id_eq_any][]=&q[route_line_id_eq]=&q[published_journey_name_gteq]=&q[published_journey_name_lteq]=&q[stop_area_ids][]=&q[purchase_window][start_date(3i)]=12&q[purchase_window][start_date(2i)]=1&q[purchase_window][start_date(1i)]=2018&q[purchase_window][end_date(3i)]=15&q[purchase_window][end_date(2i)]=1&q[purchase_window][end_date(1i)]=2019&q[time_table][start_date(3i)]=&q[time_table][start_date(2i)]=&q[time_table][start_date(1i)]=&q[time_table][end_date(3i)]=&q[time_table][end_date(2i)]=&q[time_table][end_date(1i)]=&commit=Filtrer ActiveRecord::StatementInvalid in ReferentialVehicleJourneys#index Showing stif-boiv/app/views/referential_vehicle_journeys/_filters.html.slim where line #24 raised: PG::AmbiguousColumn: ERROR: column reference "id" is ambiguous LINE 1: ...RE "vehicle_journeys"."journey_category" = 0 AND (id IN (SEL... ^ : SELECT "public"."lines".* FROM "public"."lines" WHERE (id IN (SELECT routes.line_id FROM "vehicle_journeys" INNER JOIN "routes" ON "routes"."id" = "vehicle_journeys"."route_id" WHERE "vehicle_journeys"."journey_category" = 0 AND (id IN (SELECT DISTINCT vehicle_journeys.id FROM "purchase_windows" INNER JOIN "purchase_windows_vehicle_journeys" ON "purchase_windows_vehicle_journeys"."purchase_window_id" = "purchase_windows"."id" INNER JOIN "vehicle_journeys" ON "vehicle_journeys"."id" = "purchase_windows_vehicle_journeys"."vehicle_journey_id" AND "vehicle_journeys"."journey_category" = 0 WHERE (daterange('2018-01-12', '2019-01-16') && any (date_ranges)))) ORDER BY "vehicle_journeys"."published_journey_name" ASC LIMIT 10 OFFSET 0)) Extracted source (around line #24): class: 'control-label' .form-inline.filter_menu = f.input :route_line_id_eq, as: :select, include_blank: t(".all"), collection: @vehicle_journeys.lines, Trace of template inclusion: app/views/referential_vehicle_journeys/index.html.slim We're trying to match `VehicleJourney`s here, so qualify the `id` column with the table name to fix the error. Refs #5943
2018-02-22Return false in has_feature? when no organisation is defined. Refs #6007Alban Peignier
2018-02-22TypoZog
2018-02-22Merge pull request #330 from af83/5993-enhance-detailed-calendarAlban Peignier
Homogenize calendars display. Refs #5993
2018-02-22Ignore not ready Referentials in apartment tenant names. Refs #6004Alban Peignier
2018-02-22Merge pull request #331 from af83/5938-locale-selectorAlban Peignier
Add a locale selector menu item. Refs #5398
2018-02-22Prevent error when PunditViewPolicy try to find undefined features5938-locale-selectorAlban Peignier
2018-02-22Test feature :change_locale to display language switch. Refs #5938Alban Peignier
2018-02-22Refs #5398; Add a locale selector menu itemZog
2018-02-22Merge pull request #329 from af83/5995-update-display-on-vjs-indexAlban Peignier
Change ReferentialVJs#index when filtered by stops. Refs #5995. Refs #5996. Refs #5852
2018-02-22Remove phantom objectid extension5995-update-display-on-vjs-indexAlban Peignier
2018-02-22Use local time in ReferentialVJs#index. Enable sort on times in ↵Alban Peignier
ReferentialVehicleJourneys#index. Refs #5996. Refs #5852
2018-02-22Merge pull request #319 from af83/5609_slug_formatAlban Peignier
Avoid problem with numeric in slug. Refs #5609
2018-02-22Keep original slug format (with _). Avoid full numeric slug. Refs #56095609_slug_formatAlban Peignier
2018-02-22Refs #5993; Homogenize calendars display5993-enhance-detailed-calendarZog
2018-02-22Merge pull request #324 from af83/5942-apply-user-tzAlban Peignier
Apply user tz. Refs #5942
2018-02-22Refs #5995; Add extra columns on ReferentialVJs#index when filtered by stopsZog
2018-02-22WorkbenchImportWorker: Use `File.unlink` instead of `#unlink`Teddy Wing
I was getting this error when I removed the `rescue nil`s: Failures: 1) WorkbenchImportWorker foreign lines uploads the following entries: ["OFFRE_TRANSDEV_20170301122517", "OFFRE_TRANSDEV_20170301122519"] Failure/Error: eg_file.unlink NoMethodError: undefined method `unlink' for #<File:0x007fef1adbace8> # ./app/workers/workbench_import_worker.rb:81:in `upload_entry_group_stream' # ./app/workers/workbench_import_worker.rb:52:in `upload_entry_group' # ./app/services/zip_service.rb:61:in `<<' # ./app/services/zip_service.rb:61:in `finish_current_output' # ./app/services/zip_service.rb:35:in `add_entry' # ./app/services/zip_service.rb:27:in `block in _subdirs' # .../.gem/ruby/2.3.3/gems/rubyzip-1.2.1/lib/zip/entry_set.rb:38:in `block in each' # .../.gem/ruby/2.3.3/gems/rubyzip-1.2.1/lib/zip/entry_set.rb:37:in `each' # .../.gem/ruby/2.3.3/gems/rubyzip-1.2.1/lib/zip/entry_set.rb:37:in `each' # .../.gem/ruby/2.3.3/gems/rubyzip-1.2.1/lib/zip/central_directory.rb:182:in `each' # ./app/services/zip_service.rb:26:in `_subdirs' # .../.gem/ruby/2.3.3/gems/rubyzip-1.2.1/lib/zip/file.rb:133:in `open_buffer' # ./app/services/zip_service.rb:21:in `block in subdirs' # ./app/workers/workbench_import_worker.rb:39:in `each' # ./app/workers/workbench_import_worker.rb:39:in `each_with_index' # ./app/workers/workbench_import_worker.rb:39:in `upload' # ./app/workers/workbench_import_worker.rb:19:in `perform' # ./spec/workers/workbench_import_worker_spec.rb:68:in `block (4 levels) in <top (required)>' # ./spec/workers/workbench_import_worker_spec.rb:68:in `block (3 levels) in <top (required)>' # ./spec/workers/workbench_import_worker_spec.rb:13:in `instance_eval' # ./spec/workers/workbench_import_worker_spec.rb:13:in `block in expect_upload_with' # .../.gem/ruby/2.3.3/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:268:in `load' # .../.gem/ruby/2.3.3/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:268:in `block in load' # .../.gem/ruby/2.3.3/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency' # .../.gem/ruby/2.3.3/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:268:in `load' # .../.gem/ruby/2.3.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call' # -e:1:in `<main>' Johan said that in his tests on his local machine, the temp files weren't getting deleted. When I try running the specs, the temp files do get deleted, so not sure what was going on. Figure it may be because of the `rescue nil`s, so I decided to remove those in the hopes of always ensuring we close and unlink the temp files. The trouble with doing that, however, was that it caused the error and thus test failures like the example above. I managed to fix the problem by using `File.unlink` instead of the instance method. Hopefully this works to ensure that the temp files are always deleted. Refs #4315
2018-02-22WorkbenchImportWorker: Reinstate creation of `./tmp/imports`Teddy Wing
If the directory doesn't exist, we should create it to ensure we don't get errors trying to write to a location that doesn't exist. I had removed this because I assumed the dir would be created during deployment, but I guess I shouldn't assume. Also, we want to ensure the dir gets created on dev machines without errors. This line is updated from last time where we'd create `Rails.root.join('tmp', 'imports')`. Now we use our `#temp_directory`, which can be variable. Refs #4315
2018-02-22WorkbenchImportWorker: Use temp files for entry group subdir ZipsTeddy Wing
Instead of creating our own files for these subdirectory Zip files, use temp files. There are two advantages to doing this: 1. We can customise the location they get saved to. This means we can use `Rails.root` as a default, but specify a custom location in a Rails config variable. 2. The files will be automatically deleted on every garbage collection. In actuality, #2 above was already handled by the `eg_file.unlink` line, and #1 could be easily added to the existing code. Using a `Tempfile`, though, makes the fact that these are temporary files more explicit. The reason why we want to be able to customise the location of these tempfiles is that in our production environment set up by Puppet, the `#{Rails.root}/tmp/imports` directory isn't writable by the application, which causes this code to error. We thus want a way to change the path in different environments. We keep the `eg_file.unlink` call here because we want the temporary file to be deleted as soon as possible. The Ruby documentation even recommends it (https://ruby-doc.org/stdlib-2.5.0/libdoc/tempfile/rdoc/Tempfile.html#class-Tempfile-label-Explicit+close): > it's good practice to do so: not explicitly deleting unused Tempfiles > can potentially leave behind large amounts of tempfiles on > the filesystem until they're garbage collected. I got rid of the `#upload_entry_group_tmpfile` method in this change, moving its contents to `#upload_entry_group_stream`. This was easy enough to do since it was only called in that one place. The reason I did this is because it took an open `File` object as an argument and closed the file at the end of the method. That's a major side effect. I don't think the method should be closing a file it doesn't own. After moving this work to `#upload_entry_group_stream`, we can close and unlink the file in the same place where it was created. Refs #4315
2018-02-22Refs #5999 Update workgroup call in TimeTable#newcedricnjanga
2018-02-21Refs #5942; Apply users TZ when computing a schedule5942-apply-user-tzZog
2018-02-21Refs #5944; Skip automated times calculation when no start time is set5944-skip-schedule-calculation-when-no-time-is-setZog
2018-02-21Move importers outputs in logsZog
2018-02-21Improve output of importersZog
2018-02-21Avoid error in referentials/_overview when one of lines isn't associated to ↵Alban Peignier
a transport mode
2018-02-20Refs #5609 Change slug formatcedricnjanga
2018-02-20Use page as will_paginate param_name by default. Refs #3542Alban Peignier
2018-02-20Merge pull request #304 from af83/5901-fix-calendar-autocompletionteddywing
5901 Makes TimeTable search accent-insensitive
2018-02-20Refs #5901; Update specs and fix unaccented searchZog
2018-02-20Refs #5901; Makes TimeTable search accent insensitiveZog
2018-02-20Merge pull request #308 from ↵Alban Peignier
af83/5911-stops-filter-on-referential-journeys-index Better stops filters on ReferentialVJs#index. Refs #5911
2018-02-20Merge pull request #297 from af83/5486-fix-react-warningsLuc Donnet
5486 Use minified version of React/Redux in production
2018-02-20Merge pull request #294 from af83/5863-use-shallow-urls-for-referentialsLuc Donnet
5863 Remove workbench id from the querystring
2018-02-20Fix specs on VehicleJourneyAtStopZog
2018-02-20Merge branch '5863-use-shallow-urls-for-referentials' of ↵Luc Donnet
github.com:AF83/stif-boiv into 5863-use-shallow-urls-for-referentials
2018-02-20Refs #5863 @6h; Remove workbench id from the querystringZog
Infer it when possible, and use a nested otherwise
2018-02-20Fix specsZog
2018-02-20Refs #5924; Fix SimpleImporter lookup scopeZog
2018-02-20Regs #5924; Rename imports tasksZog
2018-02-20Refs #5924; Remove `local_id` methodsZog
2018-02-20Refs #5924; Fix some bugs revealed during importsZog
- The checksum computing for VehicleJourneyAtStops - Offsets calculation in VehicleJourneys