purzelrakete-restful 0.2.16 → 0.2.17

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/CHANGES.markdown CHANGED
@@ -30,3 +30,7 @@
30
30
  21. Aug 2009
31
31
 
32
32
  * refactored HashSerializer to be much clearer
33
+
34
+ 26. Aug 2009
35
+
36
+ * fixed issue with link collapsing
@@ -80,7 +80,7 @@ module Restful
80
80
  config.whitelisted = config.whitelisted.uniq
81
81
 
82
82
  # array
83
- if self.is_a?(Array)
83
+ result = if self.is_a?(Array)
84
84
  element_name = if fst = self.first
85
85
  fst.class.respond_to?(:base_class) ?
86
86
  fst.class.base_class.to_s.tableize :
@@ -116,7 +116,10 @@ module Restful
116
116
  map
117
117
  else
118
118
  Restful::Converters::ActiveRecord.convert(self, config)
119
- end
119
+ end
120
+
121
+ # breakpoint
122
+ result
120
123
  end
121
124
 
122
125
  # FIXME: read Restful::Serializers::Base.serializers. Load order problems?
@@ -49,10 +49,6 @@ module Restful
49
49
  resource.to_restful(config)
50
50
  end
51
51
 
52
- def self.link(key, model, config)
53
- Restful.link(key.to_sym, "base", "path", "link")
54
- end
55
-
56
52
  def self.dereference(url)
57
53
  if url
58
54
  regexp = Regexp.new("#{ Restful::Rails.api_hostname }\/(.*)\/(.*)")
@@ -90,9 +86,7 @@ module Restful
90
86
  if models
91
87
  [*models].map do |m|
92
88
  if m.respond_to? :to_restful
93
- config.nested? ?
94
- link(key, m, config) :
95
- expand(m, config)
89
+ expand(m, config)
96
90
  else
97
91
  raise "Seems as if you want to export the relation #{ key } of an #{ model.class.to_s } object without making #{ key } apiable."
98
92
  end
data/restful.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "restful"
3
- s.version = "0.2.16"
3
+ s.version = "0.2.17"
4
4
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
5
5
  s.authors = ["Daniel Bornkessel", "Rany Keddo"]
6
6
  s.date = "2009-08-11"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purzelrakete-restful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bornkessel