aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcedricnjanga2018-03-08 20:43:38 -0800
committerAlban Peignier2018-03-15 10:01:30 +0100
commit5227184b20e720d6643802b187a4c07c692283cb (patch)
tree274bf2747941d9cd4535a448875778cf558ad413
parent0a81b6a94eeabe481e0ef7473a13b1847539adb5 (diff)
downloadchouette-core-5227184b20e720d6643802b187a4c07c692283cb.tar.bz2
Refs #6033 Update activate and deactivate methods
-rw-r--r--app/models/chouette/stop_area.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb
index 0a27b2f39..d9d2facfe 100644
--- a/app/models/chouette/stop_area.rb
+++ b/app/models/chouette/stop_area.rb
@@ -383,26 +383,30 @@ module Chouette
end
def activated?
- deleted_at.nil?
+ deleted_at.nil? && confirmed_at
end
def deactivated?
- !activated?
+ deleted_at && confirmed_at.nil?
end
def activate
+ self.confirmed_at = Time.now
self.deleted_at = nil
end
def deactivate
+ self.confirmed_at = nil
self.deleted_at = Time.now
end
def activate!
+ update_attribute :confirmed_at, Time.now
update_attribute :deleted_at, nil
end
def deactivate!
+ update_attribute :confirmed_at, nil
update_attribute :deleted_at, Time.now
end