enum_i18n_help 0.1.2 → 0.1.3

This diff has not been reviewed by any users.
Log in in order to be able to vote.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76bb74be3a1a0670111d867f84b3e041f349b5fa4bf76bcd795f8bae23762034
4
- data.tar.gz: f30e313ad6e6b938454534555f3825bb0426ef2ad17a3d133b979054bc091fe5
3
+ metadata.gz: 4543061c2ee7addd180fd018efa37c020acde351e74938709c6dfe2b0226c67e
4
+ data.tar.gz: a0876d6852513c65f973f73bc91d7776e1a5dd63fdb5cc0bdbec357e7425ab46
5
5
  SHA512:
6
- metadata.gz: 3c9d378525f87f997b29977b665bffd2a37db8e189cf24e589b3270dbdcde49d526f7cb9f756a1201aaf3eca3af5e6dc4161b188b4022a9d2b353b5b31abbccc
7
- data.tar.gz: 81731573a78fa19d43e8c3391eca6734261326927dabd91e669c307045b39e40341226aedee3f627256bd65677fec5bb35ea54d40135fa4a9914ba76f692e3aa
6
+ metadata.gz: dded194adb1624f8de46c318389273f884604af938d79e2856c1fe0c8aac4b4045ab523bd28ea4c667cad728c730bae5b465e2f9f106f4f0bc727beafe15d556
7
+ data.tar.gz: c85b81eef37211c9edf64f194618b275e2b57e83b65a727df558dd53bae39d79a10244009604ed5a72112d6c37a5624d52fb2e6e4fe050db8ccfc15141612888
@@ -1,10 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.9
4
3
  - 2.3.5
5
4
  - 2.4.3
6
5
  - 2.5.0
7
6
  before_install:
8
- - gem update --system
9
- - gem install bundler -v 1.16.1
7
+ - gem update --system 2.7.10
8
+ - gem install bundler -v 2.1.4
10
9
  cache: bundler
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_runtime_dependency "activerecord", "~> 5.0"
33
33
 
34
34
  spec.add_development_dependency "activesupport", "~> 5.0"
35
- spec.add_development_dependency "bundler", "~> 1.16"
35
+ spec.add_development_dependency "bundler", "~> 2.1.4"
36
36
  spec.add_development_dependency "rake", ">= 12.3.3"
37
37
  spec.add_development_dependency "sqlite3"
38
38
  spec.add_development_dependency "rspec"
@@ -33,7 +33,12 @@ module EnumI18nHelp
33
33
 
34
34
  klass.instance_eval <<-METHOD, __FILE__, __LINE__ + 1
35
35
  def #{attr_name}_options
36
- #{attr_value_hash}.merge((I18n.t "activerecord.attributes.#{klass.name.underscore}/#{attr_name}").reject{ |_, v| v.nil? }).invert.to_a
36
+ locale_definitions = I18n.t("activerecord.attributes.#{klass.name.underscore}/#{attr_name}")
37
+
38
+ #{attr_value_hash}
39
+ .merge(locale_definitions.reject{ |k, v| v.nil? || #{attr_value.keys}.exclude?(k.to_sym) })
40
+ .invert
41
+ .to_a
37
42
  end
38
43
  METHOD
39
44
  end
@@ -1,3 +1,3 @@
1
1
  module EnumI18nHelp
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_i18n_help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShuheiTsuji
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: 2.1.4
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: 2.1.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.0.3
165
+ rubygems_version: 3.1.4
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: Enum attributes with I18n and ActiveRecord support