<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/app/controllers/companies_controller.rb, branch 7185-cleanup</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 #7004 Lower params[:sort] to avoid sort bugs</title>
<updated>2018-05-23T14:08:41+00:00</updated>
<author>
<name>cedricnjanga</name>
</author>
<published>2018-05-22T14:24:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=01d99506319cfb3db301afb476e3f124a71871b0'/>
<id>01d99506319cfb3db301afb476e3f124a71871b0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #6669; Revert Workaround</title>
<updated>2018-04-25T13:46:33+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-04-25T09:23:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=913dd3b3c6cfa0b519ac3043e8b0a4efc4d983b9'/>
<id>913dd3b3c6cfa0b519ac3043e8b0a4efc4d983b9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Workaround to CustomField initialization. #custom_fields_values requires to know the associated referential. Refs #6669</title>
<updated>2018-04-25T13:46:33+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2018-04-25T08:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=a0567f40c0ad57abcf630d97816e38f73750138e'/>
<id>a0567f40c0ad57abcf630d97816e38f73750138e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #6196; Add Custom Fields to companies</title>
<updated>2018-04-04T09:12:34+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-03-16T12:04:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=6d15b7ec25592dc34cd95c738ef0854fdd1b94d2'/>
<id>6d15b7ec25592dc34cd95c738ef0854fdd1b94d2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refs #5586 @1.5h; Migrate more decorators</title>
<updated>2018-01-25T16:17:59+00:00</updated>
<author>
<name>Zog</name>
</author>
<published>2018-01-17T08:36:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=377ddcd306fb9e61e734aaf3762e05f448938af0'/>
<id>377ddcd306fb9e61e734aaf3762e05f448938af0</id>
<content type='text'>
- Remove ApiKeyDecorator (never used)
- Migrate CalendarDecorator
- Migrate CompanyDecorator
- Migrate TimeTableDecorator
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Remove ApiKeyDecorator (never used)
- Migrate CalendarDecorator
- Migrate CompanyDecorator
- Migrate TimeTableDecorator
</pre>
</div>
</content>
</entry>
<entry>
<title>Use current_organisation as begin_of_association_chain in Lines/Companies/Networks/GroupOfLinesController. Refs #5102</title>
<updated>2017-12-28T07:56:05+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2017-12-28T07:50:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=da60766c207ac372e2ebd1d42be7c7b9c3ee4957'/>
<id>da60766c207ac372e2ebd1d42be7c7b9c3ee4957</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactoring move referentialSupport from chouetteController into childrens</title>
<updated>2017-11-28T11:21:03+00:00</updated>
<author>
<name>Xinhui</name>
</author>
<published>2017-11-22T13:34:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=4792a04f83f5a52757092e5b66f6d27f658c3c6b'/>
<id>4792a04f83f5a52757092e5b66f6d27f658c3c6b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove breadcrumb_controller</title>
<updated>2017-10-26T09:51:07+00:00</updated>
<author>
<name>Xinhui</name>
</author>
<published>2017-10-26T09:51:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=68bc446c975ff07cf2b4eb9f695da2dce93ee63d'/>
<id>68bc446c975ff07cf2b4eb9f695da2dce93ee63d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Breadcrumb for line_referential - stop_area_referential - companies</title>
<updated>2017-10-19T14:45:19+00:00</updated>
<author>
<name>Xinhui</name>
</author>
<published>2017-10-19T14:45:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=a8f4fbe9d16984fbdf2cd769b7abe4f442b56688'/>
<id>a8f4fbe9d16984fbdf2cd769b7abe4f442b56688</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix errors from JS-formatted templates using the table_builder</title>
<updated>2017-07-19T16:41:05+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-07-19T16:41:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=37741f8bd5bc4c3698194c04bbe8aee3d7f6781a'/>
<id>37741f8bd5bc4c3698194c04bbe8aee3d7f6781a</id>
<content type='text'>
We were getting errors like these:

    Started GET "/referentials/4/networks?_=1500482065840" for 127.0.0.1 at 2017-07-19 18:34:27 +0200
    Processing by ReferentialNetworksController#index as JS
      Parameters: {"_"=&gt;"1500482065840", "referential_id"=&gt;"4"}
      User Load (3.6ms)  SELECT  "public"."users".* FROM "public"."users" WHERE "public"."users"."id" = $1  ORDER BY "public"."users"."id" ASC LIMIT 1  [["id", 1]]
    locale set to :fr
      Organisation Load (5.6ms)  SELECT  "public"."organisations".* FROM "public"."organisations" WHERE "public"."organisations"."id" = $1 LIMIT 1  [["id", 1]]
      Referential Load (1.0ms)  SELECT  "public"."referentials".* FROM "public"."referentials" WHERE "public"."referentials"."organisation_id" = $1 AND "public"."referentials"."id" = $2 LIMIT 1  [["organisation_id", 1], ["id", 4]]
      Workbench Load (0.7ms)  SELECT  "public"."workbenches".* FROM "public"."workbenches" WHERE "public"."workbenches"."id" = $1 LIMIT 1  [["id", 1]]
       (1.3ms)  SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  [["id", 1]]
      CACHE (0.0ms)  SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  [["id", 1]]
      Chouette::Network Load (2.3ms)  SELECT  DISTINCT "public"."networks".* FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  ORDER BY name asc LIMIT 12 OFFSET 0  [["id", 1]]
      CACHE (0.0ms)  SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  [["id", 1]]
      Chouette::Network Exists (1.2ms)  SELECT  1 AS one FROM "public"."networks" WHERE "public"."networks"."id" = $1 LIMIT 1  [["id", 118]]
      Rendered referential_networks/index.html.slim (48.9ms)
    Completed 500 Internal Server Error in 184ms (ActiveRecord: 17.4ms)

    ActionView::Template::Error (undefined method `action_links' for #&lt;Chouette::Network:0x007ffea2148b08&gt;):
        22:     - if @networks.any?
        23:       .row
        24:         .col-lg-12
        25:           = table_builder_2 @networks,
        26:             [ \
        27:               TableBuilderHelper::Column.new( \
        28:                 name: 'ID Codifligne', \
      app/helpers/table_builder_helper.rb:161:in `block in build_links'
      app/helpers/table_builder_helper.rb:158:in `build_links'
      app/helpers/table_builder_helper.rb:138:in `block (3 levels) in tbody'
      app/helpers/table_builder_helper.rb:110:in `block (2 levels) in tbody'
      app/helpers/table_builder_helper.rb:108:in `block in tbody'
      app/helpers/table_builder_helper.rb:107:in `tbody'
      app/helpers/table_builder_helper.rb:72:in `table_builder_2'
      app/views/referential_networks/index.html.slim:25:in `_app_views_referential_networks_index_html_slim___1557411244315414919_70366016986820'
      app/controllers/referential_networks_controller.rb:27:in `index'

      Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.8ms)
      Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (2.5ms)
      Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb (76.0ms)

