aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/referential.rb
AgeCommit message (Collapse)Author
2018-05-07Ignore failed Referentials when looking for duplicatesZog
2018-05-07Rework imports to use Resources and make the a little more verboseZog
2018-05-03Refs #6920; Fix typoZog
2018-05-03Refs #6920; Activate Referentils created from scratchZog
2018-05-02Refs #6572; Crete Referentials in a pending stateZog
And fix a bug preventing the deletion of referentials without a schema
2018-04-27Refs #6572; Don't show Cleanup operationsZog
2018-04-27Refs #6572; Refactor policyZog
2018-04-27Refs #6572; Update filters on referentials listZog
2018-04-27Refs #6572; New Referential#Show for noredy referentialsZog
2018-04-27Refs #6572; Use new statesZog
2018-04-27Refs #6572; Define 4 different states on ReferentialsZog
With according methods and scopes
2018-04-26Truncate Referential#slug. Refs #6811Alban Peignier
2018-04-19Refs #6573; Fix task6573-fix-checksums-update-taskZog
Force-load all models beforehand
2018-04-10Merge pull request #438 from af83/6368-gtfs-importLuc Donnet
GTFS import (first step)
2018-04-09Refs #6367; Add metadata to other versioned modelsZog
2018-04-02Import TimeTableDates from calendar dates. Refs #6368Alban Peignier
2018-03-30Initial import for agencies, stops, routes, trips and stop_times. Refs #6368Alban Peignier
2018-03-29Refs #4658; Remove `current_functional_scope`Zog
2018-02-22Add a spec to verify to Referential migration count after creation. Refs #6010Alban Peignier
2018-02-22Keep original slug format (with _). Avoid full numeric slug. Refs #56095609_slug_formatAlban Peignier
2018-02-20Refs #5609 Change slug formatcedricnjanga
2018-02-20Replace current_workgroup by referential.workgroup. Refs #5867Alban Peignier
2018-02-13Refs #5707 Add status to the application to track 'blocked objects'cedricnjanga
2018-02-09Remove Referential#stop_areas to use stop_areas has_many through. Refs #5824Alban Peignier
2018-01-17Refs #5593 @1h;Zog
- Register all models that implement checksums - Add a simple rake task that updates all checksums within a given referential
2018-01-11Add Referential#merged_at and make Referentials archived and merged. Refs #5559Alban Peignier
2018-01-11Create Referential#full_name and try to use it (to be completed). Refs #5546Alban Peignier
2018-01-11Ignore referential_in_suite in Referential#overlapped_referential_ids (used ↵Alban Peignier
by can_unarchive. Refs #5299
2018-01-10Merge pull request #204 from af83/5413-read_only_policy_for_finalised_refsAlban Peignier
Read only policy for referentials in suite. Refs #5413
2018-01-10Restore Referential#archived? method. Refs #5413Alban Peignier
2018-01-10Lock public.referentials to avoid problem with schemas. Refs #5024Alban Peignier
2018-01-09Fix argument call to log referential create and cloneLuc Donnet
2018-01-09Add log to count migration when we clone or create schemaLuc Donnet
2018-01-09Refs: #5413@0.5h; Refactoring of #archived_or_finalised?Robert
2018-01-08Refs: #5413@0.5h; Fixed broken delegation to #archived_or_finalised?Robert
2018-01-08Avoid error into Referetial#create_schema can't read migration count5485-first-docker-scriptsAlban Peignier
2018-01-08Refs: #5413@4h; Setting up db (chore) and specing desired behavior [skip-ci]Robert
- Adapted shared pundit examples to allow to check with archieved and finalised referentials - Speced desired behavior with this enhancement - finalise_referential helper in policy spec's support
2018-01-05Fix typo in referential.rb after rebasecedricnjanga
2018-01-05Refs #5468 Change redirect after Referential#validatecedricnjanga
2018-01-05Ignore Referential with referential_suite_id in Workbench#all_referentials. ↵Alban Peignier
Refs #5330
2018-01-05First try for route/stop_point and journey_pattern merge. Refs #5299Alban Peignier
2018-01-05Ignore detect_overlapped_referentials when Referential is into a ↵Alban Peignier
ReferentialSuite. Refs #5299
2018-01-05Create Merge operation. Refs #5299Alban Peignier
2018-01-03Merge branch 'master' into ↵Luc Donnet
5024-prevent-duplicate-referentials-from-being-created-during-parallel-db-transactions--rb201711271659
2017-12-28Add log messages when Referential can't be created. Remove useless ↵Alban Peignier
build_referenial invocation in ReferentialsController#create. Refs #5297
2017-12-21BusinessCalendar => PurchaseWindowcedricnjanga
belongs_to referential
2017-12-13Referential#save_with_table_lock_timeout: Add argumentTeddy Wing
I was getting test failures like this one: 2) Workbenches show filtering filter by status should display archived referentials Failure/Error: def save_with_table_lock_timeout save_without_table_lock_timeout rescue ActiveRecord::StatementInvalid => e if e.message.include?('PG::LockNotAvailable') raise TableLockTimeoutError.new(e) else raise end ArgumentError: wrong number of arguments (given 1, expected 0) # ./app/models/referential.rb:64:in `save_with_table_lock_timeout' # .../.gem/ruby/2.3.3/gems/activerecord-4.2.8/lib/active_record/persistence.rb:241:in `update_attribute' # ./spec/features/workbenches_spec.rb:71:in `block (5 levels) in <top (required)>' # .../.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' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/command_wrapper.rb:38:in `call' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application.rb:191:in `block in serve' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application.rb:161:in `fork' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application.rb:161:in `serve' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application.rb:125:in `run' # .../.gem/ruby/2.3.3/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>' # -e:1:in `<main>' Sometimes an argument gets passed to the function and sometimes it doesn't. Inspecting that argument in a debugger revealed what appeared to be an options hash: (byebug) options {:validate=>false} Add this optional argument to get past the test failures. At this point I'm not even really considering whether this is a good idea or not, I just want this to be done. Refs #5024
2017-12-12Prevent error in Referential validation/creation when some attributs are ↵Alban Peignier
defined (organisation, name, etc)
2017-12-12Referential: Lock table on :updateTeddy Wing
We had been locking the `referentials` table on :create, but we also want to handle :update. Paired on this with Johan. When I used: referential_2.metadatas << metadata_2 the referential was saved. To add the metadata without automatically saving the referential + metadata, Johan suggested using the nested attribute method: referential_2.metadatas_attributes = [metadata_2.attributes] This allows us to add the metadata and still use the `#save` method to lock the table. Also change the callback from `before_validation` to `before_save` because before_validation :lock_table, on: [:create, :update] didn't work. That caused an error in our `expect`, as the `be_valid` triggered the lock callback. To enable the callback on both :create and :update, use a `before_save` instead. Refs #5024
2017-12-12Referential: Raise an error if the table lock times outTeddy Wing
Paired with Johan on this one. There's an internal timeout on our table lock. If it's reached, an `ActiveRecord::StatementInvalid<PG::LockNotAvailable>` error is raised. Use a custom error instead by "overriding" `#save` with a method that raises our custom error in that case instead. This will enable us to provide a custom user-facing error in the event this happens. Refs #5024