| Age | Commit message (Collapse) | Author |
|
Just wrote the `#index` method and saw that the `#show` method's
`context` hash contents are a bit verbose. Shorten them to match the
`#index` method. These mean the same thing but are a bit cleaner.
Refs #3479
|
|
Render table of `RoutingConstraintZones` using the new table builder.
Refs #3479
|
|
I had broken the breadcrumb by overriding `#show` here. Add in the
`build_breadcrumb` call to make it appear again.
Refs #3479
|
|
Leverage our newly created `ReferentialLineDecorator` to render the
header links, allowing us to use them both here and in the table of
lines on the Referentials#show page.
Used the extended decoration syntax to allow us to specify the
`ReferentialLineDecorator`, otherwise Draper will infer `LineDecorator`,
which is not what we want in this case.
Refs #3479
|
|
Needed to add a new decorator to provide links to this table's gear
menu. The links correspond to those in the header on the
"referential_lines/show.html.slim" page.
Call `#human_attribute_name` on the model directly instead of the
collection because the decorated collection doesn't expose that method.
Refs #3479
|
|
|
|
|
|
|
|
Delete this route and associated template files. Wasn't sure if using
`exclude:` in the routes file was the best way to do this, as I'm not
sure if there are other routes we want to exclude from here also.
I visited the page because I'm migrating templates to the new table
builder helper and this one uses table builder. Upon visiting the page,
it looked pretty wonky, and after consulting with Jean-Paul and Luc, it
turns out this page isn't used any more because the table of
`Chouette::Line`s rendered there is now instead displayed on the
Referentials#show page, obviating the need for this page.
Refs #3479
|
|
Rename this to `referential` to be more generic. This is because we
could be passing both `Referential`s and `LineReferential`s into this
parameter.
In `CompaniesController`, we use a `LineReferential` while in
`ReferentialCompaniesController` we use `Referential`.
Refs #3479
|
|
TODO: Rename `line_referential` context parameter in `CompanyDecorator`
to `referential` since the name needs to make sense both for
`Referential` and for `LineReferential`.
Refs #3479
|
|
Refs #3479
|
|
Instead of getting the referential to use when building the polymorphic
URL from the `UserContext`, pass in a referential directly.
The old code that used `user_context.context[:referential]` relied on
the fact that `ApplicationController#pundit_user` was defined as
follows:
def pundit_user
UserContext.new(current_user, referential: self.try(:current_referential))
end
(We pass `pundit_user` into `CustomLinks` from
`TableBuilderHelper#build_links`.)
However, Robert's change 747d333ffbcc8ee0c9f1daf93ccca32799434e04
removes the `current_referential` call from `#pundit_user`. In
`CustomLinks`, we actually always want to be using
`current_referential`.
For example, on `Companies#index` (/line_referentials/:id/companies),
`CustomLinks` fails to build a correct #show link because
`user_context.context[:referential]` is `nil`, when it should instead be
a `LineReferential` object, that gets returned by the
`#current_referential` helper method. Sure, `#current_referential` is
hard to understand, so maybe we'll change that around in the future, but
this at least allows us to use the current referential in `CustomLinks`.
Refs #3479
|
|
At Robert's recommendation, use `try` instead of `respond_to?` because
it's shorter.
Also at Robert's recommendation, move the `referential` variable to a
method to memoize it. This allows us to use it in other places without
re-getting it and without having to do the `if` check again.
He had suggested:
def referential
return @__referential__ if instance_variable_defined?(:@__referential__)
@__referential__ = try(:current_referential)
end
but I think the `||=` version works the same way and is shorter. Still
need to find out from him what our style guide rules for __variables__
are and why I should be using one here.
Refs #3479
|
|
The name of this method changed, but wasn't updated in the `describe`
label.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
calenders#index view and made them pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Refs #2263
|
|
Refs #2263
|
|
Refs #2263
|
|
day, there should be something wrong with 3.0.0
|
|
|
|
|
|
|
|
- Decorator Spec Setup `spec/support/decortor_helpers.rb`
- Speced
- Fixed
|
|
|
|
|