on the following pages:

- http://stif-boiv.dev:3000/referentials/4/time_tables
- http://stif-boiv.dev:3000/line_referentials/1/companies
- http://stif-boiv.dev:3000/line_referentials/1/networks
- http://stif-boiv.dev:3000/referentials/4/companies
- http://stif-boiv.dev:3000/referentials/4/networks

This was caused by the request of a JS-formatted view that rendered the
HTML template, since the collection decoration only happened in the HTML
format section.

Do the decoration in both the HTML format and JS format for the relevant
controllers in order to eliminate this error.

Maybe there's a cleaner way to do this than just duplicating the
decoration in both `format.X` blocks, but I don't know of it. Wanted to
make sure not to decorate when it wasn't necessary, like when rendering
other formats (XML, etc.).

Refs #4105
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We were getting errors like these:

    Started GET "/referentials/4/networks?_=1500482065840" for 127.0.0.1 at 2017-07-19 18:34:27 +0200
    Processing by ReferentialNetworksController#index as JS
      Parameters: {"_"=&gt;"1500482065840", "referential_id"=&gt;"4"}
      User Load (3.6ms)  SELECT  "public"."users".* FROM "public"."users" WHERE "public"."users"."id" = $1  ORDER BY "public"."users"."id" ASC LIMIT 1  [["id", 1]]
    locale set to :fr
      Organisation Load (5.6ms)  SELECT  "public"."organisations".* FROM "public"."organisations" WHERE "public"."organisations"."id" = $1 LIMIT 1  [["id", 1]]
      Referential Load (1.0ms)  SELECT  "public"."referentials".* FROM "public"."referentials" WHERE "public"."referentials"."organisation_id" = $1 AND "public"."referentials"."id" = $2 LIMIT 1  [["organisation_id", 1], ["id", 4]]
      Workbench Load (0.7ms)  SELECT  "public"."workbenches".* FROM "public"."workbenches" WHERE "public"."workbenches"."id" = $1 LIMIT 1  [["id", 1]]
       (1.3ms)  SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  [["id", 1]]
      CACHE (0.0ms)  SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  [["id", 1]]
      Chouette::Network Load (2.3ms)  SELECT  DISTINCT "public"."networks".* FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  ORDER BY name asc LIMIT 12 OFFSET 0  [["id", 1]]
      CACHE (0.0ms)  SELECT DISTINCT COUNT(DISTINCT "public"."networks"."id") FROM "public"."networks" INNER JOIN "public"."line_referentials" ON "public"."networks"."line_referential_id" = "public"."line_referentials"."id" WHERE "public"."line_referentials"."id" = $1  [["id", 1]]
      Chouette::Network Exists (1.2ms)  SELECT  1 AS one FROM "public"."networks" WHERE "public"."networks"."id" = $1 LIMIT 1  [["id", 118]]
      Rendered referential_networks/index.html.slim (48.9ms)
    Completed 500 Internal Server Error in 184ms (ActiveRecord: 17.4ms)

    ActionView::Template::Error (undefined method `action_links' for #&lt;Chouette::Network:0x007ffea2148b08&gt;):
        22:     - if @networks.any?
        23:       .row
        24:         .col-lg-12
        25:           = table_builder_2 @networks,
        26:             [ \
        27:               TableBuilderHelper::Column.new( \
        28:                 name: 'ID Codifligne', \
      app/helpers/table_builder_helper.rb:161:in `block in build_links'
      app/helpers/table_builder_helper.rb:158:in `build_links'
      app/helpers/table_builder_helper.rb:138:in `block (3 levels) in tbody'
      app/helpers/table_builder_helper.rb:110:in `block (2 levels) in tbody'
      app/helpers/table_builder_helper.rb:108:in `block in tbody'
      app/helpers/table_builder_helper.rb:107:in `tbody'
      app/helpers/table_builder_helper.rb:72:in `table_builder_2'
      app/views/referential_networks/index.html.slim:25:in `_app_views_referential_networks_index_html_slim___1557411244315414919_70366016986820'
      app/controllers/referential_networks_controller.rb:27:in `index'

      Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.8ms)
      Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (2.5ms)
      Rendered .../lib/ruby/gems/2.3.0/gems/actionpack-4.2.8/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb (76.0ms)

on the following pages:

- http://stif-boiv.dev:3000/referentials/4/time_tables
- http://stif-boiv.dev:3000/line_referentials/1/companies
- http://stif-boiv.dev:3000/line_referentials/1/networks
- http://stif-boiv.dev:3000/referentials/4/companies
- http://stif-boiv.dev:3000/referentials/4/networks

This was caused by the request of a JS-formatted view that rendered the
HTML template, since the collection decoration only happened in the HTML
format section.

Do the decoration in both the HTML format and JS format for the relevant
controllers in order to eliminate this error.

Maybe there's a cleaner way to do this than just duplicating the
decoration in both `format.X` blocks, but I don't know of it. Wanted to
make sure not to decorate when it wasn't necessary, like when rendering
other formats (XML, etc.).

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