aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/api/v1/api_key.rb1
-rw-r--r--app/models/calendar.rb2
-rw-r--r--app/models/chouette/access_link.rb7
-rw-r--r--app/models/chouette/access_point.rb4
-rw-r--r--app/models/chouette/company.rb3
-rw-r--r--app/models/chouette/connection_link.rb3
-rw-r--r--app/models/chouette/group_of_line.rb3
-rw-r--r--app/models/chouette/journey_pattern.rb1
-rw-r--r--app/models/chouette/line.rb1
-rw-r--r--app/models/chouette/network.rb2
-rw-r--r--app/models/chouette/pt_link.rb4
-rw-r--r--app/models/chouette/route.rb4
-rw-r--r--app/models/chouette/routing_constraint_zone.rb3
-rw-r--r--app/models/chouette/stop_area.rb4
-rw-r--r--app/models/chouette/stop_point.rb4
-rw-r--r--app/models/chouette/time_table.rb4
-rw-r--r--app/models/chouette/timeband.rb4
-rw-r--r--app/models/chouette/vehicle_journey.rb1
-rw-r--r--app/models/compliance_check_set.rb1
-rw-r--r--app/models/compliance_control_set.rb1
-rw-r--r--app/models/concerns/default_attributes_support.rb1
-rw-r--r--app/models/dashboard.rb5
22 files changed, 40 insertions, 23 deletions
diff --git a/app/models/api/v1/api_key.rb b/app/models/api/v1/api_key.rb
index 767e65f3a..09c6f77ac 100644
--- a/app/models/api/v1/api_key.rb
+++ b/app/models/api/v1/api_key.rb
@@ -1,6 +1,7 @@
module Api
module V1
class ApiKey < ::ActiveRecord::Base
+ has_paper_trail
before_create :generate_access_token
belongs_to :referential, :class_name => '::Referential'
belongs_to :organisation, :class_name => '::Organisation'
diff --git a/app/models/calendar.rb b/app/models/calendar.rb
index bb38e74df..b2e73929f 100644
--- a/app/models/calendar.rb
+++ b/app/models/calendar.rb
@@ -3,7 +3,7 @@ require_relative 'calendar/date_value'
require_relative 'calendar/period'
class Calendar < ActiveRecord::Base
-
+ has_paper_trail
belongs_to :organisation
has_many :time_tables
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 afb3e3571..784e3f5b9 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
diff --git a/app/models/chouette/network.rb b/app/models/chouette/network.rb
index f0a79ec13..9b3f2fe29 100644
--- a/app/models/chouette/network.rb
+++ b/app/models/chouette/network.rb
@@ -1,12 +1,12 @@
module Chouette
class Network < Chouette::ActiveRecord
+ has_paper_trail
include NetworkRestrictions
include LineReferentialSupport
include ObjectidSupport
extend Enumerize
# FIXME http://jira.codehaus.org/browse/JRUBY-6358
self.primary_key = "id"
-
has_many :lines
attr_accessor :source_type_name
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 d7a660287..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
diff --git a/app/models/compliance_check_set.rb b/app/models/compliance_check_set.rb
index 80e499b74..00cf057f4 100644
--- a/app/models/compliance_check_set.rb
+++ b/app/models/compliance_check_set.rb
@@ -1,5 +1,6 @@
class ComplianceCheckSet < ActiveRecord::Base
extend Enumerize
+ has_paper_trail
belongs_to :referential
belongs_to :compliance_control_set
diff --git a/app/models/compliance_control_set.rb b/app/models/compliance_control_set.rb
index deb46f5a1..41076fefc 100644
--- a/app/models/compliance_control_set.rb
+++ b/app/models/compliance_control_set.rb
@@ -1,4 +1,5 @@
class ComplianceControlSet < ActiveRecord::Base
+ has_paper_trail
belongs_to :organisation
has_many :compliance_control_blocks, dependent: :destroy
has_many :compliance_controls, dependent: :destroy
diff --git a/app/models/concerns/default_attributes_support.rb b/app/models/concerns/default_attributes_support.rb
index e85a59160..2ef9149cb 100644
--- a/app/models/concerns/default_attributes_support.rb
+++ b/app/models/concerns/default_attributes_support.rb
@@ -47,7 +47,6 @@ module DefaultAttributesSupport
else
self.object_version += 1
end
- self.creator_id = 'chouette'
end
def reset_auto_columns
diff --git a/app/models/dashboard.rb b/app/models/dashboard.rb
index a53267db5..46c621266 100644
--- a/app/models/dashboard.rb
+++ b/app/models/dashboard.rb
@@ -11,8 +11,11 @@ class Dashboard
@@default_class = self
mattr_accessor :default_class
- attr_reader :context
+ def self.model_name
+ ActiveModel::Name.new Dashboard, Dashboard, "Dashboard"
+ end
+ attr_reader :context
def initialize(context)
@context = context
end