enumerate_it 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ad333269f935566eb9da374a8ea85983503241c
|
4
|
+
data.tar.gz: 854d42aea0246c5a71975b440afe2bff426b14f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99c994cb23ba95457d4f1838be1c8f87e4a19b0c80316bf520a1489c11756556e114c8ac55a78b4a8025534cc674c5356fc30f9f5d1e4431f40b27a5c9a6676c
|
7
|
+
data.tar.gz: 4947235c8dc943e21af7100b5a048247f878bd274249731eaa84aadf68c2b3d294ae6e0d0936f7e415cb352142650db1229b816726c1dd51f6854941b1d3e524
|
data/Gemfile.lock
CHANGED
data/lib/enumerate_it/version.rb
CHANGED
@@ -3,7 +3,7 @@ module EnumerateIt
|
|
3
3
|
class EnumGenerator < Rails::Generators::NamedBase
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
5
|
|
6
|
-
argument :attributes, type: 'array'
|
6
|
+
argument :attributes, type: 'array'
|
7
7
|
|
8
8
|
class_option :singular, type: 'string', desc: 'Singular name for i18n'
|
9
9
|
|
@@ -14,12 +14,12 @@ module EnumerateIt
|
|
14
14
|
template 'locale.yml', File.join('config/locales', "#{singular_name}.yml")
|
15
15
|
end
|
16
16
|
|
17
|
-
desc 'Creates
|
17
|
+
desc 'Creates the enumeration'
|
18
18
|
def create_enumerate_it
|
19
19
|
template 'enumerate_it.rb', File.join('app/enumerations', "#{singular_name}.rb")
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
private
|
23
23
|
|
24
24
|
def default_lang
|
25
25
|
options[:lang]
|
@@ -1,3 +1,5 @@
|
|
1
1
|
class <%= class_name %> < EnumerateIt::Base
|
2
|
-
|
2
|
+
associate_values(
|
3
|
+
<%= fields.map { |field, value| value ? "#{field}: #{value}" : ":#{field}"}.join(",\n ") %>
|
4
|
+
)
|
3
5
|
end
|