extface 0.4.2 → 0.4.3a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/extface/jobs_controller.rb +7 -0
  3. data/app/models/extface/device.rb +5 -15
  4. data/app/models/extface/driver.rb +7 -7
  5. data/app/models/extface/driver/base/fiscal.rb +73 -3
  6. data/app/models/extface/driver/daisy_fx1200.rb +1 -1
  7. data/app/models/extface/driver/eltrade_tm_u220.rb +2 -2
  8. data/app/models/extface/job.rb +3 -0
  9. data/lib/extface/version.rb +1 -1
  10. metadata +5 -49
  11. data/test/dummy/db/development.sqlite3 +0 -0
  12. data/test/dummy/db/test.sqlite3 +0 -0
  13. data/test/dummy/log/development.log +0 -174
  14. data/test/dummy/log/test.log +0 -18751
  15. data/test/dummy/tmp/cache/assets/test/sprockets/0a8a23b1a73ebf217f4e2b765013ce7b +0 -0
  16. data/test/dummy/tmp/cache/assets/test/sprockets/21fb58a50e25d1170f2c7d5bd5d29c54 +0 -0
  17. data/test/dummy/tmp/cache/assets/test/sprockets/263375f2d55c31687ed052f99ddead55 +0 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/265c1a0ad735604fec09a30dc1b8b50f +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/3f4ff460a79b2e29781690193a3960f6 +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/4ef10b222fde3c042209a46daf3d3e36 +0 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/544650645bc510ef8fbee0043c41fdcf +0 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/6dbf2b0443792e51055710be15c83197 +0 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/717acb3e7c0df18696cf1bc56de6d3d5 +0 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/88b0a473a5770f601b60e2e38e180a0f +0 -0
  25. data/test/dummy/tmp/cache/assets/test/sprockets/9891cbb0808f38b2c42f42fd89e662a4 +0 -0
  26. data/test/dummy/tmp/cache/assets/test/sprockets/9b178820b9dc8c81c9784cf7ee3b7d35 +0 -0
  27. data/test/dummy/tmp/cache/assets/test/sprockets/a06a4a7f51754a6a2c0694eb39ff824b +0 -0
  28. data/test/dummy/tmp/cache/assets/test/sprockets/a8cc2e73253025d2518d2449e16e5266 +0 -0
  29. data/test/dummy/tmp/cache/assets/test/sprockets/b56dfad0b14283f2cc10c62f37d71cc7 +0 -0
  30. data/test/dummy/tmp/cache/assets/test/sprockets/e1197e0129ade843b08de0b45c47fc40 +0 -0
  31. data/test/dummy/tmp/cache/assets/test/sprockets/ece3270b150db7c668579bb91ac7e2e5 +0 -0
  32. data/test/dummy/tmp/cache/assets/test/sprockets/f018ab87f3490dbbcbc2e3c9f36aed3d +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06fc5a9c83af9cb726c1a38dc4a632e0375a9578
4
- data.tar.gz: da0439fc7a7f44e8f68239a7b459dfebc2dff649
3
+ metadata.gz: 9c81a7abc83c438c984b7e352c1f5d8bed35bb05
4
+ data.tar.gz: 5ab78479186b34233ae0bfd09f530455090c4d8c
5
5
  SHA512:
6
- metadata.gz: 7fe9d0589f060d96affd95141e93064cd0932ea69f2298fe2a215d2d1d6a65a1ccd22b2e03506a112181b4c799247d9a01091fe7150228addd4637c136d11329
7
- data.tar.gz: 2c1ee7ee842429c5c089ac8ccdb8859a8e27227be541851ceeee07c80841c20b83ef90b660814439b8b3a2baf44e9837969e67682c196f20d0b3f1afa666460e
6
+ metadata.gz: 27c63496efe8f40ef0a3b2803a1ec0e995bdbc28ca00f8b30fe1d130fb5c00bb4f0f364c5cd1de535b84ee5b0212cce59c3c2a12272ab869567de43a2fbd7bd2
7
+ data.tar.gz: ba7541aa69e1486527b5a89e3832c3cf61e0c689af6f6fafadaf6879d8b3d3c53983b2d7b99aa5cdf6e4422273c1c4420fcad1a0be510d8a8a9bfd13197e41d7
@@ -3,6 +3,13 @@ require_dependency "extface/application_controller"
3
3
  module Extface
