egov_utils 0.1.16 → 0.1.17

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: f5e0d2eacc1f1255140048fa865dfe34378472030cbbd7c51bd39efd2f49c152
4
- data.tar.gz: 62675a67d00e5dc9b3ffcdf19a833166979091b00d454ca64cbbcdd2b575b63d
3
+ metadata.gz: 1d483ae93a2a968f5ff4fb74cecac3790bc9942a7e5488dba7500672e8ae570e
4
+ data.tar.gz: 4324879d422fd21c52dab7193957b4ca25a5e1998f01121df79b527b4c1e052f
5
5
  SHA512:
6
- metadata.gz: 182175b3dbe8628155477389a50ed4dc10c5cb4b785115551ff34e9609dd0c14a34989aaea07f01c382137a1533a00e9a1961809c5e8c342fada11238013718d
7
- data.tar.gz: f94cd08099878bcd8c0218f2103aa961f2152a8cd88b54cf5b8236a540d1cd1a5c67021cf6a4d0f3fb42c19f98bc5b38ee4eb91ccf506f72b74f0e8fd338d3be
6
+ metadata.gz: 4efad04faa1075277da1fa431f0161d5552e696e86d62934a675b18e8fd78f0b2969e9354ac66150acd2a6a4f8a73cd6283c425e34d8d4b4ca938195c7f818f4
7
+ data.tar.gz: 7f3d2077e44771b85f3e853cc34fe8b016d30d268c4bcd022e8f5e46aa49f8d4bce662eedb9f2da00f79611ed997f46366fa4ae0b09c61b5aa0eaf568cc546d6
@@ -0,0 +1,10 @@
1
+ module EgovUtils
2
+ module EnumHelper
3
+
4
+ def enum_values_for_select(klass, method)
5
+ plur_method = method.to_s.pluralize
6
+ klass.send(plur_method).collect{|val, _| [t("activerecord.attributes.#{klass.model_name.i18n_key}.#{plur_method}.#{val}"), val]}
7
+ end
8
+
9
+ end
10
+ end
@@ -32,6 +32,7 @@ module EgovUtils
32
32
  ActiveSupport.on_load(:action_controller) do
33
33
  ::ActionController::Base.helper EgovUtils::ApplicationHelper
34
34
  ::ActionController::Base.helper EgovUtils::GridHelper
35
+ ::ActionController::Base.helper EgovUtils::EnumHelper
35
36
  end
36
37
  end
37
38
 
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.1.16'
2
+ VERSION = '0.1.17'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-13 00:00:00.000000000 Z
11
+ date: 2017-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -296,6 +296,7 @@ files:
296
296
  - app/controllers/egov_utils/sessions_controller.rb
297
297
  - app/controllers/egov_utils/users_controller.rb
298
298
  - app/helpers/egov_utils/application_helper.rb
299
+ - app/helpers/egov_utils/enum_helper.rb
299
300
  - app/helpers/egov_utils/grid_helper.rb
300
301
  - app/helpers/egov_utils/groups_helper.rb
301
302
  - app/helpers/egov_utils/roles_helper.rb
@@ -481,7 +482,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
481
482
  version: '0'
482
483
  requirements: []
483
484
  rubyforge_project:
484
- rubygems_version: 2.7.0
485
+ rubygems_version: 2.7.2
485
486
  signing_key:
486
487
  specification_version: 4
487
488
  summary: The eGoverment utilities is set of functionalities to support basic eGoverment