From 5489c9482cb8658b8540da2b46bfd28f321d866e Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Wed, 22 Nov 2017 00:15:30 +0100 Subject: Fix the delation of the hacking of Chouette::ActiveRecord#model_name to remove the Chouette namespace off of the construction of link in the app and in other places. Added a small change in the reflex sync to set the stop_area_referential in the initialization of the object to be in sync with the work on the objectids (need a objectid_formatter) --- app/models/chouette/active_record.rb | 4 ++++ app/models/chouette/stop_point.rb | 2 +- app/models/chouette/timeband.rb | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'app/models/chouette') diff --git a/app/models/chouette/active_record.rb b/app/models/chouette/active_record.rb index e12f30266..c2aab9d50 100644 --- a/app/models/chouette/active_record.rb +++ b/app/models/chouette/active_record.rb @@ -24,6 +24,10 @@ module Chouette end end + def self.model_name + ActiveModel::Name.new self, Chouette, self.name.demodulize + end + # TODO: Can we remove this? # class << self # alias_method :create_reflection_without_chouette_naming, :create_reflection diff --git a/app/models/chouette/stop_point.rb b/app/models/chouette/stop_point.rb index 86be39d70..f4c9b3800 100644 --- a/app/models/chouette/stop_point.rb +++ b/app/models/chouette/stop_point.rb @@ -2,7 +2,7 @@ module Chouette class StopPoint < Chouette::TridentActiveRecord def self.policy_class - Chouette::RoutePolicy + RoutePolicy end include ForBoardingEnumerations diff --git a/app/models/chouette/timeband.rb b/app/models/chouette/timeband.rb index da8bc3dea..21c81ab1c 100644 --- a/app/models/chouette/timeband.rb +++ b/app/models/chouette/timeband.rb @@ -8,6 +8,8 @@ module Chouette end class Timeband < Chouette::TridentActiveRecord + include ObjectidSupport + self.primary_key = "id" validates :start_time, :end_time, presence: true -- cgit v1.2.3