<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/spec/helpers, branch 4655-dashboard-controller</title>
<subtitle>Chouette manage transport static data</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/'/>
<entry>
<title>create base structure for compliance_control_sets</title>
<updated>2017-09-14T14:28:54+00:00</updated>
<author>
<name>Guillaume</name>
</author>
<published>2017-09-14T14:28:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=1e58dfdbfbecccda78e2fe3854b2ba04a72bd511'/>
<id>1e58dfdbfbecccda78e2fe3854b2ba04a72bd511</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>TableBuilderHelper spec: Update with `Column#link_to` calls</title>
<updated>2017-09-01T16:03:16+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-01T16:03:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=af050e3cbd7b6d931dbf7faf9ed1e3a9cf3cf6f7'/>
<id>af050e3cbd7b6d931dbf7faf9ed1e3a9cf3cf6f7</id>
<content type='text'>
The `TableBuilderHelper` now requires you to specify a `link_to`
attribute in a column you want to make a link out of instead of doing it
automagically as before.

Update the tests to do this and continue to output the right `&lt;a&gt;`s for
links.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `TableBuilderHelper` now requires you to specify a `link_to`
attribute in a column you want to make a link out of instead of doing it
automagically as before.

Update the tests to do this and continue to output the right `&lt;a&gt;`s for
links.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "TableBuilderHelper::Column#link_to: Allow arbitrary number of arguments"</title>
<updated>2017-09-01T15:22:47+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-01T14:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=df64a6dcbc38cefe41c74bcb1d2d166d13711b23'/>
<id>df64a6dcbc38cefe41c74bcb1d2d166d13711b23</id>
<content type='text'>
This reverts commit 28db706443a912e8355e4c48488dc40c403e7f76.

Turns out we didn't need to be able to pass an arbitrary number of
arguments to the lambda after all. The URL helper objects necessary in
addition to the first argument to the lambda can be retrieved from the
view context directly instead of passing them into the block as
parameters (which would actually make things more difficult, because the
block is called in the `TableBuilderHelper`, thus outside the scope of
the view).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 28db706443a912e8355e4c48488dc40c403e7f76.

Turns out we didn't need to be able to pass an arbitrary number of
arguments to the lambda after all. The URL helper objects necessary in
addition to the first argument to the lambda can be retrieved from the
view context directly instead of passing them into the block as
parameters (which would actually make things more difficult, because the
block is called in the `TableBuilderHelper`, thus outside the scope of
the view).
</pre>
</div>
</content>
</entry>
<entry>
<title>TableBuilderHelper::Column#link_to: Allow arbitrary number of arguments</title>
<updated>2017-09-01T14:04:59+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-01T14:04:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=28db706443a912e8355e4c48488dc40c403e7f76'/>
<id>28db706443a912e8355e4c48488dc40c403e7f76</id>
<content type='text'>
This enables us to pass multiple objects into the lambda, so that we can
for example build a URL using a Rails helper using multiple objects.

Example:

    column.link_to(referential, item)

    lambda do |referential, item|
      some_path(referential, item)
    end
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This enables us to pass multiple objects into the lambda, so that we can
for example build a URL using a Rails helper using multiple objects.

Example:

    column.link_to(referential, item)

    lambda do |referential, item|
      some_path(referential, item)
    end
</pre>
</div>
</content>
</entry>
<entry>
<title>TableBuilderHelper::Column: Add `#linkable?` method</title>
<updated>2017-09-01T12:52:53+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-01T12:51:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=7f85e8bbb15ec4063dad8b080e61d690b77dead7'/>
<id>7f85e8bbb15ec4063dad8b080e61d690b77dead7</id>
<content type='text'>
This tells the markup assembler whether or not this column should be
wrapped in a link (`&lt;a&gt;`). It intends to serve the same purpose as
`TableBuilderHelper#column_is_linkable`, but at the column level. The
idea is to remove that method when these links only operate by column
and not by pre-defined values like before/now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This tells the markup assembler whether or not this column should be
wrapped in a link (`&lt;a&gt;`). It intends to serve the same purpose as
`TableBuilderHelper#column_is_linkable`, but at the column level. The
idea is to remove that method when these links only operate by column
and not by pre-defined values like before/now.
</pre>
</div>
</content>
</entry>
<entry>
<title>TableBuilderHelper::Column: Add `link_to` argument</title>
<updated>2017-09-01T12:47:29+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-01T12:47:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=9574d8b8351fd59eeada05a1ba71893a82b86989'/>
<id>9574d8b8351fd59eeada05a1ba71893a82b86989</id>
<content type='text'>
This parameter will be used as the `href` to link the column value
somewhere.

We give it a lambda because this makes it easier to call any method on
the row object.

This means the accessor needs to take the object as an argument, like in
the `#value` method, because we don't have a better way to handle that
(it can't be done at initialisation time because at that point we don't
have row objects, we have a collection).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This parameter will be used as the `href` to link the column value
somewhere.

We give it a lambda because this makes it easier to call any method on
the row object.

This means the accessor needs to take the object as an argument, like in
the `#value` method, because we don't have a better way to handle that
(it can't be done at initialisation time because at that point we don't
have row objects, we have a collection).
</pre>
</div>
</content>
</entry>
<entry>
<title>CompanyDecorator#action_links: Rename `line_referential` context param</title>
<updated>2017-07-12T09:06:03+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-07-07T15:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=a6a3122bf1d2c2f6fc6b0f27b25b14da16a9b976'/>
<id>a6a3122bf1d2c2f6fc6b0f27b25b14da16a9b976</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>CustomLinks: Pass referential directly when initialising</title>
<updated>2017-07-12T09:06:03+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-07-07T14:42:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=9ab672a31cd3a1aeea59e6ae3dab96e4057ee997'/>
<id>9ab672a31cd3a1aeea59e6ae3dab96e4057ee997</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>CustomLinks spec: Update method name in spec describe</title>
<updated>2017-07-12T09:06:03+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-07-07T14:22:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=cdf5854f9a7b52f7b9f2607796d0dff90d04f6e4'/>
<id>cdf5854f9a7b52f7b9f2607796d0dff90d04f6e4</id>
<content type='text'>
The name of this method changed, but wasn't updated in the `describe`
label.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The name of this method changed, but wasn't updated in the `describe`
label.
</pre>
</div>
</content>
</entry>
<entry>
<title>Conflict resolved</title>
<updated>2017-07-06T12:15:25+00:00</updated>
<author>
<name>Robert</name>
</author>
<published>2017-07-06T12:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=b055e1266427c8edb8469e7153c64f1d1bf9c54f'/>
<id>b055e1266427c8edb8469e7153c64f1d1bf9c54f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
