| Age | Commit message (Collapse) | Author | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
And fix a bug preventing the deletion of referentials without a schema
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
With according methods and scopes
 | 
 | 
 | 
 | 
Force-load all models beforehand
 | 
 | 
GTFS import (first step)
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
- Register all models that implement checksums
- Add a simple rake task that updates all checksums within a given
referential
 | 
 | 
 | 
 | 
 | 
 | 
by can_unarchive. Refs #5299
 | 
 | 
Read only policy for referentials in suite. Refs #5413
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
- 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
 | 
 | 
 | 
 | 
 | 
 | 
Refs #5330
 | 
 | 
 | 
 | 
ReferentialSuite. Refs #5299
 | 
 | 
 | 
 | 
5024-prevent-duplicate-referentials-from-being-created-during-parallel-db-transactions--rb201711271659
 | 
 | 
build_referenial invocation in ReferentialsController#create. Refs #5297
 | 
 | 
belongs_to referential
 | 
 | 
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
 | 
 | 
defined (organisation, name, etc)
 | 
 | 
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
 | 
 | 
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
 |