smartfm 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/smartfm/core/version.rb
CHANGED
data/lib/smartfm/models/list.rb
CHANGED
@@ -72,7 +72,8 @@ class Smartfm::List < Smartfm::Base
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def add_item(auth, item)
|
75
|
-
|
75
|
+
# id is used for item_id only here..
|
76
|
+
self.rest_client.add_item(auth, {:list_id => self.id, :id => item.id})
|
76
77
|
end
|
77
78
|
|
78
79
|
def delete_item(auth, item)
|
@@ -18,15 +18,7 @@ module Smartfm::PrivateContent
|
|
18
18
|
|
19
19
|
module InstanceMethods
|
20
20
|
def save(auth)
|
21
|
-
|
22
|
-
case result
|
23
|
-
when Hash
|
24
|
-
self.deserialize(result)
|
25
|
-
when String
|
26
|
-
self.find(result)
|
27
|
-
else
|
28
|
-
true
|
29
|
-
end
|
21
|
+
self.rest_client.create(auth, self.to_post_data)
|
30
22
|
end
|
31
23
|
end
|
32
24
|
|
@@ -11,8 +11,8 @@ module Smartfm::PublicContent
|
|
11
11
|
self.deserialize(hash) || []
|
12
12
|
end
|
13
13
|
|
14
|
-
def find(
|
15
|
-
params[:id] =
|
14
|
+
def find(obj_id, params = {})
|
15
|
+
params[:id] = obj_id
|
16
16
|
hash = self.rest_client.find(params)
|
17
17
|
self.deserialize(hash)
|
18
18
|
end
|
@@ -39,7 +39,7 @@ module Smartfm::PublicContent
|
|
39
39
|
when Hash
|
40
40
|
self.deserialize(result)
|
41
41
|
when String
|
42
|
-
self.find(result)
|
42
|
+
self.class.find(result)
|
43
43
|
else
|
44
44
|
true
|
45
45
|
end
|
@@ -8,7 +8,7 @@ class Smartfm::RestClient::List < Smartfm::RestClient::Base
|
|
8
8
|
:matching => {:path => '/lists/matching/__keyword__'},
|
9
9
|
:likes => {:path => '/lists/__id__/likes' },
|
10
10
|
:create => {:path => '/lists', :http_method => :post},
|
11
|
-
:add_item => {:path => '/lists/
|
11
|
+
:add_item => {:path => '/lists/__list_id__/items', :http_method => :post}, # id is used for item_id here..
|
12
12
|
:like! => {:path => '/lists/__id__/likes', :http_method => :post},
|
13
13
|
:delete => {:path => '/lists/__id__', :http_method => :delete},
|
14
14
|
:delete_item => {:path => '/lists/__id__/items/__item_id__', :http_method => :delete},
|
@@ -13,8 +13,8 @@ class Smartfm::RestClient::User < Smartfm::RestClient::Base
|
|
13
13
|
:notifications => {:path => '/users/__username__/notifications'},
|
14
14
|
:matching => {:path => '/users/matching/__keyword__' },
|
15
15
|
:study_results => {:path => '/users/__username__/study_results/__application__'},
|
16
|
-
:follow! => {:path => '/
|
17
|
-
:unfollow! => {:path => '/
|
16
|
+
:follow! => {:path => '/friends', :http_method => :post},
|
17
|
+
:unfollow! => {:path => '/friends/__username__', :http_method => :delete}
|
18
18
|
}
|
19
19
|
|
20
20
|
end
|