diff options
| author | Teddy Wing | 2017-06-09 14:55:30 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-06-09 15:26:44 +0200 |
| commit | ca10698f263dad9298b001e9194c4e042c1a9cff (patch) | |
| tree | e8f52d0c5fb36bc2f1838534439bcdff6ac1fc30 | |
| parent | 74e02b7666efda81344728c3f7a27039db96f830 (diff) | |
| download | chouette-core-ca10698f263dad9298b001e9194c4e042c1a9cff.tar.bz2 | |
TableBuilderHelper: Change `or` to `||`
For better style and logical operator precedence, use `||` instead of
the `or` operator.
Refs #3479
| -rw-r--r-- | app/helpers/table_builder_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb index 0a32e528c..01f356217 100644 --- a/app/helpers/table_builder_helper.rb +++ b/app/helpers/table_builder_helper.rb @@ -80,18 +80,18 @@ module TableBuilderHelper item.try(attribute) end # if so this column's contents get transformed into a link to the object - if attribute == 'name' or attribute == 'comment' + if attribute == 'name' || attribute == 'comment' lnk = [] # #is_a? ? ; or ? - unless item.class == Calendar or item.class == Referential + unless item.class == Calendar || item.class == Referential if current_referential lnk << current_referential lnk << item.line if item.respond_to? :line lnk << item.route.line if item.class == Chouette::RoutingConstraintZone lnk << item if item.respond_to? :line_referential lnk << item.stop_area if item.respond_to? :stop_area - lnk << item if item.respond_to? :stop_points or item.class.to_s == 'Chouette::TimeTable' + lnk << item if item.respond_to? :stop_points || item.class.to_s == 'Chouette::TimeTable' elsif item.respond_to? :referential lnk << item.referential end @@ -126,14 +126,14 @@ module TableBuilderHelper polymorph_url << action end - unless item.class == Calendar or item.class == Referential + unless item.class == Calendar || item.class == Referential if current_referential polymorph_url << current_referential polymorph_url << item.line if item.respond_to? :line polymorph_url << item.route.line if item.class == Chouette::RoutingConstraintZone polymorph_url << item if item.respond_to? :line_referential polymorph_url << item.stop_area if item.respond_to? :stop_area - polymorph_url << item if item.respond_to? :stop_points or item.class.to_s == 'Chouette::TimeTable' + polymorph_url << item if item.respond_to? :stop_points || item.class.to_s == 'Chouette::TimeTable' elsif item.respond_to? :referential polymorph_url << item.referential end |
