zuora_connect 0.0.9.3.3 → 0.0.9.3.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4924c0d75878a3b31e5fb95229460435d2b2d37c
4
- data.tar.gz: 79b75fd3fc967171522123926a4914eef55f0272
3
+ metadata.gz: 87b1366862b0a9cdeb1e9ac498bbc7c768799ead
4
+ data.tar.gz: e60795ed8bad5d7f79355942e36529eee2a5e774
5
5
  SHA512:
6
- metadata.gz: f62f2dddbad985b3c867edcb7c2e04cac413167f981c3b9009eea3a9d75fa22f8d9ce3e2e1e1613d1c4bb974d19d5d475c6d9022a94bb40a51d704a676e549b1
7
- data.tar.gz: c05b2586bca743fddd1d7cee334a5f71fd9b5b6bc16a77994a12477a27fa2b954c25219570ea798529d8be646a6f6080d0807601f4500fdf630a2b0d08041e90
6
+ metadata.gz: bd17ce708b1796cd36b42a41be760b626128657fb1f904bd2615711554cf85b802ae509f7c4eb439eda61ca5cb0cb6a90f17d9b90a1c662982e06eaf3a466dfb
7
+ data.tar.gz: 325ec4e2b04c0b654bbcf8ed990bf180815917755cea8a1ed752a6e66189c9c77838f8476c5a20bbb2e7156daf1d841fe86a8f5d14fc11854cdf406ecda09734
@@ -8,8 +8,12 @@ module ZuoraConnect
8
8
  @options = Hash.new
9
9
  @logins = Hash.new
10
10
  @valid = false
11
- Apartment::Migrator.migrate(self.id)
11
+ self.attr_builder("timezone", ZuoraConnect.configuration.default_time_zone)
12
+ self.attr_builder("locale", ZuoraConnect.configuration.default_locale)
12
13
  Apartment::Tenant.switch!(self.id)
14
+ if( ActiveRecord::Migration.check_pending! != nil)
15
+ Apartment::Migrator.migrate(self.id)
16
+ end
13
17
  Thread.current[:appinstance] = self
14
18
  end
15
19
 
@@ -40,6 +44,8 @@ module ZuoraConnect
40
44
  build_task(session["#{self.id}::task_data"], session)
41
45
  end
42
46
  end
47
+ I18n.locale = self.locale
48
+ Time.zone = self.timezone
43
49
  @valid = true
44
50
  end
45
51
 
@@ -86,6 +92,9 @@ module ZuoraConnect
86
92
  v.each do |opt|
87
93
  @options[opt["config_name"]] = opt
88
94
  end
95
+ elsif k == "user_settings"
96
+ self.timezone = v["timezone"]
97
+ self.locale = v["local"]
89
98
  end
90
99
  end
91
100
  end
@@ -3,9 +3,6 @@ class CreateConnectAppInstances < ActiveRecord::Migration
3
3
  if !ActiveRecord::Base.connection.table_exists?('zuora_connect_app_instances')
4
4
  create_table :zuora_connect_app_instances do |t|
5
5
  t.timestamps null: false
6
- t.string "access_token"
7
- t.string "token"
8
- t.string "refresh_token"
9
6
  end
10
7
  end
11
8
  end
@@ -0,0 +1,6 @@
1
+ class AddTokensToAppInstance < ActiveRecord::Migration
2
+ def change
3
+ add_column :zuora_connect_app_instances, :access_token, :string unless column_exists? :zuora_connect_app_instances, :access_token
4
+ add_column :zuora_connect_app_instances, :refresh_token, :string unless column_exists? :zuora_connect_app_instances, :refresh_token
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddTokenToAppInstance < ActiveRecord::Migration
2
+ def change
3
+ add_column :zuora_connect_app_instances, :token, :string unless column_exists? :zuora_connect_app_instances, :token
4
+ end
5
+ end
@@ -32,8 +32,8 @@ module ZuoraConnect
32
32
  setup_instance_via_dev_mode
33
33
  end
34
34
  @appinstance.new_session(:session =>instance_data_lookup(@appinstance.id, @appinstance.access_token))
35
- I18n.locale = session["#{@appinstance.id}::user::locale"] ? session["#{@appinstance.id}::user::locale"] : ZuoraConnect.configuration.default_locale
36
- Time.zone = session["#{@appinstance.id}::user::timezone"] ? session["#{@appinstance.id}::user::timezone"] : ZuoraConnect.configuration.default_time_zone
35
+ I18n.locale = session["#{@appinstance.id}::user::locale"] ? session["#{@appinstance.id}::user::locale"] : @appinstance.locale
36
+ Time.zone = session["#{@appinstance.id}::user::timezone"] ? session["#{@appinstance.id}::user::timezone"] : @appinstance.timezone
37
37
  end
38
38
 
39
39
  def persist_connect_app_session
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "0.0.9.3.3"
2
+ VERSION = "0.0.9.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.3.3
4
+ version: 0.0.9.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-22 00:00:00.000000000 Z
11
+ date: 2016-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -127,6 +127,8 @@ files:
127
127
  - config/initializers/apartment.rb
128
128
  - config/routes.rb
129
129
  - db/migrate/20160718151733_create_connect_app_instances.rb
130
+ - db/migrate/20161024162319_add_tokens_to_app_instance.rb
131
+ - db/migrate/20161024220705_add_token_to_app_instance.rb
130
132
  - lib/tasks/zuora_connect_tasks.rake
131
133
  - lib/zuora_connect.rb
132
134
  - lib/zuora_connect/configuration.rb