restpack_serializer 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmViZmMyYTk0YTVhZDY0YTczMGQ4MDIwMThjZjNhMDBhZmFmMWZlOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmEzNGY0ZDU2Y2Y3ZTI1OTkyNzBhYmVhMmU0NzIxNGRjYmJjNTNmYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjMyYTgyOWJmZTc4NDBlYmY4OGZiMDljMzFlZjQ0ZTM5MmYzNjUwMjkxZWVj
|
10
|
+
ZWE0YjNhMjUzYzlmYTBlZmQ5OWNlYjBiMmY5NzRkNTI0MDg5MTNhMmZmNWM3
|
11
|
+
NGI1OWFkOWRhZTU3YzZkOWQ2N2JlNWVjMGNjMjhiYzVhMjQ2MjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTRlMGZkMTAwZjM1YzZhODI4NjdmNGIwMTdhMzY2YTcwZDg4NjAyNWM2MmYy
|
14
|
+
ODEzMTUyNTEzOTkwZmQ5MzE4OGUwOTFlNzZjZmRiNDlmN2Y1YjIwMzUxODM3
|
15
|
+
Y2ZiZTJkNjgyOTA1ZWI2NjAxODk4MzZiZDVhZDk0NTY0ZDQ2MDg=
|
data/Gemfile.lock
CHANGED
data/lib/restpack_serializer.rb
CHANGED
@@ -4,3 +4,11 @@ require 'will_paginate/active_record'
|
|
4
4
|
require 'restpack_serializer/version'
|
5
5
|
require 'restpack_serializer/serializable'
|
6
6
|
require 'restpack_serializer/factory'
|
7
|
+
|
8
|
+
module RestPack
|
9
|
+
module Serializer
|
10
|
+
mattr_accessor :href_prefix
|
11
|
+
|
12
|
+
@@href_prefix = ''
|
13
|
+
end
|
14
|
+
end
|
@@ -60,6 +60,13 @@ describe RestPack::Serializer::SideLoading do
|
|
60
60
|
:type => :songs
|
61
61
|
}
|
62
62
|
}
|
63
|
+
|
64
|
+
it "applies custom RestPack::Serializer.href_prefix" do
|
65
|
+
original = RestPack::Serializer.href_prefix
|
66
|
+
RestPack::Serializer.href_prefix = "/api/v1"
|
67
|
+
AlbumSerializer.links["albums.artist"][:href].should == "/api/v1/artists/{albums.artist}.json"
|
68
|
+
RestPack::Serializer.href_prefix = original
|
69
|
+
end
|
63
70
|
end
|
64
71
|
|
65
72
|
describe "#filterable_by" do
|