towsta 1.2.1 → 1.2.2
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/lib/towsta/kinds/user.rb +3 -2
- data/lib/towsta/kinds/vertical.rb +1 -1
- data/lib/towsta/version.rb +1 -1
- data/lib/towsta/vertical.rb +5 -2
- metadata +2 -2
data/lib/towsta/kinds/user.rb
CHANGED
@@ -5,7 +5,7 @@ module Towsta
|
|
5
5
|
|
6
6
|
def get
|
7
7
|
return @content if @content.class == User
|
8
|
-
user = User.find @content
|
8
|
+
user = User.find @content.to_i
|
9
9
|
@content = user if user
|
10
10
|
@content
|
11
11
|
end
|
@@ -14,6 +14,7 @@ module Towsta
|
|
14
14
|
return @content = content if content.class == User
|
15
15
|
return @content = content.to_i if content.to_i != 0
|
16
16
|
@content = nil
|
17
|
+
@content = content
|
17
18
|
end
|
18
19
|
|
19
20
|
def compare object
|
@@ -22,7 +23,7 @@ module Towsta
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def export
|
25
|
-
return @content.id.to_s if
|
26
|
+
return @content.id.to_s if self.get.class == User
|
26
27
|
@content.to_s
|
27
28
|
end
|
28
29
|
|
data/lib/towsta/version.rb
CHANGED
data/lib/towsta/vertical.rb
CHANGED
@@ -13,6 +13,8 @@ module Towsta
|
|
13
13
|
attr_accessor :all, :attributes, :count
|
14
14
|
end
|
15
15
|
|
16
|
+
attr_accessor :message
|
17
|
+
|
16
18
|
args[:slices].each do |attr, kind|
|
17
19
|
eval "def object_of_#{attr}; @#{attr}; end;"
|
18
20
|
eval "def #{attr}= value; @#{attr} ||= Towsta::Kinds::#{kind[0].upcase + kind[1..-1]}Kind.new; @#{attr}.set value; end;"
|
@@ -35,12 +37,12 @@ module Towsta
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def initialize args
|
38
|
-
self.attributes.merge(args).each {|k,v|
|
40
|
+
self.attributes.merge(args).each {|k,v| self.send("#{k}=".to_sym, v)}
|
39
41
|
self.class.all << self
|
40
42
|
end
|
41
43
|
|
42
44
|
def update args, author=$towsta_default_author
|
43
|
-
args.each {|k,v|
|
45
|
+
args.each {|k,v| self.send("#{k}=".to_sym, v)}
|
44
46
|
self.save author
|
45
47
|
end
|
46
48
|
|
@@ -65,6 +67,7 @@ module Towsta
|
|
65
67
|
id_aux ? id_aux : '0'
|
66
68
|
export = {:creator => creator, :vertical => self.class.to_s, :attributes => export, :id => id_aux}
|
67
69
|
response = Towsta::Synchronizer.save_request export
|
70
|
+
@message = response[:message]
|
68
71
|
self.id = response[:id] if response[:status]
|
69
72
|
self.author = User.find_by_email creator
|
70
73
|
Towsta::Memory.flush if $towsta_cache
|