| Age | Commit message (Collapse) | Author | 
 | 
 | 
 | 
Refs #4109
 | 
 | 
af83/3479-migrate-all-remaining-table-builder-helper-calls-to-new-version
3479 migrate all remaining table builder helper calls to new version
 | 
 | 
In order to get the `#action_links` method to be found by the new table
builder, decorate the stop area.
Refs #3479
 | 
 | 
Need to decorate the stop points collection in order to be able to call
`#action_links` on the objects therein.
Added a stub for `pundit_user` to get around
`TableBuilderHelper#table_builder_2` having a dependency on
`ApplicationController#pundit_user`. Don't like this stub at all. Should
be doing this in a better way.
Refs #3479
 | 
 | 
In order to get the view to render correctly and not fail on the
`network.action_links` call, decorate the network used in these tests.
Refs #3479
 | 
 | 
That route has been removed. Fix the test to ensure it doesn't get
accessed, but still performs what was previously tested.
Refs #3479
 | 
 | 
Now that I removed the `ReferentialLinesController#index` method and
template (c7ceb38801b853154cdae31672ff2c105c8b191f), it no longer makes
sense to keep these tests around.
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
 | 
 | 
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
 | 
 | 
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
 | 
 | 
- Decorator Spec Setup `spec/support/decortor_helpers.rb`
- Speced
- Fixed
 | 
 | 
 | 
 | 
journey_patterns
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
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
 | 
 | 
 | 
 | 
- 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?`
 | 
 | 
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)
 | 
 | 
 | 
 | 
to moving authoriation BL into policies
 | 
 | 
 | 
 | 
newapplication helper default authorization, (no if) ->
   * DefaultPolicy (all true)
   * Add some policies (LinePolicy)
   * Use `boiv:read` pour show, index
   * Adapted `table_builder`
 | 
 | 
 | 
 | 
Refs #3871
 | 
 | 
 | 
 | 
 | 
 | 
refs #3936
 | 
 | 
 | 
 | 
 |