towsta 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require "./towsta.rb"
2
2
 
3
3
  require 'dalli'
4
4
  set :cache, Dalli::Client.new
5
- require File.expand_path('../towsta/memory', __FILE__)
5
+ require File.expand_path('../../ memory', __FILE__)
6
6
 
7
7
  Towsta::Synchronizer.new params: {}, request: :structure
8
8
 
@@ -1,3 +1,3 @@
1
1
  module Towsta
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -4,7 +4,7 @@ module Towsta
4
4
 
5
5
  attr_accessor :message
6
6
 
7
- def update args, author=$towsta_default_author
7
+ def update args, author=Towsta.author
8
8
  args.each {|k,v| self.send("#{k}=".to_sym, v)}
9
9
  self.save author
10
10
  end
@@ -13,7 +13,7 @@ module Towsta
13
13
  #to-do
14
14
  end
15
15
 
16
- def save creator=$towsta_default_author
16
+ def save creator=Towsta.author
17
17
  creator = author.email if author
18
18
  export = self.attributes
19
19
  export.delete :author
@@ -26,11 +26,11 @@ module Towsta
26
26
  @message = response[:message]
27
27
  self.id = response[:id] if response[:status]
28
28
  self.author = User.find_by_email creator
29
- Towsta::Memory.flush if $towsta_cache
29
+ Towsta::Memory.flush if production?
30
30
  response[:status]
31
31
  end
32
32
 
33
- def self.create args, creator=$towsta_default_author
33
+ def self.create args, creator=Towsta.author
34
34
  new = self.new(args.merge(:id => nil))
35
35
  new.save creator
36
36
  new
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 1
9
- version: 2.0.1
8
+ - 2
9
+ version: 2.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mortaro