towsta 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 @content.class == User
26
+ return @content.id.to_s if self.get.class == User
26
27
  @content.to_s
27
28
  end
28
29
 
@@ -26,7 +26,7 @@ module Towsta
26
26
  end
27
27
 
28
28
  def export
29
- return @content.id.to_s if klasses.include? @content.class
29
+ return @content.id.to_s if klasses.include? self.get.class
30
30
  @content.to_s
31
31
  end
32
32
 
@@ -1,3 +1,3 @@
1
1
  module Towsta
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -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| eval "self.#{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| eval "self.#{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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 1
9
- version: 1.2.1
8
+ - 2
9
+ version: 1.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mortaro