4
4
  class JobsController < ApplicationController
5
5
  include ActionController::Live
6
+
7
+ skip_before_filter :include_extra_module
8
+ before_action :allow_cross_origin
9
+
10
+ def allow_cross_origin
11
+ headers['Access-Control-Allow-Origin'] = '*'
12
+ end
6
13
 
7
14
  def show
8
15
  response.headers['Content-Type'] = 'text/event-stream'
@@ -33,7 +33,9 @@ module Extface
33
33
 
34
34
  def session(description = nil)
35
35
  job = jobs.create!(description: description)
36
- Thread.new do
36
+ job.thread = Thread.new do
37
+ Thread.current[:extface_job] = job.id
38
+ ActiveRecord::Base.establish_connection unless ActiveRecord::Base.connection.active?
37
39
  begin
38
40
  raise 'No driver configured' unless driver.present?
39
41
  if driver.set_job(job)
@@ -49,23 +51,11 @@ module Extface
49
51
  end
50
52
  job.failed! e.message
51
53
  ensure
52
- ActiveRecord::Base.connection.close
54
+ ActiveRecord::Base.connection.close unless Thread.list.select{ |t| t[:extface_job].present? }.many?
53
55
  end
54
56
  end
55
57
  job
56
58
  end
57
-
58
- #initial billing module fiscalization support
59
- def fiscalize(billing_account, detailed = false)
60
-
61
- driver.sale_and_pay_items_session(
62
- [].tap() do |payments|
63
- billing_account.payments.each do |payment|
64
- payments << Extface::Driver::Base::Fiscal::SaleItem.new(price: payment.value.to_f, text1: payment.description)
65
- end
66
- end
67
- ) if billing_account.instance_of?(Billing::Bill) && billing_account.valid?
68
-
69
- end
59
+
70
60
  end
71
61
  end
@@ -47,14 +47,14 @@ module Extface
47
47
  def push(buffer)
48
48
  if @job
49
49
  #retry if current device job is not @job (waiting on queue)
50
- wait_on_queue = 20 #stop me writing endless things
51
- begin
52
- if current_device_job = device.jobs(true).active.try(:first)
53
- if current_device_job != @job
54
- #wait_on_queue = 20 #FIXME!
55
- p "#### current_job is not first_on_queue"
56
- end
50
+ wait_on_queue = 2 #stop me writing endless things
51
+ if current_device_job = device.jobs(true).active.try(:first)
52
+ if current_device_job != @job
53
+ wait_on_queue = 20 #FIXME!
54
+ p "#### current_job is not first_on_queue"
57
55
  end
56
+ end
57
+ begin
58
58
  Timeout.timeout(Extface.device_timeout) do
59
59
  Extface.redis_block do |r|
60
60
  r.subscribe(@job.id) do |on| #blocking until delivered
@@ -44,7 +44,8 @@ module Extface
44
44
  def open_fiscal_doc(operator = '', password = '') raise_not_implemented end
45
45
  def add_sale(sale_item) raise_not_implemented end #instance of Extface::Driver::Base::Fiscal::SaleItem
46
46
  def add_comment(text = '') raise_not_implemented end
47
- def add_payment(type_num, value = 0.00) raise_not_implemented end
47
+ def add_payment(value = nil, type_num = nil) raise_not_implemented end
48
+ def add_total_modifier(fixed_value = nil, percent_ratio = nil) raise_not_implemented end
48
49
  def total_payment() raise_not_implemented end #auto calculated total default payment
49
50
  def close_fiscal_doc() raise_not_implemented end
50
51
 
@@ -60,11 +61,11 @@ module Extface
60
61
  include ActiveModel::Validations
61
62
  attr_reader :price, # Float
62
63
  :text1, :text2, # String
63
- :tax_group, #Float
64
+ :tax_group, #Integer
64
65
  :qty, #Fixnum
