Permalink
Browse files

using representable-0.10.3.

  • Loading branch information...
apotonick committed Dec 7, 2011
1 parent 8db42a4 commit 53d54cd0d09ada56cd34d109fd38afb2c6d9d103
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/roar/representer/feature/hypermedia.rb
  2. +1 −1 roar.gemspec
@@ -34,7 +34,7 @@ def links
protected
# Setup hypermedia links by invoking their blocks. Usually called by #serialize.
def prepare_links!
- links_def = self.class.find_links_definition or return
+ links_def = find_links_definition or return
hyperlink_class = links_def.sought_type
links_def.rel2block.each do |link|
@@ -49,6 +49,10 @@ def run_link_block(block)
instance_exec(&block)
end
+ def find_links_definition
+ representable_attrs.find { |d| d.is_a?(LinksDefinition) }
+ end
+
class LinkCollection < Array
def [](rel)
View
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency "representable", "~> 0.10.2"
+ s.add_runtime_dependency "representable", "~> 0.10.3"
s.add_runtime_dependency "hooks", "~> 0.1.4"
s.add_development_dependency "test_xml"

0 comments on commit 53d54cd

Please sign in to comment.