<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/app, branch 6161-missing_var_in_crontab</title>
<subtitle>Chouette manage transport static data</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/'/>
<entry>
<title>Refs #5934 Remove destructive action links for route stop points in Routes#show</title>
<updated>2018-03-09T16:48:56+00:00</updated>
<author>
<name>cedricnjanga</name>
</author>
<published>2018-03-06T14:53:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=f6fd7707c0ae9f23769928da6ba180327915e74f'/>
<id>f6fd7707c0ae9f23769928da6ba180327915e74f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5934 Only display stop point action links if user has policy</title>
<updated>2018-03-09T16:48:56+00:00</updated>
<author>
<name>cedricnjanga</name>
</author>
<published>2018-02-19T17:06:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=5d4be9c520768563a79414c73829ab10eae52434'/>
<id>5d4be9c520768563a79414c73829ab10eae52434</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #366 from af83/5989-fix_compliance_check_resource_status</title>
<updated>2018-03-09T07:57:48+00:00</updated>
<author>
<name>Luc Donnet</name>
</author>
<published>2018-03-09T07:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=523d3e418539cfe6af98bdcbae82d1f7d3fdd3c0'/>
<id>523d3e418539cfe6af98bdcbae82d1f7d3fdd3c0</id>
<content type='text'>
Fix compliance_check_resource and compliance_check_set status Refs #5…</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix compliance_check_resource and compliance_check_set status Refs #5…</pre>
</div>
</content>
</entry>
<entry>
<title>Fix compliance_check_resource and compliance_check_set status Refs #5989 @1</title>
<updated>2018-03-08T14:03:34+00:00</updated>
<author>
<name>Luc Donnet</name>
</author>
<published>2018-03-08T14:03:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=d79abf1d6c63004da9f1d969e8edee4d9cd52393'/>
<id>d79abf1d6c63004da9f1d969e8edee4d9cd52393</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Chouette::Line#by_name: Use `LEFT OUTER JOIN` on "companies"</title>
<updated>2018-03-07T12:19:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-03-07T10:37:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=186662b9ef2e996ec649298debb3df352f9849bf'/>
<id>186662b9ef2e996ec649298debb3df352f9849bf</id>
<content type='text'>
Thanks to Johan for helping me with this. He correctly remarked that
what I had before will do an `INNER JOIN`, which ends up excluding lines
that don't have an associated company. I didn't really think about the
data, and didn't realise we had lines without a company.

Big thanks to Johan for seeing that I needed to add `public.` to qualify
the `companies` table in order for the join to work. Otherwise it
doesn't work correctly and we can't filter by company name.

Refs #5889
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Thanks to Johan for helping me with this. He correctly remarked that
what I had before will do an `INNER JOIN`, which ends up excluding lines
that don't have an associated company. I didn't really think about the
data, and didn't realise we had lines without a company.

Big thanks to Johan for seeing that I needed to add `public.` to qualify
the `companies` table in order for the join to work. Otherwise it
doesn't work correctly and we can't filter by company name.

Refs #5889
</pre>
</div>
</content>
</entry>
<entry>
<title>AutocompleteLines: Sanitize `:q` param in `LIKE` operator</title>
<updated>2018-03-07T12:19:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-03-05T16:39:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=7034809b7ce458c32597026d69afdf5c37db6bd4'/>
<id>7034809b7ce458c32597026d69afdf5c37db6bd4</id>
<content type='text'>
Johan made a number of good points here:

&gt; * I think this belongs in the model
&gt; * I would rather use a named parameter here
&gt;   `.where('lines.number LIKE :q OR lines.names LIKE :q ...', q: &gt;   "%#{params[:q]}%")`
&gt; * You should defiitely escape the params before passing it to your db.
&gt;   `sanitize_sql_like` seems like the best choice here

I wasn't thinking about sanitisation at all and just assumed the `?`s in
the prepared statement would take care of it for me. But obviously,
we're passing `%`s in the param, so users can of course do the same
thing.

Protect against this using the
`ActiveRecord::Sanitization#sanitize_sql_like` method. This is a private
class method, so in order to use it we have to call it from inside the
`Chouette::Line` model.

