swissmatch-rails 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/swissmatch/activerecord.rb +5 -4
- data/lib/swissmatch/rails/version.rb +1 -1
- data/swissmatch-rails.gemspec +1 -1
- metadata +10 -12
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3f083d0b2f7fd6fca745c7c169bd41f04638a75b
|
4
|
+
data.tar.gz: bd8a96843cf0829e8434ebc5342bbcbc8fd625f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 74dcd70500ca4dac2f53a298cb4d7fc6897104b396d96b33a1209c0f2d03617560f752a9320c681a7832980329a7a4298d886235af4619c081db341d69bda604
|
7
|
+
data.tar.gz: 4c2c68b66953202043915308d55cda27de1317a4f4296d62d45be2b0c8579b9dbcb0ff2492b1a159d099822b9953fcb41119e6cdf7d38ad2fe34404112aa99ac
|
@@ -61,20 +61,21 @@ module SwissMatch
|
|
61
61
|
|
62
62
|
cursor_hidden do
|
63
63
|
print_progress(progress, total)
|
64
|
+
without_protection = ::ActiveRecord::Base.respond_to?(:attr_accessible) ? [{:without_protection => true}] : []
|
64
65
|
|
65
66
|
::ActiveRecord::Base.transaction do
|
66
67
|
delete_all
|
67
68
|
print_progress(progress+=10, total)
|
68
69
|
|
69
70
|
data_source.cantons.each do |canton|
|
70
|
-
canton2id[canton.license_tag] = SwissMatch::ActiveRecord::Canton.create!(canton.to_hash,
|
71
|
+
canton2id[canton.license_tag] = SwissMatch::ActiveRecord::Canton.create!(canton.to_hash, *without_protection).id
|
71
72
|
print_progress(progress+=1, total)
|
72
73
|
end
|
73
74
|
data_source.communities.partition do |community|
|
74
75
|
hash = community.to_hash
|
75
76
|
hash[:canton_id] = canton2id[hash.delete(:canton)]
|
76
77
|
hash[:agglomeration_id] = hash.delete(:agglomeration)
|
77
|
-
SwissMatch::ActiveRecord::Community.create!(hash,
|
78
|
+
SwissMatch::ActiveRecord::Community.create!(hash, *without_protection)
|
78
79
|
print_progress(progress+=1, total)
|
79
80
|
end
|
80
81
|
self_delivered, others = data_source.zip_codes.partition { |code| code.delivery_by.nil? || code.delivery_by == code }
|
@@ -100,13 +101,13 @@ module SwissMatch
|
|
100
101
|
hash.delete(:valid_until)
|
101
102
|
hash[:active] = true
|
102
103
|
|
103
|
-
SwissMatch::ActiveRecord::ZipCode.create!(hash,
|
104
|
+
SwissMatch::ActiveRecord::ZipCode.create!(hash, *without_protection)
|
104
105
|
zip_code.names.each do |name|
|
105
106
|
hash = name.to_hash
|
106
107
|
hash[:language] = LanguageToCode[hash.delete(:language)]
|
107
108
|
hash[:zip_code_id] = zip_code.ordering_number
|
108
109
|
hash[:designation] = 2 # designation of type 3 is not currently in the system
|
109
|
-
SwissMatch::ActiveRecord::ZipCodeName.create!(hash,
|
110
|
+
SwissMatch::ActiveRecord::ZipCodeName.create!(hash, *without_protection)
|
110
111
|
end
|
111
112
|
print_progress(progress+=2, total)
|
112
113
|
end
|
data/swissmatch-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swissmatch-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.0.4
|
4
|
+
version: 0.0.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Stefan Rusterholz
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-10-29 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Adds ActiveRecord models and javascript assets for rails to swissmatch.
|
15
14
|
email: stefan.rusterholz@gmail.com
|
@@ -18,35 +17,34 @@ executables:
|
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|
20
|
+
- LICENSE.txt
|
21
|
+
- README.markdown
|
22
|
+
- Rakefile
|
21
23
|
- bin/swissmatch_db
|
22
24
|
- lib/swissmatch/activerecord.rb
|
23
|
-
- lib/swissmatch/rails/version.rb
|
24
25
|
- lib/swissmatch/rails.rb
|
26
|
+
- lib/swissmatch/rails/version.rb
|
25
27
|
- swissmatch-rails.gemspec
|
26
|
-
- LICENSE.txt
|
27
|
-
- Rakefile
|
28
|
-
- README.markdown
|
29
28
|
homepage: http://github.com/apeiros/swissmatch-rails
|
30
29
|
licenses: []
|
30
|
+
metadata: {}
|
31
31
|
post_install_message:
|
32
32
|
rdoc_options: []
|
33
33
|
require_paths:
|
34
34
|
- lib
|
35
35
|
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
36
|
requirements:
|
38
|
-
- -
|
37
|
+
- - ">="
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '0'
|
41
40
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
41
|
requirements:
|
44
|
-
- -
|
42
|
+
- - ">"
|
45
43
|
- !ruby/object:Gem::Version
|
46
44
|
version: 1.3.1
|
47
45
|
requirements: []
|
48
46
|
rubyforge_project:
|
49
|
-
rubygems_version:
|
47
|
+
rubygems_version: 2.4.5.1
|
50
48
|
signing_key:
|
51
49
|
specification_version: 3
|
52
50
|
summary: Adds ActiveRecord models and javascript assets for rails to swissmatch.
|