rhosync 2.1.17.beta6 → 2.1.17.beta7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -9,7 +9,8 @@
9
9
  * #28328057 - Feature Request: Adding a Bulk Data Job after_perform hook from Zendesk ticket #2367
10
10
  * Empty cud hash to trigger processing of the queued data (Zendesk #2383)
11
11
  * Revert fix for Zendesk ticket #2336 by customer request
12
- * #28094895 - Zendesk ticket #2354: Bulk sync not updating sources table (fields 'last_inserted_size' and 'backend_refresh_time' now updated)
12
+ * #28094895 - Zendesk ticket #2354: Bulk sync not updating sources table (fields 'last_inserted_size' and 'backend_refresh_time' now updated)
13
+ * #29796429 - Zendesk ticket #2447: use list to preserve bulk data sources order
13
14
 
14
15
  ## 2.1.16
15
16
  * revert rack support for v. 1.4.1 and lock to v. 1.3.6 due to problems with Heroku deployment (Rack 1.4.1 produces 502 error)
@@ -9,7 +9,7 @@ module Rhosync
9
9
  field :user_id, :string
10
10
  field :refresh_time, :integer
11
11
  field :dbfile,:string
12
- set :sources, :string
12
+ list :sources, :string
13
13
  validates_presence_of :app_id, :user_id, :sources
14
14
 
15
15
  def completed?
@@ -20,7 +20,7 @@ module Rhosync
20
20
  end
21
21
 
22
22
  def delete
23
- sources.members.each do |source|
23
+ sources[0, -1].each do |source|
24
24
  s = Source.load(source,{:app_id => app_id, :user_id => user_id})
25
25
  Store.flash_data(s.docname(:md_copy)) if s
26
26
  end
@@ -28,7 +28,7 @@ module Rhosync
28
28
  end
29
29
 
30
30
  def process_sources
31
- sources.members.each do |source|
31
+ sources[0, -1].each do |source|
32
32
  s = Source.load(source,{:app_id => app_id, :user_id => user_id})
33
33
  if s
34
34
  SourceSync.new(s).process_query(nil)
@@ -160,7 +160,7 @@ module Rhosync
160
160
  db = SQLite3::Database.new(bulk_data.dbfile)
161
161
  db.execute_batch(File.open(schema,'r').read)
162
162
  src_counter = 1
163
- bulk_data.sources.members.sort.each do |source_name|
163
+ bulk_data.sources[0, -1].each do |source_name|
164
164
  timer = start_timer("start importing sqlite data for #{source_name}")
165
165
  source = Source.load(source_name,{:app_id => bulk_data.app_id,
166
166
  :user_id => bulk_data.user_id})
@@ -1,3 +1,3 @@
1
1
  module Rhosync
2
- VERSION = '2.1.17.beta6'
2
+ VERSION = '2.1.17.beta7'
3
3
  end
@@ -60,6 +60,19 @@ describe "BulkData" do
60
60
  BulkData.get_name(:app,@c.user_id).should ==
61
61
  File.join(@a_fields[:name],@a_fields[:name])
62
62
  end
63
+
64
+ it "should have ordered sources list" do
65
+ data = BulkData.create(:name => bulk_data_docname(@a.id,@u.id),
66
+ :state => :inprogress,
67
+ :app_id => @a.id,
68
+ :user_id => @u.id,
69
+ :sources => @a.partition_sources(:user, @u.id))
70
+ data.sources[0, -1].should == ["SampleAdapter", "FixedSchemaAdapter"]
71
+ end
72
+
73
+ it "should have ordered sources list by priority" do
74
+ pending
75
+ end
63
76
 
64
77
  it "should process_sources for bulk data" do
65
78
  current = Time.now.to_i
data/spec/spec_helper.rb CHANGED
@@ -102,7 +102,7 @@ module TestHelpers
102
102
  end
103
103
 
104
104
  def validate_db(bulk_data,data)
105
- validate_db_file(bulk_data.dbfile,bulk_data.sources.members,data)
105
+ validate_db_file(bulk_data.dbfile,bulk_data.sources[0, -1],data)
106
106
  end
107
107
 
108
108
  def validate_db_file(dbfile,sources,data)
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhosync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196343
4
+ hash: 62196341
5
5
  prerelease: 7
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
9
  - 17
10
10
  - beta
11
- - 6
12
- version: 2.1.17.beta6
11
+ - 7
12
+ version: 2.1.17.beta7
13
13
  platform: ruby
14
14
  authors:
15
15
  - Rhomobile