aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/chouette/line.rb
diff options
context:
space:
mode:
authorGuillaume2017-11-09 15:20:54 +0100
committerGuillaume2017-11-09 15:21:01 +0100
commitaafda8b5d8e6dbd80ed56fd469d5ada5dceb3a67 (patch)
tree6e63632be099a8a86fcca69bcc2814efbff57c0a /app/models/chouette/line.rb
parent4dbe0a7b5acf4e244016d58d59a96aca36035263 (diff)
downloadchouette-core-aafda8b5d8e6dbd80ed56fd469d5ada5dceb3a67.tar.bz2
add object_id_format to migrations, create module for call Referential, Line Referential, StopAreaReferential in models, add Enumerize in models Refs #4941
Diffstat (limited to 'app/models/chouette/line.rb')
-rw-r--r--app/models/chouette/line.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb
index 0139bb6a4..ba48068c9 100644
--- a/app/models/chouette/line.rb
+++ b/app/models/chouette/line.rb
@@ -2,6 +2,7 @@ class Chouette::Line < Chouette::ActiveRecord
include StifCodifligneAttributesSupport
include LineRestrictions
include LineReferentialSupport
+ include ObjectIdFormat
extend StifTransportModeEnumerations
extend StifTransportSubmodeEnumerations
@@ -39,6 +40,8 @@ class Chouette::Line < Chouette::ActiveRecord
validates_presence_of :name
+ alias_method :line_referential, :referential
+
scope :by_text, ->(text) { where('lower(name) LIKE :t or lower(published_name) LIKE :t or lower(objectid) LIKE :t or lower(comment) LIKE :t or lower(number) LIKE :t',
t: "%#{text.downcase}%") }