ninoxe 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjI5NWI3ODA1YWU1ZDQyNGNlNmE5NGRiOWFlOWJhMTczYjk1MDA1OQ==
4
+ M2JhZTNmODI3ZDYwMDQyODJjZWVmNDVmZTU4ZTFjYmNlNjZlMmU5MA==
5
5
  data.tar.gz: !binary |-
6
- YjM0Nzg2MjNmMDI4YTM3NDJlNjY0ODkxNDAzMmRjMGIzODYzYTM5OQ==
6
+ YzZlYWNlOGIwMzE3ZDQwZGM3ZmU5YWNlODEzMWYyODNkZGUyYWQ2MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjA4M2E1NjkxMDg5Zjk2N2YwYjNlZGY0ZTZjYWU1NDZkNDIyNTQ2YTIyZTQ4
10
- MTJlOWRmMWM4YTFjNjc4YjUzNTNjZDdjMzQyYjUyYjJhMmNmMWQzN2Y0NDlh
11
- YzU3ZTM3NjczN2RkYTM4ZTk0YzQyYjExYWUxNTlkNzkyMWNiMzU=
9
+ ZjYzNWFmNjQ5Yzk1Njg2NzRjMWRhMTJjMzA0ZDZjZDc3MThjNzE1MzNhOTU2
10
+ NjM5NjE3ZWIyOWQyYTcyOTZmZGZjOWNjYWM2ZTRiZjA4YTAwZDA1NzhhNzU1
11
+ OWZkN2I0MWRjNmY1ZTU0MDFkOWE1MDM2MmE0ZDg1NzEwMjMxOTQ=
12
12
  data.tar.gz: !binary |-
13
- YWM1MmUwY2IwMmVkYmIxZjM1MGUxMjNkY2U4MWM5NTRhM2Y3ZWYwZjRlMDBm
14
- NjIzYmNlNjk4N2E1YWEwM2MwZjI5ZDdkYmRkNGY1ZWViNmY1NmY2Y2IzNGEz
15
- ZGU3ZTYzNTAwMTJlNjZiMjc4ZGM5YWI2YmMxMTQ3MTkxZGJmMzc=
13
+ OGZlN2JkNmQ0YjVjZmFlZDg1OTNhM2RiYzE1MjllYjhkM2Y0N2Q5NjY0OTBk
14
+ Njk1MzNkYzA0MzkyZmU2ZjFlOGEzODc0MGUzOTU3MjFlMjVkZTJiZWExYWE1
15
+ MDBlODk3ZGJiOTEzZjc5YjljNDA4Y2QwZTc5MDgyNDVlZTY1OGE=
@@ -17,8 +17,10 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord
17
17
 
18
18
  has_and_belongs_to_many :vehicle_journeys, :class_name => 'Chouette::VehicleJourney'
19
19
 
20
- has_many :dates, inverse_of: :time_table, :validate => :true, :class_name => "Chouette::TimeTableDate", :order => :date, :dependent => :destroy, :after_add => :shortcuts_update, :after_remove => :shortcuts_update
21
- has_many :periods, inverse_of: :time_table, :validate => :true, :class_name => "Chouette::TimeTablePeriod", :order => :period_start, :dependent => :destroy, :after_add => :shortcuts_update, :after_remove => :shortcuts_update
20
+ has_many :dates, inverse_of: :time_table, :validate => :true, :class_name => "Chouette::TimeTableDate", :order => :date, :dependent => :destroy
21
+ has_many :periods, inverse_of: :time_table, :validate => :true, :class_name => "Chouette::TimeTablePeriod", :order => :period_start, :dependent => :destroy
22
+
23
+ after_save :save_shortcuts
22
24
 
23
25
  def self.object_id_key
24
26
  "Timetable"
@@ -39,6 +41,12 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord
39
41
  [Chouette::TimeTable.maximum(:end_date)].compact.max
40
42
  end
41
43
 
44
+ def save_shortcuts
45
+ shortcuts_update
46
+ self.update_column(:start_date, start_date)
47
+ self.update_column(:end_date, end_date)
48
+ end
49
+
42
50
  def shortcuts_update(date=nil)
43
51
  dates_array = bounding_dates
44
52
  #if new_record?
@@ -8,14 +8,9 @@ class Chouette::TimeTableDate < Chouette::ActiveRecord
8
8
 
9
9
  attr_accessible :date, :position, :time_table_id, :time_table, :in_out
10
10
 
11
- after_update :update_parent
12
-
13
11
  def self.model_name
14
12
  ActiveModel::Name.new Chouette::TimeTableDate, Chouette, "TimeTableDate"
15
13
  end
16
14
 
17
- def update_parent
18
- time_table.shortcuts_update
19
- end
20
15
  end
21
16
 
@@ -10,7 +10,6 @@ class Chouette::TimeTablePeriod < Chouette::ActiveRecord
10
10
 
11
11
  validate :start_must_be_before_end
12
12
 
13
- after_update :update_parent
14
13
 
15
14
  def self.model_name
16
15
  ActiveModel::Name.new Chouette::TimeTablePeriod, Chouette, "TimeTablePeriod"
@@ -25,11 +24,7 @@ class Chouette::TimeTablePeriod < Chouette::ActiveRecord
25
24
  errors.add(:period_end,I18n.t("activerecord.errors.models.time_table_period.start_must_be_before_end"))
26
25
  end
27
26
  end
28
-
29
- def update_parent
30
- time_table.shortcuts_update
31
- end
32
-
27
+
33
28
  def copy
34
29
  Chouette::TimeTablePeriod.new(:period_start => self.period_start,:period_end => self.period_end)
35
30
  end
@@ -18,5 +18,6 @@ Factory.define :time_table, :class => "Chouette::TimeTable" do |time_table|
18
18
  start_date = start_date + 20
19
19
  end_date = start_date + 10
20
20
  end
21
+ t.save_shortcuts
21
22
  }
22
23
  end
@@ -1,3 +1,3 @@
1
1
  module Ninoxe
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninoxe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Florisson
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-11-14 00:00:00.000000000 Z
14
+ date: 2014-11-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: georuby-ext