we_bridge_rails_engine_nations 0.1.0 → 0.1.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/Gemfile.lock +1 -1
- data/app/models/nation.rb +5 -4
- data/lib/we_bridge_rails_engine_nations/version.rb +1 -1
- data/spec/dummy/log/development.log +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7783f40fbba73fc62f3bce93327cdd92ad41d3ed
|
|
4
|
+
data.tar.gz: b4a21ad0eb471b5e6745db356827379953047b02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eee444fbc535a557d452c33535208fd465b85ad2e4492e7746db780349ffb781cd9defc61a522e84e92e0bc9010cd493225f3e2b49162bc573249f7731cca2aa
|
|
7
|
+
data.tar.gz: c8f69c7b286b67233a6e562900530f182a23b68ce4abf09801d9f22aeb82cb84ed7ea6c234884fb2fcef6c4edf06ab32af67e8404e901dbb1ca493086aa3c418
|
data/Gemfile.lock
CHANGED
data/app/models/nation.rb
CHANGED
|
@@ -8,10 +8,8 @@ class Nation < ActiveRecord::Base
|
|
|
8
8
|
include ActionView::Helpers::AutoTagHelper::FormInfo
|
|
9
9
|
set_accessible_attrs :region_id, :name, :code_alpha2, :code_alpha3, :code_numeric, :lat, :lon
|
|
10
10
|
validates :name, presence: true
|
|
11
|
-
|
|
12
|
-
validates :
|
|
13
|
-
len3 = self.columns_hash['code_alpha3'].limit
|
|
14
|
-
validates :code_alpha3, length: { maximum: len3 }, presence: false
|
|
11
|
+
validates :code_alpha2, length: { maximum: 2 }, presence: false
|
|
12
|
+
validates :code_alpha3, length: { maximum: 3 }, presence: false
|
|
15
13
|
|
|
16
14
|
latlon = {numericality: { less_than_or_equal_to: 180.0, greater_than_or_equal_to: -180.0 }, allow_nil: true}
|
|
17
15
|
validates :lat, latlon
|
|
@@ -21,6 +19,9 @@ class Nation < ActiveRecord::Base
|
|
|
21
19
|
self.name
|
|
22
20
|
end
|
|
23
21
|
|
|
22
|
+
def code2 ; self.code_alpha2 ; end
|
|
23
|
+
def code3 ; self.code_alpha3 ; end
|
|
24
|
+
|
|
24
25
|
def self.[](code_or_num)
|
|
25
26
|
col = :code_alpha2
|
|
26
27
|
if code_or_num.kind_of?(Numeric)
|
|
@@ -46293,3 +46293,8 @@ Migrating to CreateCurrencies (20151202041711)
|
|
|
46293
46293
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
|
46294
46294
|
[1m[35mSQL (0.2ms)[0m INSERT INTO "currency_nation_maps" ("currency_id", "nation_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["currency_id", 163], ["nation_id", 100], ["created_at", "2015-12-02 13:04:34.064248"], ["updated_at", "2015-12-02 13:04:34.064248"]]
|
|
46295
46295
|
[1m[36m (0.9ms)[0m [1mcommit transaction[0m
|
|
46296
|
+
[1m[36mNation Load (7.3ms)[0m [1mSELECT "nations".* FROM "nations"[0m
|
|
46297
|
+
[1m[35mNation Load (0.4ms)[0m SELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1
|
|
46298
|
+
[1m[36mNation Load (1.2ms)[0m [1mSELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1[0m
|
|
46299
|
+
[1m[35mNation Load (2.3ms)[0m SELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1
|
|
46300
|
+
[1m[36mNation Load (0.2ms)[0m [1mSELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1[0m
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: we_bridge_rails_engine_nations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shinjiro Itagaki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-12-
|
|
11
|
+
date: 2015-12-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord-mlang
|