presenter_object 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/presenter_object/base.rb +8 -1
- data/lib/presenter_object/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: f6d5f56909cea81da55f6fa06647c5c592e89a0d
|
4
|
+
data.tar.gz: 155ec5e26df26859ca1100f9e5236e6a4d3f6d10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10ed5068e655a2f55f462be13ce75ab18c894cbb82a0644cd2bad525efc6e0a162e087dc7027485b6671b7a9ebd1a50f3cd4b720797e350695593ebaefcaee5e
|
7
|
+
data.tar.gz: 07dea83e669fdd515d89751270ccf46028454c2f5caabee4c9e5968fe0d01e9534dbc130424605f03cbfef0d6bcc52fb353778b3f19048a806f0dbc529ff8aa0
|
@@ -38,7 +38,14 @@ class PresenterObject::Base
|
|
38
38
|
def initialize(object, view_context = nil)
|
39
39
|
@object = object
|
40
40
|
@class = object.class # impersonate object's class
|
41
|
-
@to_param =
|
41
|
+
@to_param = parameterize object
|
42
42
|
@view_context = view_context
|
43
43
|
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
# let link helpers know the object's id
|
48
|
+
def parameterize(obj)
|
49
|
+
obj.respond_to?(:to_param) ? obj.to_param : obj.id.to_s
|
50
|
+
end
|
44
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: presenter_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Salazar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03
|
11
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|