windsor 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/README.rdoc +1 -1
- data/app/controllers/windsor_controller.rb +9 -9
- data/lib/windsor/version.rb +1 -1
- metadata +8 -8
data/README.rdoc
CHANGED
@@ -165,16 +165,16 @@ class WindsorController < ApplicationController
|
|
165
165
|
pagination = {
|
166
166
|
:total_items => total_items,
|
167
167
|
:max_page_size => @max_page_size,
|
168
|
-
:links =>
|
169
|
-
|
170
|
-
|
171
|
-
|
168
|
+
:links => {
|
169
|
+
:first => { :href => page_link(1) },
|
170
|
+
:last => { :href => page_link(total_pages.to_s)}
|
171
|
+
}
|
172
172
|
}
|
173
173
|
unless current_page_index == last_page_index
|
174
|
-
pagination[:links]
|
174
|
+
pagination[:links][:next] = { :href => page_link((current_page_index + 2)) }
|
175
175
|
end
|
176
176
|
if current_page_index >= 1
|
177
|
-
pagination[:links]
|
177
|
+
pagination[:links][:previous] = { :href => page_link(current_page_index) }
|
178
178
|
end
|
179
179
|
return pagination
|
180
180
|
end
|
@@ -219,10 +219,10 @@ class WindsorController < ApplicationController
|
|
219
219
|
end
|
220
220
|
|
221
221
|
def add_link(object, href, rel)
|
222
|
-
unless object['links'].is_a?(
|
223
|
-
object['links'] =
|
222
|
+
unless object['links'].is_a?(Hash)
|
223
|
+
object['links'] = {}
|
224
224
|
end
|
225
|
-
object['links']
|
225
|
+
object['links'][rel] = { 'href' => href }
|
226
226
|
end
|
227
227
|
|
228
228
|
def prepare_representation(object)
|
data/lib/windsor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: windsor
|
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:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-09-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2153480480 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2153480480
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: sqlite3
|
28
|
-
requirement: &
|
28
|
+
requirement: &2153480060 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2153480060
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rspec
|
39
|
-
requirement: &
|
39
|
+
requirement: &2153479600 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2153479600
|
48
48
|
description: Windsor is a plugin for building RESTful APIs in Rails.
|
49
49
|
email:
|
50
50
|
- sam@samdecesare.com
|