r_decorator 0.0.4 → 0.0.5
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.
- data/lib/r_decorator/base.rb +5 -1
- data/lib/r_decorator/engine.rb +7 -0
- data/lib/r_decorator/version.rb +1 -1
- data/lib/r_decorator.rb +2 -1
- data/spec/decorators/view_helpers_spec.rb +1 -1
- data/spec/fake_app/fake_app.rb +1 -1
- data/spec/features/action_view_helpers_spec.rb +0 -1
- data/spec/features/controller_ivar_spec.rb +0 -1
- metadata +2 -1
data/lib/r_decorator/base.rb
CHANGED
@@ -59,7 +59,11 @@ module RDecorator
|
|
59
59
|
def self.target_to_class(target, ignore_missing = false)
|
60
60
|
case target
|
61
61
|
when String, Symbol
|
62
|
-
|
62
|
+
begin
|
63
|
+
target = target.to_s.camelize
|
64
|
+
klass = target.constantize
|
65
|
+
rescue NameError
|
66
|
+
end
|
63
67
|
else
|
64
68
|
klass = target
|
65
69
|
end
|
data/lib/r_decorator/version.rb
CHANGED
data/lib/r_decorator.rb
CHANGED
data/spec/fake_app/fake_app.rb
CHANGED
@@ -37,7 +37,7 @@ class ApplicationDecorator < RDecorator::Base
|
|
37
37
|
end
|
38
38
|
class AuthorDecorator < ApplicationDecorator
|
39
39
|
def name_link
|
40
|
-
link_to origin.name, author_path(origin),
|
40
|
+
link_to origin.name, author_path(origin), :id => origin.name
|
41
41
|
end
|
42
42
|
|
43
43
|
def reverse_name
|
@@ -19,7 +19,6 @@ feature 'decorating controller ivar' do
|
|
19
19
|
visit '/authors'
|
20
20
|
page.should have_content 'takahashim'
|
21
21
|
page.should have_content 'takahashim'.reverse
|
22
|
-
page.should have_selector 'a[title="takahashim"]'
|
23
22
|
end
|
24
23
|
|
25
24
|
scenario "decorating models' array in ivar" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- lib/generators/test_unit/templates/decorator_test.rb
|
37
37
|
- lib/r_decorator.rb
|
38
38
|
- lib/r_decorator/base.rb
|
39
|
+
- lib/r_decorator/engine.rb
|
39
40
|
- lib/r_decorator/railtie.rb
|
40
41
|
- lib/r_decorator/rspec.rb
|
41
42
|
- lib/r_decorator/version.rb
|