lit 0.4.0.pre.alpha.4 → 0.4.0.pre.alpha.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8731e7911097d0e6c8b3cdbf164d5a4dfb7d9c45
4
- data.tar.gz: c478524af6694e7cf55272ae7d2f83381d05b161
3
+ metadata.gz: ab075e2f02a95653a68d3c581adc623792638f8c
4
+ data.tar.gz: 3c685b7518c2a055f5592472d679c47ac24fb5a4
5
5
  SHA512:
6
- metadata.gz: b096959dfb69f64ff171173026d4c582042e8409593cfc76e522aee75ecf016ecfb13ca794e5d93588594a4428b50d30f55fd0dcd7b0b378c609efc25c4ce244
7
- data.tar.gz: 7171984114ea8cc6d546e5e1530cf89f6d5acb46e7b9a1fc8f38256dc4a74886ccbded8aaeb7a8729afd90dbf34e6a93e8fdd47b4747f81b02d083633abc66f0
6
+ metadata.gz: 91e16c79a8b7f7cef32b20cdbc9ccb880ee3405b08c9ef8afc61adf576d7ccb3572f4c74e4f7ebc9388203f697cd150cb56cac2d49271652d695842d70601ab9
7
+ data.tar.gz: 11d656414f64d6ff0c9bddb02d1e4f38a2e8ae2599ef9674e7b12e205437d9f9dd47b9680f172554d5ec43429f680326f94ca7ee62cf169c5e627e9e3570a56d
@@ -0,0 +1,7 @@
1
+ class LitAddLocalizationKeyLocaleUniqueIndexToLocalizations < Rails::VERSION::MAJOR >= 5 ?
2
+ ActiveRecord::Migration[4.2] :
3
+ ActiveRecord::Migration
4
+ def change
5
+ add_index :lit_localizations, [:localization_key_id, :locale_id], unique: true
6
+ end
7
+ end
@@ -111,7 +111,7 @@ module Lit
111
111
  key_without_locale = split_key(key).last
112
112
  localization_keys.delete(key_without_locale)
113
113
  @localization_object_cache.delete(key)
114
- @localization_key_object_cache.delete(key)
114
+ @localization_key_object_cache.delete(key_without_locale)
115
115
  I18n.backend.reload!
116
116
  end
117
117
 
@@ -168,8 +168,7 @@ module Lit
168
168
  localization_key = find_localization_key(key_without_locale)
169
169
  localization = @localization_object_cache[full_key]
170
170
  localization ||=
171
- Lit::Localization.active
172
- .where(locale_id: locale.id)
171
+ Lit::Localization.where(locale_id: locale.id)
173
172
  .where(localization_key_id: localization_key.id)
174
173
  .first_or_initialize
175
174
  if update_value || localization.new_record?
@@ -1,3 +1,3 @@
1
1
  module Lit
2
- VERSION = '0.4.0-alpha.4'.freeze
2
+ VERSION = '0.4.0-alpha.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.pre.alpha.4
4
+ version: 0.4.0.pre.alpha.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Litwiniuk
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-11-30 00:00:00.000000000 Z
13
+ date: 2018-12-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -451,6 +451,7 @@ files:
451
451
  - db/migrate/20181017123839_lit_add_is_deleted_to_localization_keys.rb
452
452
  - db/migrate/20181018075955_lit_add_localization_key_is_deleted_to_localization_keys.rb
453
453
  - db/migrate/20181030111522_lit_add_is_visited_again_to_localization_keys.rb
454
+ - db/migrate/20181129103819_lit_add_localization_key_locale_unique_index_to_localizations.rb
454
455
  - lib/generators/lit/install/templates/initializer.rb
455
456
  - lib/generators/lit/install_generator.rb
456
457
  - lib/lit.rb