65
66
  :percent, #Float
66
67
  :neto,
67
- :number #Fixnum
68
+ :number #Fixnum (Eltrade PLU code)
68
69
  def initialize(attributes)
69
70
  @price, @text1, @text2, @tax_group, @qty, @percent, @neto, @number = attributes[:price], attributes[:text1].to_s, attributes[:text2].to_s, attributes[:tax_group], attributes[:qty], attributes[:percent], attributes[:neto], attributes[:number]
70
71
  raise "invalid price" unless price.kind_of?(Float)
@@ -72,6 +73,75 @@ module Extface
72
73
  raise "invalid qty" if qty.present? && !qty.kind_of(Float)
73
74
  end
74
75
  end
76
+
77
+ def fiscalize(bill, detailed = false)
78
+ return nil unless bill.kind_of?(Billing::Bill) && bill.valid?
79
+ operator_mapping = bill.find_operator_mapping_for(self)
80
+ if detailed
81
+ device.session("Fiscal Doc") do |s|
82
+ s.notify "Fiscal Doc Start"
83
+ s.open_fiscal_doc(operator_mapping.try(:mapping), operator_mapping.try(:pwd))
84
+ s.notify "Register Sale"
85
+ bill.charges.each do |charge|
86
+ neto, percent_ratio = nil, nil, nil
87
+ if modifier = charge.modifier
88
+ neto = modifier.fixed_value
89
+ percent_ratio = modifier.percent_ratio unless neto.present?
90
+ end
91
+ if charge.price.zero? #printing comments with zero charges (TODO check zero charges allowed?)
92
+ s.add_comment charge.text
93
+ else
94
+ s.add_sale(
95
+ SaleItem.new(
96
+ price: charge.price.to_f,
97
+ text1: charge.name,
98
+ text2: charge.description,
99
+ tax_group: charge.find_tax_group_mapping_for(self), #find tax group mapping by ratio , not nice
100
+ qty: charge.qty,
101
+ neto: neto,
102
+ percent_ratio: percent_ratio #TODO check format
103
+ )
104
+ )
105
+ end
106
+ end
107
+ if global_modifier_value = bill.global_modifier_value
108
+ s.notify "Register Global Modifier"
109
+ s.add_total_modifier global_modifier_value.to_f
110
+ end
111
+ s.notify "Register Payment"
112
+ bill.payments.each do |payment|
113
+ s.add_payment payment.value.to_f, payment.find_payment_type_mapping_for(self)
114
+ end
115
+ s.notify "Close Fiscal Receipt"
116
+ s.close_fiscal_doc
117
+ s.notify "Fiscal Doc End"
118
+ end
119
+ else #not detailed
120
+ device.session("Fiscal Doc") do |s|
121
+ s.notify "Fiscal Doc Start"
122
+ s.open_fiscal_doc(operator_mapping.try(:mapping), operator_mapping.try(:pwd))
123
+ s.notify "Register Sale"
124
+ s.add_sale(
125
+ SaleItem.new(
126
+ price: bill.payments_sum.to_f,
127
+ text1: bill.name,
128
+ tax_group: bill.charges.first.find_tax_group_mapping_for(self), #find tax group mapping by ratio , not nice
129
+ )
130
+ )
131
+ if global_modifier_value = bill.global_modifier_value
132
+ s.notify "Register Global Modifier"
133
+ s.add_total_modifier global_modifier_value.to_f
134
+ end
135
+ s.notify "Register Payment"
136
+ bill.payments.each do |payment|
137
+ s.add_payment payment.value.to_f, payment.find_payment_type_mapping_for(self)
138
+ end
139
+ s.notify "Close Fiscal Receipt"
140
+ s.close_fiscal_doc
141
+ s.notify "Fiscal Doc End"
142
+ end
143
+ end
144
+ end
75
145
 
76
146
  private
77
147
  def raise_not_implemented
@@ -122,7 +122,7 @@ module Extface
122
122
  raise "Not in fiscal session" unless @fiscal_session
123
123
  end
124
124
 
