| Age | Commit message (Collapse) | Author | 
 | 
Add a new `ReferentialDecorator` that we can use to define the links
that appear as buttons in the header of the `/referentials/:id` page.
The idea is that these links will take the place of the existing view
code and in the view, we'll instead loop over the links provided by the
decorator and render them as buttons.
I decided to do it this way because there's a requirement that the links
in the gear menu in tables show the same links that appear in the header
of the page. So the Workbenches#show page would show a table of
referentials, and their gear menu links should ostensibly be the same as
the header links in the Referentials#show page.
My goal was to abstract links, and try to separate them from the
presentation layer. Still having trouble with this though. I created a
new `Link` class to represent a link. We can then use this in the
template to create a `link_to`. It becomes messy, though, when we want
to put other elements inside a certain link, as evidenced by the
`:delete` link. Don't like how that's done, but still working out the
best approach to make it cleaner.
Refs #3479
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
'public_name'
 | 
 | 
Previously, the `#exceeds_gap?` method would modulo the
`later - earlier` duration against 24 hours such that no duration
exceeded 24 hours, and the resulting duration being compared was
adjusted to fit inside a single day.
When we removed the numbers from `exceeds_gap?`, we also removed the
modulo operation. I had a feeling that would potentially cause problems,
and it turns out it did. Though it still took too much investigation
time to realise that the most obvious answer was in fact the correct
one. Blame the confusing test failures if I will:
    Failures:
      1) Chouette::VehicleJourney state_update should return errors when validation failed
         Failure/Error: expect(state['errors'][:vehicle_journey_at_stops].size).to eq 1
         NoMethodError:
           undefined method `[]' for nil:NilClass
         # ./spec/models/chouette/vehicle_journey_spec.rb:148:in `block (3 levels) in <top (required)>'
      2) Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
         Failure/Error: expect(item['errors'][:arrival_time].size).to eq 1
         NoMethodError:
           undefined method `[]' for nil:NilClass
         # ./spec/models/chouette/vehicle_journey_spec.rb:189:in `block (4 levels) in <top (required)>'
      3) VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order
         Failure/Error: expect(VehicleJourneyImport.new(:route => route, :file => invalid_file_on_vjas_object).save).to be_falsey
           expected: falsey value
                got: true
         # ./spec/models/vehicle_journey_import_spec.rb:90:in `block (3 levels) in <top (required)>'
    Finished in 4 minutes 20.7 seconds (files took 14.47 seconds to load)
    1089 examples, 3 failures, 23 pending
    Failed examples:
    rspec ./spec/models/chouette/vehicle_journey_spec.rb:137 # Chouette::VehicleJourney state_update should return errors when validation failed
    rspec ./spec/models/chouette/vehicle_journey_spec.rb:183 # Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
    rspec ./spec/models/vehicle_journey_import_spec.rb:89 # VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order
These three tests failed with my version of `exceeds_gap?`.
To correct the failures, add back in the 24-hour adjustment. Put it in a
named method that is hopefully clear enough to understand.
The second test failure ("vehicle_journey_at_stops should return errors
when validation failed") used two times that were the same. I decided to
add a test for this because it seemed like an interesting edge case. The
test I added didn't fail even for the previous version of
`.exceeds_gap?`, but I figure it seems like a useful test anyway.
Refs #870
 | 
 | 
Describe what's going on here to hopefully make it easier to understand.
Refs #870
 | 
 | 
Instead of hard-coding the duration to compare against, get it from the
function argument. This allows us to set different durations at the time
the method is called.
Also simplify the comparison, getting rid of the math that makes this
method much more difficult to read.
Refs #870
 | 
 | 
Put the `exceeds_gap?` method in a new module called `TimeDuration`.
This will allow us to use it from both the
`Chouette::VehicleJourneyAtStop` class and from the
`IncreasingTimeOrderValidator`. Doing this also allows us to test it
independently.
Haven't yet rewritten the increasing times validator to take advantage
of this new method, but adding it now to ensure we don't get an error
calling a non-existent method in `VehicleJourneyAtStop`.
I changed the signature of the method to take a duration as its first
argument. This allows us to set arbitrary durations to compare against
and surfaces the duration when reading code where the  method is called.
Not sure if that's the best approach here, but it seems to make sense
for now.
Refs #870
 | 
 | 
 | 
 | 
* use a single transaction
* use by default workbench 1
* use a random line found in workbench lines
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Range#intersection
 | 
 | 
Refs #3077
 | 
 | 
 | 
 | 
Refs #3089
 | 
 | 
 | 
 | 
* define default start_date and end_date
* associate VehicleJourneyAtStops to VehicleJourney
* associate VehicleJourney to TimeTables
* add a message to display which Referential is created
* mark created Referential as ready
 | 
 | 
lib/af83/stored_procedures.rb for sql stored procedure management; Refs #2864
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Refs #2789
 | 
 | 
Refs #2737
 | 
 | 
dates. Refs #2621
 | 
 | 
 | 
 | 
Refs #2490
 | 
 | 
 | 
 | 
Refs #2451
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Refs #2089
 | 
 | 
Refs #2089
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Refs #1981
 | 
 | 
Refs #1976
 |