diff options
| author | cedricnjanga | 2017-11-22 00:15:30 +0100 | 
|---|---|---|
| committer | cedricnjanga | 2017-11-22 00:15:30 +0100 | 
| commit | 5489c9482cb8658b8540da2b46bfd28f321d866e (patch) | |
| tree | f1b1cdff940319c1b60879a23b232ecd9d4e9284 /app/models/chouette | |
| parent | 763010ced3202c99f705562a373861f926aad9a1 (diff) | |
| download | chouette-core-5489c9482cb8658b8540da2b46bfd28f321d866e.tar.bz2 | |
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)
Diffstat (limited to 'app/models/chouette')
| -rw-r--r-- | app/models/chouette/active_record.rb | 4 | ||||
| -rw-r--r-- | app/models/chouette/stop_point.rb | 2 | ||||
| -rw-r--r-- | app/models/chouette/timeband.rb | 2 | 
3 files changed, 7 insertions, 1 deletions
| 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 | 