125
- def add_payment(type_num)
125
+ def add_payment(value = nil, type_num = nil)
126
126
  raise "Not in fiscal session" unless @fiscal_session
127
127
  end
128
128
 
@@ -144,7 +144,7 @@ module Extface
144
144
  send_comment text
145
145
  end
146
146
 
147
- def add_payment(type_num = 0, value = nil) # 0, 1, 2, 3
147
+ def add_payment(value = nil, type_num = nil) # 0, 1, 2, 3
148
148
  raise "Not in fiscal session" unless @fiscal_session
149
149
  value_bytes = "\x00\x00\x00\x00" # recalculate
150
150
  unless value.nil?
@@ -152,7 +152,7 @@ module Extface
152
152
  value_bytes = "".b
153
153
  4.times{ |shift| value_bytes.insert 0, ((value_units >> shift*8) & 0xff).chr }
154
154
  end
155
- fsend Receipt::PRINT_RECEIPT, "" << (9 + type_num).chr << value_bytes
155
+ fsend Receipt::PRINT_RECEIPT, "" << (9 + (type_num || 0)).chr << value_bytes
156
156
  status = get_printer_status
157
157
  end
158
158
 
@@ -1,5 +1,7 @@
1
1
  module Extface
2
2
  class Job < ActiveRecord::Base
3
+ attr_accessor :thread
4
+
3
5
  belongs_to :device, inverse_of: :jobs
4
6
 
5
7
  scope :active, ->{ where(arel_table[:completed_at].eq(nil).and(arel_table[:failed_at].eq(nil))) }
@@ -18,6 +20,7 @@ module Extface
18
20
 
19
21
  def connected!
20
22
  unless connected?
23
+ p "device connected at #{Time.now}"
21
24
  self.connected_at = Time.now
22
25
  save!
23
26
  notify("Job #{self.id} device connected!")
@@ -1,3 +1,3 @@
1
1
  module Extface
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3a"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-28 00:00:00.000000000 Z
11
+ date: 2015-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -196,34 +196,12 @@ files:
196
196
  - test/dummy/config/initializers/wrap_parameters.rb
197
197
  - test/dummy/config/locales/en.yml
198
198
  - test/dummy/config/routes.rb
199
- - test/dummy/db/development.sqlite3
200
199
  - test/dummy/db/migrate/20140221203517_create_shops.rb
201
200
  - test/dummy/db/schema.rb
202
- - test/dummy/db/test.sqlite3
203
- - test/dummy/log/development.log
204
- - test/dummy/log/test.log
205
201
  - test/dummy/public/404.html
206
202
  - test/dummy/public/422.html
207
203
  - test/dummy/public/500.html
208
204
  - test/dummy/public/favicon.ico
209
- - test/dummy/tmp/cache/assets/test/sprockets/0a8a23b1a73ebf217f4e2b765013ce7b
210
- - test/dummy/tmp/cache/assets/test/sprockets/21fb58a50e25d1170f2c7d5bd5d29c54
211
- - test/dummy/tmp/cache/assets/test/sprockets/263375f2d55c31687ed052f99ddead55
212
- - test/dummy/tmp/cache/assets/test/sprockets/265c1a0ad735604fec09a30dc1b8b50f
213
- - test/dummy/tmp/cache/assets/test/sprockets/3f4ff460a79b2e29781690193a3960f6
214
- - test/dummy/tmp/cache/assets/test/sprockets/4ef10b222fde3c042209a46daf3d3e36
215
- - test/dummy/tmp/cache/assets/test/sprockets/544650645bc510ef8fbee0043c41fdcf
216
- - test/dummy/tmp/cache/assets/test/sprockets/6dbf2b0443792e51055710be15c83197
217
- - test/dummy/tmp/cache/assets/test/sprockets/717acb3e7c0df18696cf1bc56de6d3d5
218
- - test/dummy/tmp/cache/assets/test/sprockets/88b0a473a5770f601b60e2e38e180a0f
219
- - test/dummy/tmp/cache/assets/test/sprockets/9891cbb0808f38b2c42f42fd89e662a4
220
- - test/dummy/tmp/cache/assets/test/sprockets/9b178820b9dc8c81c9784cf7ee3b7d35
221
- - test/dummy/tmp/cache/assets/test/sprockets/a06a4a7f51754a6a2c0694eb39ff824b
222
- - test/dummy/tmp/cache/assets/test/sprockets/a8cc2e73253025d2518d2449e16e5266
223
- - test/dummy/tmp/cache/assets/test/sprockets/b56dfad0b14283f2cc10c62f37d71cc7
224
- - test/dummy/tmp/cache/assets/test/sprockets/e1197e0129ade843b08de0b45c47fc40
225
- - test/dummy/tmp/cache/assets/test/sprockets/ece3270b150db7c668579bb91ac7e2e5
226
- - test/dummy/tmp/cache/assets/test/sprockets/f018ab87f3490dbbcbc2e3c9f36aed3d
227
205
  - test/extface_test.rb
