addresses 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDljNjExNjU5ODhmMWVmYzY4YWQ2MTI1N2UwZDliOTk1YjY0N2I2NA==
4
+ NjJjZTkxM2QwMDkxNWI1ODFhNDdkODIyN2E5ZTY2Mjg5OWMyM2UyMA==
5
5
  data.tar.gz: !binary |-
6
- ZmM5ZjBhMjdjM2IwMzNjMDJkZGUyMGIwOTE2NWI2MWExYTBlYWMyYQ==
6
+ ZDE1ZjVhYTc0ODE2YzFlMDgwZWRmM2Q4OGY0MzQyN2IxMDliY2Y1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTEyYjlhZWZiODQ1MTAxMjMxY2I0ODk1Yzk0MWUwMDdlMzhlZGQ3NDAxOThl
10
- NTVlZjZhYzExMjAyMjcxNmEyMGQwZjlmZDcyMmQ0NzQzZmQ2NmVjMWY5MTc3
11
- ZmIzZGU3NGJkY2Y3NWZjYTRlMTAzMzI4ZWVjMWFmMDFkMTM0YmE=
9
+ NTJjYWE2NzcwNmY0MTQ3NjJjYTZjZDIyM2U5NzU3YTE5ODczZDIxNDgyZDJj
10
+ NjE4NDdlNzZjZTQwNDM2YWU4N2UyNTM0ZjBjM2I4NWY1NTc2NDRjZTIzYjQz
11
+ NGMxMGRlYWViMjhiNmZkMjJjYzE1MjYxNTg5YjU4N2M3NDI1OGY=
12
12
  data.tar.gz: !binary |-
13
- NDdjOGE1M2U4ODU1ZmUxODYyMDIxMzgyZGMxYjlkOGYxYTZjZWNmMjE3ZTU4
14
- ZmVlMmU3NjAzNDIzMjI4Njk3ZjgxNzEzM2RhNDUzZDllNWMxMzkyODY5MGNk
15
- ZmZiZTMxZDZmMTZhMTk1Y2Q2MTYwOGQwZWQ2ZTJhYzdkMjcxMjE=
13
+ NjViZGIwZWI5ZGE3YjAzMDE1N2M1YTkyMjJmMDA1Y2U3NDIwNDgxODE2YzIy
14
+ ZmIxYmFkOTRiNGZjYWUxMWY2NjQ2YjdkM2M2MGI0ZTIwMDY5MDM5YTA0YWRh
15
+ MTYzYjFiYWQ3MGJmOTM5MzU0YjlmM2YzMjYxMjFiNWY2NTBiYTU=
data/Rakefile CHANGED
@@ -17,8 +17,6 @@ end
17
17
  APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
18
  load 'rails/tasks/engine.rake'
19
19
 
20
-
21
-
22
20
  Bundler::GemHelper.install_tasks
23
21
 
24
22
  require 'rspec/core'
@@ -8,8 +8,16 @@ module Addresses
8
8
 
9
9
  validates :zipcode, :number, :city_id, :state_id, presence: true
10
10
 
11
+ after_find :after_find
12
+
11
13
  def to_s
12
14
  "#{self.street}, #{self.number}, #{self.neighborhood}. #{self.city.name} - #{self.city.state.abbreviation}"
13
15
  end
16
+
17
+ private
18
+ # => Used to fill state_id
19
+ def after_find
20
+ self.state_id = self.city.state.id unless self.city.nil?
21
+ end
14
22
  end
15
23
  end
@@ -1,3 +1,3 @@
1
1
  module Addresses
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -17,9 +17,11 @@ module Dummy
17
17
 
18
18
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
19
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
- # config.i18n.default_locale = :de
20
+ config.i18n.default_locale = "pt-BR"
21
21
 
22
22
  config.encoding = "utf-8"
23
+
24
+ # Store::Engine.config.18n.default_locale = config.i18n.default_locale
23
25
  end
24
26
  end
25
27
 
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ pt-BR:
23
+ are_you_sure: "Você tem certeza?"
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: addresses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilbert Ribeiro
8
+ - Michel Azevedo
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-03-28 00:00:00.000000000 Z
12
+ date: 2014-04-07 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails
@@ -24,10 +25,11 @@ dependencies:
24
25
  - - ~>
25
26
  - !ruby/object:Gem::Version
26
27
  version: '4.0'
27
- description: Create Countr, State, City, Neighborhood and a polymorphic model called
28
+ description: Create Country, State, City, Neighborhood and a polymorphic model called
28
29
  Address that can be related as addessable.
29
30
  email:
30
31
  - wkelyson@gmail.com
32
+ - michel.azevedos@gmail.com
31
33
  executables: []
32
34
  extensions: []
33
35
  extra_rdoc_files: []
@@ -90,6 +92,7 @@ files:
90
92
  - spec/dummy/config/initializers/session_store.rb
91
93
  - spec/dummy/config/initializers/wrap_parameters.rb
92
94
  - spec/dummy/config/locales/en.yml
95
+ - spec/dummy/config/locales/pt-BR.yml
93
96
  - spec/dummy/config/routes.rb
94
97
  - spec/dummy/db/development.sqlite3
95
98
  - spec/dummy/db/migrate/20140327205948_create_addresses_countries.addresses.rb
@@ -167,6 +170,7 @@ test_files:
167
170
  - spec/dummy/config/initializers/session_store.rb
168
171
  - spec/dummy/config/initializers/wrap_parameters.rb
169
172
  - spec/dummy/config/locales/en.yml
173
+ - spec/dummy/config/locales/pt-BR.yml
170
174
  - spec/dummy/config/routes.rb
171
175
  - spec/dummy/config.ru
172
176
  - spec/dummy/db/development.sqlite3