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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70806f3cd970ce6827a4bceb51eace7bd9b0c4a9
4
- data.tar.gz: 47d369f0024eeb1a2d12d2d3785a8aa9ce351802
3
+ metadata.gz: f1a5334ebb2e228023a6cccfb705a553f905e078
4
+ data.tar.gz: f09f0016aee8d29946cc866b95f063bfbffdaba7
5
5
  SHA512:
6
- metadata.gz: da4aa4c02bfdad59b0a29d3915539dcaeaca2f163916d8c7e57540e27e8116c5f48feff3aeed0ede9511f1600b84def6776591ee9f25eea6577c8feaf21c25b6
7
- data.tar.gz: 38339632c4410e9c20db4f413a9f530a3d8014479741285188cf241365570080fdcf4dfc787eded23e3eb74471971b09001a79f4ee06c8001162b3021ea5ad37
6
+ metadata.gz: a8272a05585b9d93f37780dcaa03dc82c37a4ce5c6d17c8d0a5b2caf34b4ebf05b348ff15dea6b4848478ad2f829d0c34653aac377508c6160a0dc9f01875a86
7
+ data.tar.gz: cc0614cc0e8017d93fd82d983c657bd0908ef282fcee3576f5a044fdd673b30faf657c1819534ffbd7c8fa69118bb326c2bc28ce82e5fcae58c34e18dbaf2cb9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.11.2 - 2015-06-22
4
+ Bug fixes
5
+ - Fixes broken collection select helper
6
+
3
7
  ### 0.11.1 - 2015-05-20
4
8
  Features
5
9
  - Adds `destroy_resource` method to `ResourceService`
data/lib/godmin.rb CHANGED
@@ -12,6 +12,7 @@ require "godmin/rails"
12
12
  require "godmin/resolver"
13
13
  require "godmin/resources/resource_controller"
14
14
  require "godmin/resources/resource_service"
15
+ require "godmin/version"
15
16
 
16
17
  module Godmin
17
18
  mattr_accessor :namespace
@@ -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, association_collection(attribute), {}, data: { behavior: "select-box" }
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}"))
@@ -1,3 +1,3 @@
1
1
  module Godmin
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
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.1
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-05-20 00:00:00.000000000 Z
13
+ date: 2015-06-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bcrypt