228
206
  - test/fixtures/extface/devices.yml
229
207
  - test/fixtures/extface/drivers.yml
@@ -258,12 +236,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
258
236
  version: '0'
259
237
  required_rubygems_version: !ruby/object:Gem::Requirement
260
238
  requirements:
261
- - - ">="
239
+ - - ">"
262
240
  - !ruby/object:Gem::Version
263
- version: '0'
241
+ version: 1.3.1
264
242
  requirements: []
265
243
  rubyforge_project:
266
- rubygems_version: 2.2.2
244
+ rubygems_version: 2.4.6
267
245
  signing_key:
268
246
  specification_version: 4
269
247
  summary: External Interfaces for Cloud-Based Applications (Rails 4)
@@ -277,30 +255,8 @@ test_files:
277
255
  - test/test_helper.rb
278
256
  - test/controllers/extface/devices_controller_test.rb
279
257
  - test/controllers/extface/jobs_controller_test.rb
280
- - test/dummy/tmp/cache/assets/test/sprockets/265c1a0ad735604fec09a30dc1b8b50f
281
- - test/dummy/tmp/cache/assets/test/sprockets/0a8a23b1a73ebf217f4e2b765013ce7b
282
- - test/dummy/tmp/cache/assets/test/sprockets/4ef10b222fde3c042209a46daf3d3e36
283
- - test/dummy/tmp/cache/assets/test/sprockets/ece3270b150db7c668579bb91ac7e2e5
284
- - test/dummy/tmp/cache/assets/test/sprockets/f018ab87f3490dbbcbc2e3c9f36aed3d
285
- - test/dummy/tmp/cache/assets/test/sprockets/e1197e0129ade843b08de0b45c47fc40
286
- - test/dummy/tmp/cache/assets/test/sprockets/b56dfad0b14283f2cc10c62f37d71cc7
287
- - test/dummy/tmp/cache/assets/test/sprockets/6dbf2b0443792e51055710be15c83197
288
- - test/dummy/tmp/cache/assets/test/sprockets/9b178820b9dc8c81c9784cf7ee3b7d35
289
- - test/dummy/tmp/cache/assets/test/sprockets/21fb58a50e25d1170f2c7d5bd5d29c54
290
- - test/dummy/tmp/cache/assets/test/sprockets/544650645bc510ef8fbee0043c41fdcf
291
- - test/dummy/tmp/cache/assets/test/sprockets/9891cbb0808f38b2c42f42fd89e662a4
292
- - test/dummy/tmp/cache/assets/test/sprockets/263375f2d55c31687ed052f99ddead55
293
- - test/dummy/tmp/cache/assets/test/sprockets/717acb3e7c0df18696cf1bc56de6d3d5
294
- - test/dummy/tmp/cache/assets/test/sprockets/3f4ff460a79b2e29781690193a3960f6
295
- - test/dummy/tmp/cache/assets/test/sprockets/a8cc2e73253025d2518d2449e16e5266
296
- - test/dummy/tmp/cache/assets/test/sprockets/88b0a473a5770f601b60e2e38e180a0f
297
- - test/dummy/tmp/cache/assets/test/sprockets/a06a4a7f51754a6a2c0694eb39ff824b
298
258
  - test/dummy/config.ru
