aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-03-01Remove useless shadowimprove-referentials-overviewZog
2018-02-28Small improvements on referential overviewsZog
2018-02-28Upgrade rack-protection to 1.5.4. Refs #6057Alban Peignier
2018-02-27Merge pull request #339 from af83/5878-fix-ComplianceChecksController-showLuc Donnet
5878 Add ComplianceCheck#show
2018-02-27Delete unused sinatra gem in Gemfile5878-fix-ComplianceChecksController-showLuc Donnet
2018-02-27Fix prerequisite access for compliance_check and compliance_control Refs ↵Luc Donnet
#5878 @1
2018-02-27Refs #5878; Refactor ComplianceChecksControllerZog
Use InheritedResources helpers
2018-02-27refs #5878; Remove hard link between a ComplianceCheck and the associated ↵Zog
ComplianceControl
2018-02-27Merge pull request #321 from af83/5979_change_export_csv_filenamesLuc Donnet
Refs #5979 Change export CSV filenames to have a readable date in it
2018-02-27Merge pull request #320 from af83/5882_ccset_code_filterLuc Donnet
Refs #5882 Fix CC name and code filter
2018-02-27Merge pull request #340 from ↵Luc Donnet
af83/5950_allow_user_to_see_ccset_from_other_organisation Refs #5950 Fix 404 error when user wants to see CCSet from other orga…
2018-02-27Merge pull request #345 from af83/6026-dedicated-env-for-seedsLuc Donnet
6026 Use SEED_ENV in seedbank, fallback on Rails.env
2018-02-27Don't use all compliance_control_set from stif organisation. We will use ↵5950_allow_user_to_see_ccset_from_other_organisationLuc Donnet
later compliance_control_set selected by stif organisatoon Refs #5950 @2
2018-02-27Refs #6026; Fix duplicated seeds tasks6026-dedicated-env-for-seedsZog
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-26Refs #6026; Use SEED_ENV in seedbank, fallback on Rails.envZog
2018-02-23Refs #5950 Fix 404 error when user wants to see CCSet from other organisation :cedricnjanga
- remove begin_association_chain in controller - Change collecyion to only see user organisayion CCSet and STIF CCSet - add policy for show action
2018-02-23Refs 5878; Add ComplianceCheck#showZog
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