geopolitical 0.8.0 → 0.8.1
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 +4 -4
- data/app/controllers/geopolitical/regions_controller.rb +2 -2
- data/app/models/city.rb +1 -1
- data/app/models/region.rb +1 -2
- data/app/views/geopolitical/cities/index.html.haml +2 -0
- data/app/views/geopolitical/nations/index.html.haml +3 -1
- data/app/views/geopolitical/regions/_form.html.haml +2 -1
- data/lib/geopolitical/engine.rb +1 -0
- data/lib/geopolitical/helpers.rb +2 -1
- data/lib/geopolitical/version.rb +1 -1
- metadata +1 -2
- data/app/controllers/zones_controller.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c839075fc478bd86ac981d8de6663d082edb3eae
|
4
|
+
data.tar.gz: 3e661f747bf2998c4878302f409bf5cf34acca6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 969e0608da36268ece8f032962d79aabcfc261ab7873dc18a90bd76c79e586ff5db8af0d88e1f14c10166762da0ae4f885128b60cce0c8ce0419ce100b5bf882
|
7
|
+
data.tar.gz: 191cfd245bc863f4fab038bf60abd36490a3b6cd4f2e5a3829155371aba9208691b529be1eef363746332f9d10a413b3b2dc8f515904ac0b333a806086a3d8da
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Geopolitical
|
2
2
|
class RegionsController < GeopoliticalController
|
3
3
|
inherit_resources
|
4
|
-
before_filter :get_relatives, :only => [:new, :edit]
|
4
|
+
before_filter :get_relatives, :only => [:new, :edit, :create, :update]
|
5
5
|
|
6
6
|
def collection
|
7
7
|
@regions = Region.ordered.page(params[:page])
|
@@ -10,7 +10,7 @@ module Geopolitical
|
|
10
10
|
private
|
11
11
|
|
12
12
|
def get_relatives
|
13
|
-
@nations = Nation.all
|
13
|
+
@nations = Nation.all.map { |n| [n.name, n.id] }
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
data/app/models/city.rb
CHANGED
@@ -4,10 +4,10 @@ class City
|
|
4
4
|
include Geopolitical::Helpers
|
5
5
|
|
6
6
|
field :gid, type: Integer
|
7
|
+
field :zip, type: String
|
7
8
|
field :slug, type: String
|
8
9
|
field :name, type: String, localize: true
|
9
10
|
field :area, type: Integer
|
10
|
-
field :zip, type: Integer
|
11
11
|
field :souls, type: Integer
|
12
12
|
field :geom, type: Point, spatial: true
|
13
13
|
# field :ascii, type: String
|
data/app/models/region.rb
CHANGED
@@ -15,9 +15,8 @@ class Region
|
|
15
15
|
scope :ordered, order_by(name: 1)
|
16
16
|
|
17
17
|
validates :nation, presence: true
|
18
|
-
validates :name, presence: true
|
18
|
+
validates :name, presence: true, uniqueness: { :scope => :nation_id }
|
19
19
|
|
20
|
-
validates :name, uniqueness: { :scope => :nation_id }
|
21
20
|
|
22
21
|
|
23
22
|
end
|
@@ -10,6 +10,7 @@
|
|
10
10
|
%thead
|
11
11
|
%tr
|
12
12
|
%th Nome
|
13
|
+
%th ZIP
|
13
14
|
%th Region
|
14
15
|
%th Nation
|
15
16
|
%th Population
|
@@ -20,6 +21,7 @@
|
|
20
21
|
%td
|
21
22
|
= city.name
|
22
23
|
= link_to city.slug , city
|
24
|
+
%td= city.zip
|
23
25
|
%td= city.region.name if city.region
|
24
26
|
%td= city.nation.name
|
25
27
|
%td= city.souls
|
@@ -12,6 +12,7 @@
|
|
12
12
|
%th Abbr
|
13
13
|
%th ISO
|
14
14
|
%th Name
|
15
|
+
%th Postal
|
15
16
|
%th Lang
|
16
17
|
%th Cash
|
17
18
|
%th
|
@@ -25,7 +26,8 @@
|
|
25
26
|
%td
|
26
27
|
= nation.name
|
27
28
|
= link_to nation.slug, nation
|
28
|
-
%td= nation.
|
29
|
+
%td= nation.zip
|
30
|
+
%td= truncate(nation.lang)
|
29
31
|
%td= nation.cash
|
30
32
|
%td.last
|
31
33
|
=# link_to "Destroy!", nation_path(nation), :method => :delete
|
data/lib/geopolitical/engine.rb
CHANGED
data/lib/geopolitical/helpers.rb
CHANGED
data/lib/geopolitical/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geopolitical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
@@ -160,7 +160,6 @@ files:
|
|
160
160
|
- app/controllers/geopolitical/nations_controller.rb
|
161
161
|
- app/controllers/geopolitical/zones_controller.rb
|
162
162
|
- app/controllers/geopolitical/cities_controller.rb
|
163
|
-
- app/controllers/zones_controller.rb
|
164
163
|
- app/models/zone_member.rb
|
165
164
|
- app/models/city.rb
|
166
165
|
- app/models/address.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Geopolitical
|
2
|
-
class RegionsController < GeopoliticalController
|
3
|
-
inherit_resources
|
4
|
-
before_filter :get_relatives, :only => [:new, :edit]
|
5
|
-
|
6
|
-
def collection
|
7
|
-
@regions = Region.ordered.page(params[:page])
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def get_relatives
|
13
|
-
@nations = Nation.all
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|