| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
journey_patterns
|
|
|
|
|
|
|
|
controllers
|
|
af83/3479-migrate-priority-table-builder-helper-calls-to-new-version
3479 migrate priority table builder helper calls to new version
|
|
I had converted the double quotes that used to be here into single
quotes without thinking, and that doesn't work because there's an
apostrophe in the string. Thankfully the failing tests told me about the
error.
Refs #3479
|
|
Had a problem on the TimeTables#index page where the #show and #edit
links in the gear menu would link to `/referentials/:id` instead of
`/referentials/:id/time_tables/:id`.
This turned out to be caused by a syntax bug in the condition that adds
the `Chouette::TimeTable` object to the polymorphic URL array. Now the
proper URL is rendered.
Refs #3479
|
|
Additionally convert the `#human_attribute_name` calls to call it on the
class because this is more correct and because that method doesn't exist
on the decorated collection of `@time_tables`.
TODO: There's a bug here where the #show and #edit links don't link
correctly, they go to `/referentials/:id` instead of
`/referentials/:id/time_tables/:id`.
Refs #3479
|
|
Apparently I messed up the breadcrumb in these views because I was
overriding the `#index` and `#show` methods defined in
`BreadcrumbController`, which make these calls to `#build_breadcrumb`.
Add them in to restore the breadcrumb links to these pages.
Refs #3479
|
|
Refs #3479
|
|
Refs #3479
|
|
Convert the table of `Route`s on this page to use the new table builder
helper. This gives us the links from the `RouteDecorator` in the gear
menu next to each row in the table.
Ended up removing the `route_sp` field from the `RouteDecorator` context
because it seems like we can just grab that collection directly from the
`Route` object. At first I thought about renaming it because after
coming back to this code I thought, 'what does sp mean?'. Then after
some investigation, it appears that we don't need to pass it in
explicitly. Now, no need to bother with that from the ReferentialLines
controller.
The RoutesController does create a separate `@route_sp` variable, but
this only changes the sort order of the stop points, not the contents of
the collection. Thus it seems safe to get them directly from the Route
in the decorator.
Refs #3479
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clean up
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These two specs were failing because of the line:
current_referential ||= nil
which would set `current_referential` to `nil` even after updating the
object being stubbed to `helper`.
Change the specs to stub the method on the correct object now that
`TableBuilderHelper::URL` doesn't depend on `current_referential`.
Update the faulty line in question to not clobber `current_referential`,
but still give us the `nil` value we were looking for when the helper
method isn't defined.
Refs #3479
|
|
Certain controllers (`Calendar` and `Referential`) don't define a
`#current_referential` method. In those cases, we'd get a
`NoMethodError` in this function when calling `#current_referential`.
To avoid the error, give `current_referential` a default value. Using a
default of `nil` works here because the current referential is needed in
other places in order to build links. Since the links in the special
models don't need a referential in order to be built, we don't care that
the value is `nil`.
Refs #3479
|
|
Convert the table of Lines to use the new version of the table builder.
Update the view with the new calling format of the helper.
The controller needs to decorate the `@lines` collection in order to
make `#action_links` available to the table builder.
Needed to update the "_filters.html.slim" template to call
`#human_attribute_name` on the class instead of the collection, because
we can't do that on a decorated collection.
Refs #3479
|
|
Turns out the only reason why this code worked before was because the
only place I was using `table_builder_2` was for a list of
`Referential`s, and there's an explicit check for
`item.is_a?(Referential)` that avoids calling `current_referential`.
Otherwise, when that `unless` condition passes, we get a failure because
`current_referential` can't be found. It can't be found because helper
methods are not accessible in this scope (duh).
In order to make the referential accessible to the method, require one
as an argument. Now we explicitly pass the `current_referential` from
places where `#polymorphic_url_parts` is called.
Refs #3479
|
|
|
|
|
|
- Fixes remaining issues with LinePolicy, CalenderPolicy & RoutePolicy
- Dead Code elimination
|
|
Policy Refactoring and Policy Test Completion
- All policies (and all permissions) under test.
- Common patterns and potential problems identified...
- ... and documented in DEVNOTES.md
- some simply refactorings
|
|
|
|
- All permissions tied to `!archived?`
- Tests adapted
- Policies refactored
? Is `create?` permission bound to `organisation_match?`
|
|
- PolicyChecker authorizes(*) all now
- Untied ApplicationPolicy#index? from show?
- mv access_point_policy.rb to access_point_policy.rb fixing an invisible name curruption (local problem?)
* to authorize: to allow (not here), to undergo the process of authorization (here)
|
|
models and actions
- ApplicationPolicy nondestructive permission depend on model existance
- ApplicationPolicy destructive permission default to `false`
- Tied Policy permissions at ApplicationPolicy Level: edit? → update?, new? → create?, index? → show?
- ApplicationPolicy convenience methods `delete?` & `authorizes_action?(action)`
- Refactoring of `spec/helpers/table_builder_helper_spec.rb` accordingly
- Stubbing scope in specs (cannot switch to referential with a `build_stubbed` instance)
|
|
|