aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/line.rb
AgeCommit message (Collapse)Author
2018-04-24Refs #6431 small changes on line & stop area statuscedricnjanga
2018-04-10Merge pull request #438 from af83/6368-gtfs-importLuc Donnet
GTFS import (first step)
2018-04-09Refs #6367; Add metadata to other versioned modelsZog
2018-04-03Remove hardcoded format on line/stop_area/company registration_numbers ↵Alban Peignier
(blocks GTFS imports). Refs #6368
2018-03-29Refs #4658; Remove `current_functional_scope`Zog
2018-03-23Fix i18n enhancements on titles @3Luc Donnet
2018-03-07Chouette::Line#by_name: Use `LEFT OUTER JOIN` on "companies"Teddy Wing
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
2018-03-07AutocompleteLines: Sanitize `:q` param in `LIKE` operatorTeddy Wing
Johan made a number of good points here: > * I think this belongs in the model > * I would rather use a named parameter here > `.where('lines.number LIKE :q OR lines.names LIKE :q ...', q: > "%#{params[:q]}%")` > * You should defiitely escape the params before passing it to your db. > `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
2018-03-05Remove primary_key overriding in models. Refs #6112Alban Peignier
2018-02-20Refs #5924; Remove `local_id` methodsZog
2018-02-20Refs #5924 @14h; Extend importersZog
Mostly add a way to override the default behaviour and process each row its own way
2018-02-20Refs #5924 @2h; Update specsZog
2018-01-16Fix access to public.versions table for Line, StopArea, Network and company ↵Luc Donnet
models Refs #5605 @2
2018-01-05Add Line#time_tables. Refs #5299Alban Peignier
2017-12-21Refs #5430 @2h; Deactivate lines instead of destroying themZog
- Add `activate` and `deactivate` actions in `LinesController`, as well as corresponding routes - Add `activate!` and `deactivate!` methods in `Chouette::Line`, as well as `activated?` - Add `activate?` and `deactivate?` permissions in `LinePolicy` - Add corresponding `action_links`in the Decorator - Create helper for these actions - Add an optional `'extra_class` to the Links - Update styles for ".delete-action" to handle the case where there are several - Add I18n keys accordingly
2017-12-13Refs #5112 : Referential#createcedricnjanga
=> Only display the short_id of lines objetids for better UI
2017-11-30Merge branch 'master' into 4981_last_editorXinhui Xu
2017-11-28Add paper_trail to modelsXinhui
2017-11-23Merge branch 'master' into 4824-create_line_referentialsGuillaume
2017-11-22Fix transport modes and submodes modulescedricnjanga
Fix Compliance Control Set flotted links to display on show page
2017-11-22Refs #4941 remove object_id_format_to_line_referential module, include just ↵Guillaume
a object_id_format_to_referential module
2017-11-22add object_id_format to migrations, create module for call Referential, Line ↵Guillaume
Referential, StopAreaReferential in models, add Enumerize in models Refs #4941
2017-11-21Change the way we name classescedricnjanga
We now always use modules for namespaces => same structure for models, decorators, policies...
2017-11-17Add some changes to the objectid constructioncedricnjanga
2017-11-16Add Cédric new objectid concernscedricnjanga
objectid_support handles reading and writing object_ids objectid_formater_support gets the right formater class include these concerns in chouette models Remove StifNetexAttributSupport modules because these are handled by the new objectid concerns Add a objectid and formater classes for each format type Add objectid formats to the factories Modify somes specs for object_ids but there are still a number of failling tests
2017-11-16Refs #4941 remove object_id_format_to_line_referential module, include just ↵Guillaume
a object_id_format_to_referential module
2017-11-09split modules objectid_format, remove alias referentialGuillaume
2017-11-09add object_id_format to migrations, create module for call Referential, Line ↵Guillaume
Referential, StopAreaReferential in models, add Enumerize in models Refs #4941
2017-10-02Fix transport mode and submode modulescedricnjanga
2017-09-29Refs Adapt transport mode & submode translationscedricnjanga
2017-07-25StifCodifligneAttributesSupport for Line objectidXinhui
2017-05-11Fix Line display_name should display short name aka number..Xinhui
Refs #3353
2017-04-28Fix Line full_name should display objectid.local_idXinhui
Refs #3081
2017-04-11Refs #3094: Fix select2 in edit display primary and secondary operatorsThomas Haddad
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
2017-04-05Refs #3036 : Associate RoutingConstraintZone with Route and not LineVlatka Pavisic
2017-02-03Lines has_array_of secondary_companiesXinhui
Refs #2490
2016-12-12Refs #1955 : RoutingConstraintZonevlatka pavisic
2016-11-20Sort lines and use display name (with company name when available). Refs #1997Alban Peignier
2016-11-19Fix transport mode display in both views referential_lines and lines Refs #1974Luc Donnet
2016-11-18Refs #1974 : Refactor Line transport modevlatka pavisic
2016-11-18Refs #1977: Add transport_submode enum. on lines#showjpl
2016-11-17Refs #1939 : Create Line by_text scopevlatka pavisic
2016-10-20Set referential_metadata periodes as array + templating formXinhui
Refs #1782
2016-10-19Model ReferentialMetadataXinhui
Refs #1782
2016-10-14Remove validate presence of company for Line modelXinhui
Refs #1814
2016-09-28disable network presence validation for liens. Refs #1736.Edouard Maffert
2016-09-21validate presence of network and companies for linesEdouard Maffert
2016-07-28Add netex_object_id and default_netex_object_id for codifligne objectid formatEdouard Maffert
2016-05-13Disable mandatory Network and Company by waiting associated referential ↵Alban Peignier
refactoring. Refs #825
2016-05-13Refactor models and controllers to manage Lines in LineReferential. Refs #825Alban Peignier