geo_master_jp 0.2.2 → 0.2.4
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,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2adf0d403dd7b14a772f775f8ee461c050dfca447745b5664da5aa57f86e499f
|
4
|
+
data.tar.gz: 934272260c3f6ff3b07b526b1b5968dc07243f8ae8f565fdb8ec24ffa6b9d4cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e0bf8fbafda730c5deb16fdb6f8d73580f6bb61ad916346e3a36fcfabf0670cba16c792b83aa6db0d2655e4581b5a66efbfa2dd7afeb8de60d6a6424dff17e5
|
7
|
+
data.tar.gz: 6abdf06236ee8b4dd0c913f957d5c86c8e7a94d784a898db136b7dab56e55340b1e32487aea314fff3ec693d2325668c39f359dcd51ea383fe0837ba16d1e4cc
|
@@ -51,7 +51,7 @@ module GeoMasterJp
|
|
51
51
|
}, status: 400
|
52
52
|
end
|
53
53
|
|
54
|
-
stations = GeoMasterJp::Line.find_by(code: params[:line_code]).stations.
|
54
|
+
stations = GeoMasterJp::Line.find_by(code: params[:line_code]).stations.includes(:station_connections)
|
55
55
|
|
56
56
|
if params[:prefecture_code].present?
|
57
57
|
stations = stations.where(geo_master_jp_prefecture_code: params[:prefecture_code])
|
@@ -21,5 +21,11 @@ module GeoMasterJp
|
|
21
21
|
def town_select_options
|
22
22
|
self.towns.map{|town| [town.name, town.code] }
|
23
23
|
end
|
24
|
+
|
25
|
+
def town_grouped_select_options
|
26
|
+
self.towns.group_by(&:head_kana).map do |head_kana, towns|
|
27
|
+
[head_kana, towns.map{|town| [town.name, town.code] }]
|
28
|
+
end.sort_by{|head_kana, _| head_kana }
|
29
|
+
end
|
24
30
|
end
|
25
31
|
end
|
@@ -34,6 +34,22 @@ module GeoMasterJp
|
|
34
34
|
self.cities.map{|city| [city.name, city.code] }
|
35
35
|
end
|
36
36
|
|
37
|
+
def city_grouped_select_options
|
38
|
+
self.cities.group_by(&:head_kana).map do |head_kana, cities|
|
39
|
+
[head_kana, cities.map{|city| [city.name, city.code] }]
|
40
|
+
end.sort_by{|head_kana, _| head_kana }
|
41
|
+
end
|
42
|
+
|
43
|
+
def line_select_options
|
44
|
+
self.lines.map{|line| [line.name, line.code] }
|
45
|
+
end
|
46
|
+
|
47
|
+
def line_grouped_select_options
|
48
|
+
self.lines.group_by(&:head_kana).map do |head_kana, lines|
|
49
|
+
[head_kana, lines.map{|line| [line.name, line.code] }]
|
50
|
+
end.sort_by{|head_kana, _| head_kana }
|
51
|
+
end
|
52
|
+
|
37
53
|
def self.select_options(transactions=nil)
|
38
54
|
(transactions || all).map{|prefecture| [prefecture.name, prefecture.code] }
|
39
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geo_master_jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ykogure
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|