And of course the named parameters are a no-brainer. At the time, I had
seen that `Array` splat somewhere else in the codebase and just blindly
copied the format, forgetting that named parameters even existed.

Refs #5889
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Johan made a number of good points here:

&gt; * I think this belongs in the model
&gt; * I would rather use a named parameter here
&gt;   `.where('lines.number LIKE :q OR lines.names LIKE :q ...', q: &gt;   "%#{params[:q]}%")`
&gt; * You should defiitely escape the params before passing it to your db.
&gt;   `sanitize_sql_like` seems like the best choice here

I wasn't thinking about sanitisation at all and just assumed the `?`s in
the prepared statement would take care of it for me. But obviously,
we're passing `%`s in the param, so users can of course do the same
thing.

Protect against this using the
`ActiveRecord::Sanitization#sanitize_sql_like` method. This is a private
class method, so in order to use it we have to call it from inside the
`Chouette::Line` model.

And of course the named parameters are a no-brainer. At the time, I had
seen that `Array` splat somewhere else in the codebase and just blindly
copied the format, forgetting that named parameters even existed.

Refs #5889
</pre>
</div>
</content>
</entry>
<entry>
<title>Change route to AutocompleteLinesController</title>
<updated>2018-03-07T12:19:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-03-05T16:06:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=3dea399922f40eb6afeca9f08910ab91cddeefea'/>
<id>3dea399922f40eb6afeca9f08910ab91cddeefea</id>
<content type='text'>
Johan recommended not putting it in a separate `/autocomplete...` route,
but instead to use `/referentials/4/lines/autocomplete` to be more
RESTful. Makes perfect sense.

Refs #5889
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Johan recommended not putting it in a separate `/autocomplete...` route,
but instead to use `/referentials/4/lines/autocomplete` to be more
RESTful. Makes perfect sense.

Refs #5889
</pre>
</div>
</content>
</entry>
<entry>
<title>VehicleJourney: Remove `.lines` method</title>
<updated>2018-03-07T12:19:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-02-26T14:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=0e6909005c3d330608a9707703ce89080a9debc6'/>
<id>0e6909005c3d330608a9707703ce89080a9debc6</id>
<content type='text'>
This is no longer needed thanks to the `AutocompleteLinesController` and
the AJAX filter in
`app/views/referential_vehicle_journeys/_filters.html.slim`.

Refs #5889
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is no longer needed thanks to the `AutocompleteLinesController` and
the AJAX filter in
`app/views/referential_vehicle_journeys/_filters.html.slim`.

Refs #5889
</pre>
</div>
</content>
</entry>
<entry>
<title>AutocompleteLinesController: Move filter SQL string inside query</title>
<updated>2018-03-07T12:19:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-02-26T13:45:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=f372eda831e91da367007f3e0aef725c6a67c574'/>
<id>f372eda831e91da367007f3e0aef725c6a67c574</id>
<content type='text'>
Get rid of the heredoc to allow us to put the string inside the argument
to the function directly and thus make the query more readable by
putting it in context.

Refs #5889
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Get rid of the heredoc to allow us to put the string inside the argument
to the function directly and thus make the query more readable by
putting it in context.

Refs #5889
</pre>
</div>
</content>
</entry>
<entry>
<title>AutocompleteLinesController: Include company name in filter</title>
<updated>2018-03-07T12:19:41+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-02-26T13:27:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=f43442404d37cfb04b012c73c24b1dc4bf01168d'/>
<id>f43442404d37cfb04b012c73c24b1dc4bf01168d</id>
<content type='text'>
The `#display_name` used in the drop-down on
`ReferentialVehicleJourneys#index` includes the line's company name.
Include this as a field to filter lines by.

Additionally, use `%query%` filtering everywhere. It's going to be
slower, but will produce the same behaviour for all fields for
consistency and is easier for searching by company name when you might
want to filter by a term in the middle of the name.

Refs #5889
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `#display_name` used in the drop-down on
`ReferentialVehicleJourneys#index` includes the line's company name.
Include this as a field to filter lines by.

Additionally, use `%query%` filtering everywhere. It's going to be
slower, but will produce the same behaviour for all fields for
consistency and is easier for searching by company name when you might
want to filter by a term in the middle of the name.

Refs #5889
</pre>
</div>
</content>
</entry>
</feed>
