diff options
| author | Xinhui | 2017-11-21 16:34:16 +0100 | 
|---|---|---|
| committer | Xinhui | 2017-11-28 12:18:26 +0100 | 
| commit | 3a9cc46e7cf705df7cdb8fb7c19daa8165ead33d (patch) | |
| tree | f654b07785e6da230719b1de65d001bc35e79b25 /app/models/chouette | |
| parent | 8aa230271ec6f0cd578e479c42d95418cb9408c3 (diff) | |
| download | chouette-core-3a9cc46e7cf705df7cdb8fb7c19daa8165ead33d.tar.bz2 | |
Add paper_trail to models
Diffstat (limited to 'app/models/chouette')
| -rw-r--r-- | app/models/chouette/access_link.rb | 7 | ||||
| -rw-r--r-- | app/models/chouette/access_point.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/company.rb | 3 | ||||
| -rw-r--r-- | app/models/chouette/connection_link.rb | 3 | ||||
| -rw-r--r-- | app/models/chouette/group_of_line.rb | 3 | ||||
| -rw-r--r-- | app/models/chouette/journey_pattern.rb | 1 | ||||
| -rw-r--r-- | app/models/chouette/line.rb | 3 | ||||
| -rw-r--r-- | app/models/chouette/network.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/pt_link.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/route.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/routing_constraint_zone.rb | 3 | ||||
| -rw-r--r-- | app/models/chouette/stop_area.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/stop_point.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/time_table.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/timeband.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/vehicle_journey.rb | 3 | 
16 files changed, 35 insertions, 23 deletions
| diff --git a/app/models/chouette/access_link.rb b/app/models/chouette/access_link.rb index 46fbcb631..4b99ab5ba 100644 --- a/app/models/chouette/access_link.rb +++ b/app/models/chouette/access_link.rb @@ -1,5 +1,6 @@  module Chouette    class AccessLink < Chouette::TridentActiveRecord +    has_paper_trail      include ObjectidSupport      # FIXME http://jira.codehaus.org/browse/JRUBY-6358      self.primary_key = "id" @@ -50,11 +51,11 @@ module Chouette      def link_key        Chouette::AccessLink.build_link_key(access_point,stop_area,link_orientation_type)      end -     +      def self.build_link_key(access_point,stop_area,link_orientation_type)        if link_orientation_type == "access_point_to_stop_area"          "A_#{access_point.id}-S_#{stop_area.id}" -      else   +      else          "S_#{stop_area.id}-A_#{access_point.id}"        end      end @@ -63,4 +64,4 @@ module Chouette        Chouette::Geometry::AccessLinkPresenter.new self      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/access_point.rb b/app/models/chouette/access_point.rb index 7757fdcfb..7428db1ea 100644 --- a/app/models/chouette/access_point.rb +++ b/app/models/chouette/access_point.rb @@ -1,8 +1,10 @@  require 'geokit'  require 'geo_ruby' +  module Chouette    class AccessPoint < Chouette::ActiveRecord +    has_paper_trail      # FIXME http://jira.codehaus.org/browse/JRUBY-6358      self.primary_key = "id" @@ -167,4 +169,4 @@ module Chouette        Chouette::Geometry::AccessPointPresenter.new self      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/company.rb b/app/models/chouette/company.rb index d79e5ff59..12b21e347 100644 --- a/app/models/chouette/company.rb +++ b/app/models/chouette/company.rb @@ -3,6 +3,7 @@ module Chouette      include CompanyRestrictions      include LineReferentialSupport      include ObjectidSupport +    has_paper_trail      has_many :lines @@ -16,4 +17,4 @@ module Chouette    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/connection_link.rb b/app/models/chouette/connection_link.rb index d19b53974..d5ddc606a 100644 --- a/app/models/chouette/connection_link.rb +++ b/app/models/chouette/connection_link.rb @@ -1,5 +1,6 @@  module Chouette    class ConnectionLink < Chouette::TridentActiveRecord +    has_paper_trail      include ObjectidSupport      include ConnectionLinkRestrictions      # FIXME http://jira.codehaus.org/browse/JRUBY-6358 @@ -47,4 +48,4 @@ module Chouette      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/group_of_line.rb b/app/models/chouette/group_of_line.rb index 3023d23ed..75ee1ce73 100644 --- a/app/models/chouette/group_of_line.rb +++ b/app/models/chouette/group_of_line.rb @@ -1,5 +1,6 @@  module Chouette    class GroupOfLine < Chouette::ActiveRecord +    has_paper_trail      include ObjectidSupport      include GroupOfLineRestrictions      include LineReferentialSupport @@ -30,4 +31,4 @@ module Chouette      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/journey_pattern.rb b/app/models/chouette/journey_pattern.rb index c1f9fb4f8..a62da6353 100644 --- a/app/models/chouette/journey_pattern.rb +++ b/app/models/chouette/journey_pattern.rb @@ -1,5 +1,6 @@  module Chouette    class JourneyPattern < Chouette::TridentActiveRecord +    has_paper_trail      include ChecksumSupport      include JourneyPatternRestrictions      include ObjectidSupport diff --git a/app/models/chouette/line.rb b/app/models/chouette/line.rb index 8d5ff5f60..16d7ec6f6 100644 --- a/app/models/chouette/line.rb +++ b/app/models/chouette/line.rb @@ -1,5 +1,6 @@  module Chouette    class Line < Chouette::ActiveRecord +    has_paper_trail      include LineRestrictions      include LineReferentialSupport      include ObjectidSupport @@ -79,4 +80,4 @@ module Chouette      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/network.rb b/app/models/chouette/network.rb index 3f07ebe0c..d64ef038a 100644 --- a/app/models/chouette/network.rb +++ b/app/models/chouette/network.rb @@ -1,11 +1,11 @@  module Chouette    class Network < Chouette::ActiveRecord +    has_paper_trail      include NetworkRestrictions      include LineReferentialSupport      include ObjectidSupport      # FIXME http://jira.codehaus.org/browse/JRUBY-6358      self.primary_key = "id" -      has_many :lines      attr_accessor :source_type_name @@ -47,4 +47,4 @@ module Chouette    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/pt_link.rb b/app/models/chouette/pt_link.rb index 5bf77da02..d14d5f29c 100644 --- a/app/models/chouette/pt_link.rb +++ b/app/models/chouette/pt_link.rb @@ -2,9 +2,9 @@ require 'geokit'  module Chouette    class PtLink < Chouette::ActiveRecord +    has_paper_trail      # FIXME http://jira.codehaus.org/browse/JRUBY-6358      self.primary_key = "id" -      include Geokit::Mappable      def geometry @@ -34,4 +34,4 @@ module Chouette        end      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/route.rb b/app/models/chouette/route.rb index 1f4088aa7..5c0ad24a1 100644 --- a/app/models/chouette/route.rb +++ b/app/models/chouette/route.rb @@ -1,5 +1,7 @@ +  module Chouette    class Route < Chouette::TridentActiveRecord +    has_paper_trail      include RouteRestrictions      include ChecksumSupport      include ObjectidSupport @@ -190,4 +192,4 @@ module Chouette      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/routing_constraint_zone.rb b/app/models/chouette/routing_constraint_zone.rb index 70b016a48..fcf47f154 100644 --- a/app/models/chouette/routing_constraint_zone.rb +++ b/app/models/chouette/routing_constraint_zone.rb @@ -1,5 +1,6 @@  module Chouette    class RoutingConstraintZone < Chouette::TridentActiveRecord +    has_paper_trail      include ChecksumSupport      include ObjectidSupport @@ -43,4 +44,4 @@ module Chouette        route.name      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb index 5d8b5033f..cc7170728 100644 --- a/app/models/chouette/stop_area.rb +++ b/app/models/chouette/stop_area.rb @@ -1,8 +1,8 @@  require 'geokit'  require 'geo_ruby' -  module Chouette    class StopArea < Chouette::ActiveRecord +    has_paper_trail      include ProjectionFields      include StopAreaRestrictions      include StopAreaReferentialSupport @@ -325,4 +325,4 @@ module Chouette      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb index f4c9b3800..3b9eaa2f6 100644 --- a/app/models/chouette/stop_point.rb +++ b/app/models/chouette/stop_point.rb @@ -1,6 +1,6 @@  module Chouette    class StopPoint < Chouette::TridentActiveRecord - +    has_paper_trail      def self.policy_class        RoutePolicy      end @@ -57,4 +57,4 @@ module Chouette        Chouette::StopArea.where(:area_type => ['Quay', 'BoardingPosition'])      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/time_table.rb b/app/models/chouette/time_table.rb index 09d3e2244..74c20f061 100644 --- a/app/models/chouette/time_table.rb +++ b/app/models/chouette/time_table.rb @@ -1,11 +1,11 @@  module Chouette    class TimeTable < Chouette::TridentActiveRecord +    has_paper_trail      include ChecksumSupport      include TimeTableRestrictions      include ObjectidSupport      # FIXME http://jira.codehaus.org/browse/JRUBY-6358      self.primary_key = "id" -      acts_as_taggable      attr_accessor :monday,:tuesday,:wednesday,:thursday,:friday,:saturday,:sunday @@ -570,4 +570,4 @@ module Chouette        tt      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/timeband.rb b/app/models/chouette/timeband.rb index 21c81ab1c..6155ffc77 100644 --- a/app/models/chouette/timeband.rb +++ b/app/models/chouette/timeband.rb @@ -9,7 +9,7 @@ module Chouette    class Timeband < Chouette::TridentActiveRecord      include ObjectidSupport - +    has_paper_trail      self.primary_key = "id"      validates :start_time, :end_time, presence: true @@ -26,4 +26,4 @@ module Chouette        "#{self.name} (#{fullname})" if self.name      end    end -end
\ No newline at end of file +end diff --git a/app/models/chouette/vehicle_journey.rb b/app/models/chouette/vehicle_journey.rb index 329b37a6c..247c30668 100644 --- a/app/models/chouette/vehicle_journey.rb +++ b/app/models/chouette/vehicle_journey.rb @@ -1,5 +1,6 @@  module Chouette    class VehicleJourney < Chouette::TridentActiveRecord +    has_paper_trail      include ChecksumSupport      include VehicleJourneyRestrictions      include ObjectidSupport @@ -304,4 +305,4 @@ module Chouette          .where('"time_tables_vehicle_journeys"."vehicle_journey_id" IS NULL')      end    end -end
\ No newline at end of file +end | 
