carload 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a049222076a6d7c860613fca9fdcb808f9d3a1fd
4
- data.tar.gz: 027d10be270a76dce7187702c936139d6bec61ea
3
+ metadata.gz: d5d1d3a7f3e97896ff9b45fa30f927c1a756c296
4
+ data.tar.gz: 46caa37af3202cadadf73b9fc0bdaaab897fd836
5
5
  SHA512:
6
- metadata.gz: eceb767f554ce9e7cc34b543764485beb0dcc925a70aae2eea3ebdf2d17688e3518a1f2c0083d3dbdc827b370d113314ce47bb78e7a10846cafeadcd6b6615b4
7
- data.tar.gz: 2421d62bdd80071fb5bd7f41e13829b125d286f4c4315c54f8db465293e82cb614b67e24647cca9d582dfb27277ab86a83edc282474c7dd378972e0b8ebef63b
6
+ metadata.gz: 3f34d338ed639ed46ffdd1a12b88a5a1968db40000e570342ac3918e550238408a4d5cd44501fab8c2f51546aeb8cd8af6134397ce6301a0164773ccdaedbb19
7
+ data.tar.gz: 7d3d656a076f377364a49ff78aa853108a7369f95ca43e1aab7ef3d8604ada87e7156379a404c28215ee38077f9f6511432aac80a88ba72a413c8aec9a7ea291
@@ -53,23 +53,23 @@ module Carload
53
53
  }
54
54
  end
55
55
  end
56
- # Reopen model classes to handle polymorphic association.
57
- Dashboard.models.each do |name, spec|
58
- spec.associated_models.values.select { |x| x[:polymorphic] == true }.each do |associated_model|
59
- polymorphic_objects = []
60
- associated_model[:instance_models].each do |instance_model|
61
- Dashboard.model(instance_model).klass.all.each do |object|
62
- polymorphic_objects << ["#{object.class} - #{object.send(associated_model[:choose_by])}", "#{object.id},#{object.class}"]
63
- end
64
- end
65
- spec.klass.class_eval do
66
- class_eval <<-RUBY
67
- def self.#{associated_model[:name].to_s.pluralize}
68
- #{polymorphic_objects}
69
- end
70
- RUBY
56
+ end
57
+ # Reopen model classes to handle polymorphic association.
58
+ Dashboard.models.each do |name, spec|
59
+ spec.associated_models.values.select { |x| x[:polymorphic] == true }.each do |associated_model|
60
+ polymorphic_objects = []
61
+ associated_model[:instance_models].each do |instance_model|
62
+ Dashboard.model(instance_model).klass.all.each do |object|
63
+ polymorphic_objects << ["#{object.class} - #{object.send(associated_model[:choose_by])}", "#{object.id},#{object.class}"]
71
64
  end
72
65
  end
66
+ spec.klass.class_eval do
67
+ class_eval <<-RUBY
68
+ def self.#{associated_model[:name].to_s.pluralize}
69
+ #{polymorphic_objects}
70
+ end
71
+ RUBY
72
+ end
73
73
  end
74
74
  end
75
75
  end
@@ -1,3 +1,3 @@
1
1
  module Carload
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Li Dong