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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33f6772eeec93cd358c7917269783d5f5504b074
4
- data.tar.gz: de666a06f3e72decec76ca3bf34dd4f614625923
3
+ metadata.gz: 7783f40fbba73fc62f3bce93327cdd92ad41d3ed
4
+ data.tar.gz: b4a21ad0eb471b5e6745db356827379953047b02
5
5
  SHA512:
6
- metadata.gz: 90742f403e01aefc0f63592ba9676694cdfa4aac75a69b12933e4f25c448c954ddb96986c715ab54b4347fd1fab4e933fae32bddded088ed7c08df1421f963d5
7
- data.tar.gz: 4b96bbfcb3460c109d1fe0337afcdffdc7fdbba5dcce4c54c0b937caa4d8e2c895aa909a871bdd757b3565b99ce533b456ad7496efed0c07a13e064751a76624
6
+ metadata.gz: eee444fbc535a557d452c33535208fd465b85ad2e4492e7746db780349ffb781cd9defc61a522e84e92e0bc9010cd493225f3e2b49162bc573249f7731cca2aa
7
+ data.tar.gz: c8f69c7b286b67233a6e562900530f182a23b68ce4abf09801d9f22aeb82cb84ed7ea6c234884fb2fcef6c4edf06ab32af67e8404e901dbb1ca493086aa3c418
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- we_bridge_rails_engine_nations (0.1.0)
4
+ we_bridge_rails_engine_nations (0.1.1)
5
5
  actionview-helpers-auto_tag_helper
6
6
  activerecord-mlang
7
7
  we_bridge-auto_view_helper
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
- len2 = self.columns_hash['code_alpha2'].limit
12
- validates :code_alpha2, length: { maximum: len2 }, presence: false
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)
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineNations
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -46293,3 +46293,8 @@ Migrating to CreateCurrencies (20151202041711)
46293
46293
   (0.0ms) begin transaction
46294
46294
  SQL (0.2ms) 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
   (0.9ms) commit transaction
46296
+ Nation Load (7.3ms) SELECT "nations".* FROM "nations"
46297
+ Nation Load (0.4ms) SELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1
46298
+ Nation Load (1.2ms) SELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1
46299
+ Nation Load (2.3ms) SELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1
46300
+ Nation Load (0.2ms) SELECT "nations".* FROM "nations" ORDER BY "nations"."id" ASC LIMIT 1
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.0
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-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-mlang