299
- - test/dummy/log/development.log
300
- - test/dummy/log/test.log
301
- - test/dummy/db/development.sqlite3
302
259
  - test/dummy/db/migrate/20140221203517_create_shops.rb
303
- - test/dummy/db/test.sqlite3
304
260
  - test/dummy/db/schema.rb
305
261
  - test/dummy/README.rdoc
306
262
  - test/dummy/app/views/layouts/application.html.erb
Binary file
@@ -1,174 +0,0 @@
1
-  (102.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
-  (74.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
- Migrating to CreateShops (20140221203517)
5
-  (0.1ms) begin transaction
6
-  (0.5ms) CREATE TABLE "shops" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
7
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140221203517"]]
8
-  (107.8ms) commit transaction
9
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
- Migrating to CreateExtfaceDevices (20140215192111)
12
-  (0.1ms) begin transaction
13
-  (0.3ms) CREATE TABLE "extface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar(255), "name" varchar(255), "extfaceable_id" integer, "extfaceable_type" varchar(255), "driveable_id" integer, "driveable_type" varchar(255), "created_at" datetime, "updated_at" datetime) 
14
-  (0.1ms) CREATE INDEX "index_extface_devices_on_driveable_id_and_driveable_type" ON "extface_devices" ("driveable_id", "driveable_type")
15
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140215192111"]]
16
-  (117.0ms) commit transaction
17
- Migrating to CreateExtfacePosPrintDrivers (20140216110018)
18
-  (0.1ms) begin transaction
19
-  (0.4ms) CREATE TABLE "extface_pos_print_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
20
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216110018"]]
21
-  (95.8ms) commit transaction
22
- Migrating to CreateExtfaceSerialConfigs (20140216110608)
23
-  (0.1ms) begin transaction
24
-  (0.3ms) CREATE TABLE "extface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "s_configureable_id" integer, "s_configureable_type" varchar(255), "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime)
25
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216110608"]]
26
-  (80.0ms) commit transaction
27
- Migrating to CreateExtfaceRawDrivers (20140216131245)
28
-  (0.1ms) begin transaction
29
-  (0.4ms) CREATE TABLE "extface_raw_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
30
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216131245"]]
31
-  (79.5ms) commit transaction
32
- Migrating to CreateExtfaceFiscalPrintDrivers (20140216131457)
33
-  (0.1ms) begin transaction
34
-  (0.3ms) CREATE TABLE "extface_fiscal_print_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
35
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216131457"]]
36
-  (72.1ms) commit transaction
37
- Migrating to CreateExtfacePbxCdrDrivers (20140216134748)
38
-  (0.1ms) begin transaction
39
-  (0.3ms) CREATE TABLE "extface_pbx_cdr_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
40
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216134748"]]
41
-  (72.1ms) commit transaction
42
- Migrating to CreateExtfaceJobs (20140219091811)
43
-  (0.1ms) begin transaction
44
-  (0.3ms) CREATE TABLE "extface_jobs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "device_id" integer, "created_at" datetime, "updated_at" datetime)
45
-  (0.1ms) CREATE INDEX "index_extface_jobs_on_device_id" ON "extface_jobs" ("device_id")
46
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140219091811"]]
47
-  (79.8ms) commit transaction
48
- Migrating to AddJobInfoToExtfaceJobs (20140219175006)
49
-  (0.1ms) begin transaction
50
-  (19.5ms) ALTER TABLE "extface_jobs" ADD "description" varchar(255)
51
-  (0.3ms) ALTER TABLE "extface_jobs" ADD "error" varchar(255)
52
-  (0.2ms) ALTER TABLE "extface_jobs" ADD "failed_at" datetime
53
-  (0.3ms) ALTER TABLE "extface_jobs" ADD "completed_at" datetime
54
-  (0.3ms) ALTER TABLE "extface_jobs" ADD "connected_at" datetime
55
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140219175006"]]
56
-  (91.0ms) commit transaction
57
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
58
-  (102.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
59
-  (82.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
60
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
61
- Migrating to CreateShops (20140221203517)
62
-  (0.1ms) begin transaction
63
-  (0.6ms) CREATE TABLE "shops" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
64
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140221203517"]]
65
-  (79.7ms) commit transaction
66
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
67
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
68
- Migrating to CreateExtfaceDevices (20140215192111)
69
-  (0.1ms) begin transaction
70
-  (0.3ms) CREATE TABLE "extface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar(255), "name" varchar(255), "extfaceable_id" integer, "extfaceable_type" varchar(255), "driveable_id" integer, "driveable_type" varchar(255), "created_at" datetime, "updated_at" datetime) 
71
-  (0.1ms) CREATE INDEX "index_extface_devices_on_driveable_id_and_driveable_type" ON "extface_devices" ("driveable_id", "driveable_type")
72
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140215192111"]]
73
-  (127.1ms) commit transaction
74
- Migrating to CreateExtfacePosPrintDrivers (20140216110018)
75
-  (0.1ms) begin transaction
76
-  (0.3ms) CREATE TABLE "extface_pos_print_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
77
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216110018"]]
78
-  (96.4ms) commit transaction
79
- Migrating to CreateExtfaceSerialConfigs (20140216110608)
80
-  (0.1ms) begin transaction
81
-  (0.3ms) CREATE TABLE "extface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "s_configureable_id" integer, "s_configureable_type" varchar(255), "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime)
82
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216110608"]]
83
-  (96.2ms) commit transaction
84
- Migrating to CreateExtfaceRawDrivers (20140216131245)
85
-  (0.1ms) begin transaction
86
-  (0.3ms) CREATE TABLE "extface_raw_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
87
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216131245"]]
88
-  (95.9ms) commit transaction
89
- Migrating to CreateExtfaceFiscalPrintDrivers (20140216131457)
90
-  (0.1ms) begin transaction
91
-  (0.3ms) CREATE TABLE "extface_fiscal_print_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
92
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216131457"]]
93
-  (88.3ms) commit transaction
94
- Migrating to CreateExtfacePbxCdrDrivers (20140216134748)
95
-  (0.1ms) begin transaction
96
-  (0.3ms) CREATE TABLE "extface_pbx_cdr_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "created_at" datetime, "updated_at" datetime)
97
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140216134748"]]
98
-  (96.9ms) commit transaction
99
- Migrating to CreateExtfaceJobs (20140219091811)
100
-  (0.1ms) begin transaction
101
-  (0.3ms) CREATE TABLE "extface_jobs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "device_id" integer, "created_at" datetime, "updated_at" datetime)
102
-  (0.2ms) CREATE INDEX "index_extface_jobs_on_device_id" ON "extface_jobs" ("device_id")
103
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140219091811"]]
104
-  (87.6ms) commit transaction
105
- Migrating to AddJobInfoToExtfaceJobs (20140219175006)
106
-  (0.1ms) begin transaction
107
-  (0.4ms) ALTER TABLE "extface_jobs" ADD "description" varchar(255)
108
-  (0.3ms) ALTER TABLE "extface_jobs" ADD "error" varchar(255)
109
-  (0.2ms) ALTER TABLE "extface_jobs" ADD "failed_at" datetime
110
-  (0.2ms) ALTER TABLE "extface_jobs" ADD "completed_at" datetime
111
-  (0.3ms) ALTER TABLE "extface_jobs" ADD "connected_at" datetime
112
- SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140219175006"]]
113
-  (177.5ms) commit transaction
114
- Migrating to CreateExtfaceDrivers (20140303112124)
115
-  (0.1ms) begin transaction
116
-  (0.3ms) CREATE TABLE "extface_drivers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "type" varchar(255), "settings" text, "created_at" datetime, "updated_at" datetime) 
117
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140303112124"]]
118
-  (79.8ms) commit transaction
119
- Migrating to DropSeparateDriverTypeTables (20140303113217)
120
-  (0.1ms) begin transaction
121
-  (0.2ms) DROP TABLE "extface_pos_print_drivers"
122
-  (0.2ms) DROP TABLE "extface_raw_drivers"
123
-  (0.2ms) DROP TABLE "extface_fiscal_print_drivers"
124
-  (0.1ms) DROP TABLE "extface_pbx_cdr_drivers"
125
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140303113217"]]
126
-  (91.1ms) commit transaction
127
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
128
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
129
- Migrating to ChangeDriverPolymorphicToBelongsToExtfaceDevices (20140303122506)
130
-  (0.1ms) begin transaction
131
-  (0.3ms) DROP INDEX "index_extface_devices_on_driveable_id_and_driveable_type"
132
-  (0.3ms) CREATE TEMPORARY TABLE "aextface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar(255), "name" varchar(255), "extfaceable_id" integer, "extfaceable_type" varchar(255), "driveable_id" integer, "driveable_type" varchar(255), "created_at" datetime, "updated_at" datetime)
133
-  (0.1ms) SELECT * FROM "extface_devices"
134
-  (0.2ms) DROP TABLE "extface_devices"
135
-  (0.1ms) CREATE TABLE "extface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar(255), "name" varchar(255), "extfaceable_id" integer, "extfaceable_type" varchar(255), "driveable_id" integer, "created_at" datetime, "updated_at" datetime) 
136
-  (0.1ms) SELECT * FROM "aextface_devices"
137
-  (0.1ms) DROP TABLE "aextface_devices"
138
-  (0.1ms) CREATE TEMPORARY TABLE "aextface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar(255), "name" varchar(255), "extfaceable_id" integer, "extfaceable_type" varchar(255), "driver_id" integer, "created_at" datetime, "updated_at" datetime)
139
-  (0.1ms) SELECT * FROM "extface_devices"
140
-  (0.1ms) DROP TABLE "extface_devices"
141
-  (0.1ms) CREATE TABLE "extface_devices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "uuid" varchar(255), "name" varchar(255), "extfaceable_id" integer, "extfaceable_type" varchar(255), "driver_id" integer, "created_at" datetime, "updated_at" datetime) 
142
-  (0.1ms) SELECT * FROM "aextface_devices"
143
-  (0.1ms) DROP TABLE "aextface_devices"
144
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140303122506"]]
145
-  (118.8ms) commit transaction
146
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
147
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
148
- Migrating to ChangePolymorphicToHasOneToExtfaceSerialConfigs (20140303123022)
149
-  (0.1ms) begin transaction
150
-  (0.4ms) CREATE TEMPORARY TABLE "aextface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "s_configureable_id" integer, "s_configureable_type" varchar(255), "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime) 
151
-  (0.1ms) SELECT * FROM "extface_serial_configs"
152
-  (0.2ms) DROP TABLE "extface_serial_configs"
153
-  (0.1ms) CREATE TABLE "extface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "s_configureable_id" integer, "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime)
154
-  (0.1ms) SELECT * FROM "aextface_serial_configs"
155
-  (0.1ms) DROP TABLE "aextface_serial_configs"
156
-  (0.1ms) CREATE TEMPORARY TABLE "aextface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "driver_id" integer, "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime) 
157
-  (0.1ms) SELECT * FROM "extface_serial_configs"
158
-  (0.2ms) DROP TABLE "extface_serial_configs"
159
-  (0.2ms) CREATE TABLE "extface_serial_configs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "driver_id" integer, "serial_boud_rate" integer, "serial_data_length" integer, "serial_parity_check" integer, "serial_stop_bits" integer, "serial_handshake" integer, "created_at" datetime, "updated_at" datetime)
160
-  (0.1ms) SELECT * FROM "aextface_serial_configs"
161
-  (0.2ms) DROP TABLE "aextface_serial_configs"
162
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140303123022"]]
163
-  (146.1ms) commit transaction
164
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
165
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
166
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
167
-  (0.3ms)  SELECT sql
168
- FROM sqlite_master
169
- WHERE name='index_extface_jobs_on_device_id' AND type='index'
170
- UNION ALL
171
- SELECT sql
172
- FROM sqlite_temp_master
173
- WHERE name='index_extface_jobs_on_device_id' AND type='index'
174
-