godmin 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/godmin.rb +1 -0
- data/lib/godmin/helpers/forms.rb +5 -1
- data/lib/godmin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1a5334ebb2e228023a6cccfb705a553f905e078
|
4
|
+
data.tar.gz: f09f0016aee8d29946cc866b95f063bfbffdaba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8272a05585b9d93f37780dcaa03dc82c37a4ce5c6d17c8d0a5b2caf34b4ebf05b348ff15dea6b4848478ad2f829d0c34653aac377508c6160a0dc9f01875a86
|
7
|
+
data.tar.gz: cc0614cc0e8017d93fd82d983c657bd0908ef282fcee3576f5a044fdd673b30faf657c1819534ffbd7c8fa69118bb326c2bc28ce82e5fcae58c34e18dbaf2cb9
|
data/CHANGELOG.md
CHANGED
data/lib/godmin.rb
CHANGED
data/lib/godmin/helpers/forms.rb
CHANGED
@@ -27,7 +27,7 @@ module Godmin
|
|
27
27
|
def association(attribute, options = {})
|
28
28
|
case association_type(attribute)
|
29
29
|
when :belongs_to
|
30
|
-
select attribute,
|
30
|
+
select "#{attribute}_id", association_collection_for_select(attribute), {}, data: { behavior: "select-box" }
|
31
31
|
else
|
32
32
|
input(attribute, options)
|
33
33
|
end
|
@@ -65,6 +65,10 @@ module Godmin
|
|
65
65
|
@object.class.reflect_on_association(attribute)
|
66
66
|
end
|
67
67
|
|
68
|
+
def association_collection_for_select(attribute)
|
69
|
+
association_collection(attribute).map { |a| [a.to_s, a.id] }
|
70
|
+
end
|
71
|
+
|
68
72
|
def datetime_value(attribute, options, format)
|
69
73
|
value = options[:value] || @object.send(attribute)
|
70
74
|
value.try(:strftime, @template.translate_scoped("datetimepickers.#{format}"))
|
data/lib/godmin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: godmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Ljungblad
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bcrypt
|