| Age | Commit message (Collapse) | Author |
|
I had created an at-stop with nil `arrival_day_offset` and
`departure_day_offset` values because that's the kind of object this
test is testing, but when I reviewed the code, it occurred to me that
since the method takes the offset as an argument, it isn't necessary to
provide these attribute values to the factory.
Not sure whether it's clearer this way or the way it was before, but I
figured since they're not necessary it may be better to remove them.
Refs #3597
|
|
Remove the `#vjas_departure_time_must_be_before_next_stop_arrival_time`
validation. This prevented vehicle journeys from being saved if they
contained at-stops with a day offset > 0.
For example:
Arrival | Departure
23:30 | 23:30
00:05 | 00:05
should work because 00:05 is on the next day, but it doesn't because the
validation sees it as !(23:30 < 00:05).
Luc says we should remove this validator in order for the day offsets to
work. He instructed me to comment the code instead of removing it
outright, because we're not sure yet what we want to do with this, and
he needs to look into the use-case for the validation. It could be that
we completely remove the validation method, or maybe we modify it
somewhat to play nicely with day offsets.
Skip the tests that check this validation method because we've commented
out the validation. Add a test to check that saving a vehicle journey
with a positive at-stop day offset works (it failed before commenting
out the validation). Unfortunately it seemed too complicated to use
`build_stubbed` in my new test, so I gave up and just used `create`.
Sorry test speedsters. Maybe you can refactor something more
enlightened.
Refs #3597
|
|
Old `VehicleJourneyAtStop`s were created before I added a database
default of 0 to those records. Thus old data will not have the proper 0
value to check against, and our `<` `>` comparisons trigger an error due
to a comparison with `nil`.
To get around the error, set a default value of 0 (the current day) when
the offset isn't set.
I think that ideally this should be solved at the database level with a
data migration, but hopefully this is okay for now. Whenever we do
decide to do a data migration, however, this code needs to be deleted.
Refs #3597
|
|
I had changed the method name during development to add a question mark
at the end, but forgot to update the test to reflect the new naming.
Refs #3597
|
|
Robert asked me to move the duplicated factory call to a `let` block to
get rid of the duplication in the tests.
Personally I'm not a huge fan of `let`s, but am following his
recommendation here.
Refs #3597
|
|
Robert wasn't a fan of the lambda in code review, so I'm getting rid of
it and just duplicating the I18n call.
Refs #3597
|
|
Robert adeptly pointed out that my `#error_message` method is not a
nested method, like I had thought, à la Python. Instead, it actually
defines the `#error_message` method on the class at runtime
(https://stackoverflow.com/questions/4864191/is-it-possible-to-have-methods-inside-methods/4865161#4865161),
so `#error_message` becomes a normal instance method after
`#day_offset_must_be_within_range` is called. I did not know this, and
that's certainly not what I was going for.
Convert the method to a lambda to put it in the local scope.
Refs #3597
|
|
Replace our numericality validation tests with an equivalent set of
tests since we're now using a custom validation function.
Move `#outside_range` into the class scope so we can test it. Ignoring
model validation tests and hooking into this method as the "real"
important validator.
Refs #3597
|
|
Since we can't use the lambda syntax when passing a message to a
validator, write a custom validation method that allows us to be more
flexible when setting a message. The correct message with the correct
data is now used for the offset error.
This eliminates our validation of `numberiality`, making our two
validation specs no longer valid.
Refs #3597
|
|
Add a custom error message for when the day offset exceeds our maximum.
Unfortunately, this uses Rails 5 lambda syntax, so it doesn't work. Will
need to extract it to a method, but figured I'd just commit this anyway
for posterity.
The French error message text was taken from the Redmine issue, authored
by Luc. I translated it into English.
Refs #3597
|
|
We want to ensure day offsets can only be used to make at-stops for the
current day and the next day. Any more days are declared to be invalid.
For now, with bus and rail modes of transportation, we don't plan on
having journeys that extend beyond a day after the initial departure.
Also prevent setting negative day offsets while we're at it because it
goes in the same validation block and we should allow have those.
Refs #3597
|
|
Refs #4132
|
|
|
|
Introduction of Presence Validation in Import model, for:
- workbench
- referential
|
|
|
|
|
|
Refs #2263
|
|
github.com:af83/stif-boiv into 1726-WorkbenchImport-for-multi-Netex-import
|
|
1726-WorkbenchImport-for-multi-Netex-import
|
|
3506 1726 api create netex imports
|
|
|
|
* CR refacts (netex_import req spec)
* Dead Code Elimination (mount in Import subclasses)
|
|
|
|
- Fixed conf error (missing schema in `config.iev_url`)
- Reported java server traces (looks like missing metadata)
|
|
We were getting errors like these:
Started GET "/referentials/4/networks?_=1500482065840" for 127.0.0.1 at 2017-07-19 18:34:27 +0200
Processing by ReferentialNetworksController#index as JS
Parameters: {"_"=>"1500482065840", "referential_id"=>"4"}
User Load (3.6ms) SELECT "public"."users".* FROM "public"."users" WHERE "public"."users"."id" = $1 ORDER BY "public"."users"."id" ASC LIMIT 1 [["id", 1]]
locale set to :fr
Organisation Load (5.6ms) SELECT "public"."organisations".* FROM "public"."organisations" WHERE "public"."organisations"."id" = $1 LIMIT 1 [["id", 1]]
Referential Load (1.0ms) SELECT "public"."referentials".* FROM "public"."referentials" WHERE "public"."referentials"."organisation_id" = $1 AND "public"."referentials"."id" = $2 LIMIT 1 [["organisation_id", 1], ["id", 4]]
Workbench Load (0.7ms) SELECT "public"."workbenches".* FROM "public"."workbenches" WHERE "public"."workbenches"."id" = $1 LIMIT 1 [["id", 1]]
(1.3ms) SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 [["id", 1]]
CACHE (0.0ms) SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 [["id", 1]]
Chouette::Network Load (2.3ms) SELECT DISTINCT "public"."networks".* FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 ORDER BY name asc LIMIT 12 OFFSET 0 [["id", 1]]
CACHE (0.0ms) SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1 [["id", 1]]
Chouette::Network Exists (1.2ms) SELECT 1 AS one FROM "public"."networks" WHERE "public"."networks"."id" = $1 LIMIT 1 [["id", 118]]
Rendered referential_networks/index.html.slim (48.9ms)
Completed 500 Internal Server Error in 184ms (ActiveRecord: 17.4ms)
ActionView::Template::Error (undefined method `action_links' for #<Chouette::Network:0x007ffea2148b08>):
22: - if @networks.any?
23: .row
24: .col-lg-12
25: = table_builder_2 @networks,
26: [ \
27: TableBuilderHelper::Column.new( \
28: name: 'ID Codifligne', \
app/helpers/table_builder_helper.rb:161:in `block in build_links'
app/helpers/table_builder_helper.rb:158:in `build_links'
app/helpers/table_builder_helper.rb:138:in `block (3 levels) in tbody'
app/helpers/table_builder_helper.rb:110:in `block (2 levels) in tbody'
app/helpers/table_builder_helper.rb:108:in `block in tbody'
app/helpers/table_builder_helper.rb:107:in `tbody'
app/helpers/table_builder_helper.rb:72:in `table_builder_2'
app/views/referential_networks/index.html.slim:25:in `_app_views_referential_networks_index_html_slim___1557411244315414919_70366016986820'
app/controllers/referential_networks_controller.rb:27:in `index'
Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.8ms)
Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (2.5ms)
Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb (76.0ms)
on the following pages:
- http://stif-boiv.dev:3000/referentials/4/time_tables
- http://stif-boiv.dev:3000/line_referentials/1/companies
- http://stif-boiv.dev:3000/line_referentials/1/networks
- http://stif-boiv.dev:3000/referentials/4/companies
- http://stif-boiv.dev:3000/referentials/4/networks
This was caused by the request of a JS-formatted view that rendered the
HTML template, since the collection decoration only happened in the HTML
format section.
Do the decoration in both the HTML format and JS format for the relevant
controllers in order to eliminate this error.
Maybe there's a cleaner way to do this than just duplicating the
decoration in both `format.X` blocks, but I don't know of it. Wanted to
make sure not to decorate when it wasn't necessary, like when rendering
other formats (XML, etc.).
Refs #4105
|
|
|
|
|
|
out the WorkbenchImport model
|
|
|
|
|
|
|
|
|
|
|
|
A new model that represents a batched import. The zip archive attached
to this record will contain one or more datasets. A `Referential` will
be created for each dataset in the zip, and that sub-dataset will be
scheduled for a Netex import (only handling Netex imports at the
moment).
The model is currently empty but I'm committing it now so it can be used
by others on the team.
Refs #3507
|
|
- Carrier Wave Upload with `fixture_file_upload`
- Request specs to .json
- Implementation
- API token setup
- Refuted experiments with controller specs
|
|
|
|
Refs #4092
|
|
Refs #4092
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defined in delivery_job.rb in actionmailer
|
|
|
|
|