action_presenter 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -27,4 +27,8 @@
27
27
 
28
28
  ## Version 1.1.3
29
29
 
30
- * bugfix: wrong filename :/
30
+ * bugfix: wrong filename :/
31
+
32
+ ## Version 1.1.4
33
+
34
+ * allow to pass Array as object (klass must be given!)
@@ -1,3 +1,3 @@
1
1
  module ActionPresenter
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -7,8 +7,11 @@ module ActionPresenter
7
7
  end
8
8
 
9
9
  def present(object, klass = nil)
10
+ if klass && object.is_a?(Array)
11
+ object = object.last
12
+ end
13
+
10
14
  klass ||= presenter_name object
11
- object = object.last if object.is_a? Array
12
15
 
13
16
  presenter = klass.new(object, view_context)
14
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-09 00:00:00.000000000 Z
12
+ date: 2012-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  segments:
123
123
  - 0
124
- hash: -4431438054665160896
124
+ hash: -1794854243131256047
125
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  none: false
127
127
  requirements:
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: -4431438054665160896
133
+ hash: -1794854243131256047
134
134
  requirements: []
135
135
  rubyforge_project: action_presenter
136
136
  rubygems_version: 1.8.24