buddy_translatable 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: c27f8d71a4a6a67dcd1883d54e96031cac1675ac1ae880f4a47eece86f59e076
4
- data.tar.gz: 1b88ce42d87729ecf590f851bbc4ede2c0dec4a883fc0e6b09cd24a82ae4cff0
3
+ metadata.gz: 60dc71d022ca5488b44bafbad0f826a331dcaf075a112854b4510bc834877d3d
4
+ data.tar.gz: fe5b6df65c01eaacff9773718e1201cab8f366b4851f96b75836cb9c629161aa
5
5
  SHA512:
6
- metadata.gz: d9353bd3551054a978b2b9a56ca63f55252f655112995b2f919269f385420e02abf16d66ed397efabcb1f1d10eec3e88f0b037a7d544718cfebb944b46527b92
7
- data.tar.gz: 5d9e36cff5af21f0fc1bb926247b0e7831d535dc0e5536e0dbff3cd670617f6146f46d9b6fe931280416f978b30f3b76c88e4e429e0320ece39cafe54dcc20fa
6
+ metadata.gz: 71587e26b2e4f6b90dbac72efe3a86daa0d276a18a2a76e0a1b3031c03cfc095e63590f32b5d97c88887a7c2d59b78a12064898251545cb1ccd040b3d1eee44b
7
+ data.tar.gz: c3f39f5c5828ebcdbad2654e8c67e772c671e00d701aa755dea9ae18bacad0f00d650212b705768fa529536502b81494a195dae5bd53b8d88d856aa552ca1d1b
@@ -5,7 +5,6 @@ module BuddyTranslatable
5
5
  def translatable(*attrs, default_key: :de, available_keys: [])
6
6
  available_keys = I18n.available_locales unless available_keys.present?
7
7
  attrs.each do |attr|
8
- translatable_sanity_check(attr)
9
8
  define_translatable_methods(attr, default_key)
10
9
  define_translatable_key_methods(attr, available_keys)
11
10
  end
@@ -16,17 +15,11 @@ module BuddyTranslatable
16
15
  available_keys = BuddyTranslatable.config.available_sales_keys
17
16
  end
18
17
  attrs.each do |attr|
19
- translatable_sanity_check(attr)
20
18
  define_translatable_methods(attr, default_key, is_locale: false)
21
19
  define_translatable_key_methods(attr, available_keys)
22
20
  end
23
21
  end
24
22
 
25
- def translatable_sanity_check(attr)
26
- msg = "no such column '#{attr}' in '#{name}' model"
27
- raise ArgumentError, msg unless column_names.include?(attr.to_s)
28
- end
29
-
30
23
  def define_translatable_methods(attr, default_key, is_locale: true)
31
24
  current_key = lambda do
32
25
  res = I18n.locale
@@ -1,3 +1,3 @@
1
1
  module BuddyTranslatable
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buddy_translatable
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
  - Owen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-19 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler