effective_qb_sync 1.2.5 → 1.3.3

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
- SHA1:
3
- metadata.gz: 43612a3ecae089133d3d11843f19f2f2a3ee8df0
4
- data.tar.gz: fc1eaa19e17c4ea44b67264133d236e2b3abc4f1
2
+ SHA256:
3
+ metadata.gz: df7032f4abbef9c241bd2eebf383aecfc6c6c918d006d60046799e90a200d294
4
+ data.tar.gz: ccdfce8884cda0205388fc28f8d4d39da869d2556bb449eff7932552745cf0bd
5
5
  SHA512:
6
- metadata.gz: 31d43e814efc239fe97545411ac78d67d311f2a48ee989de54fe1f57a2c29851f5ea7503ea950009b36a032382fc15824076f45befd66309ee4d31d6ae32e72b
7
- data.tar.gz: 6972c74d52dc685fa9d580fa58a2895b29178ef34ccbec0f73295db7c4314cbf55ffd0225334c6c2af63a41021a349380514c64dbf4796ecf32bb5669948c84c
6
+ metadata.gz: 9851e05ca234f5ed7d569d58534e1293a07142cbbfc5623da0a9451aec18691cd583094dab6071adcac2321055c7ad09820582e55e6010496114b03433a2a45b
7
+ data.tar.gz: 550920e68a8d65c7a2aa22b75b618d3e472bdc288c885da6d2f125e1aee924873be7719ee3be1a1d9b4fdc1e1463df56ed11eef6d30c8bc6704f7847eaa0a946
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2018 Code and Effect Inc.
1
+ Copyright 2021 Code and Effect Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,13 +1,16 @@
1
1
  module Admin
2
2
  class QbSyncsController < ApplicationController
3
- before_action :authenticate_user!
4
- before_action :restrict_access
3
+ before_action(:authenticate_user!) if defined?(Devise)
4
+ before_action { EffectiveResources.authorize!(self, :admin, :effective_qb_sync) }
5
5
 
6
- layout (EffectiveQbSync.layout.kind_of?(Hash) ? EffectiveQbSync.layout[:admin_qb_tickets] : EffectiveQbSync.layout)
6
+ include Effective::CrudController
7
+
8
+ if (config = EffectiveQbSync.layout)
9
+ layout(config.kind_of?(Hash) ? config[:admin] : config)
10
+ end
7
11
 
8
12
  def index
9
13
  @datatable = EffectiveQbSyncDatatable.new(self)
10
-
11
14
  @page_title = 'Quickbooks Synchronizations'
12
15
  end
13
16
 
@@ -23,7 +26,7 @@ module Admin
23
26
  @page_title = "Quickbooks Sync ##{@qb_ticket.id}"
24
27
 
25
28
  @qb_order_items_form = Effective::QbOrderItemsForm.new(id: @qb_ticket.id, orders: @qb_ticket.orders)
26
- @qb_order_items_form.qb_order_items_attributes = permitted_qb_order_items_params[:qb_order_items_attributes].values
29
+ @qb_order_items_form.qb_order_items_attributes = permitted_params[:qb_order_items_attributes].values
27
30
 
28
31
  if @qb_order_items_form.save
29
32
  flash[:success] = 'Successfully updated Quickbooks item names'
@@ -39,7 +42,7 @@ module Admin
39
42
  end
40
43
 
41
44
  def qwc
42
- @filename = Rails.application.class.parent_name.downcase + '.qwc'
45
+ @filename = EffectiveQbSync.qwc_name.parameterize + '.qwc'
43
46
 
44
47
  response.headers['Content-Disposition'] = "attachment; filename=\"#{@filename}\""
45
48
 
@@ -70,12 +73,11 @@ module Admin
70
73
 
71
74
  private
72
75
 
73
- def restrict_access
74
- EffectiveQbSync.authorize!(self, :admin, :effective_qb_sync)
76
+ def permitted_params
77
+ params.require(:effective_qb_order_items_form).permit(
78
+ :id, qb_order_items_attributes: [:name, :id, :order_item_id]
79
+ )
75
80
  end
76
81
 
77
- def permitted_qb_order_items_params
78
- params.require(:effective_qb_order_items_form).permit(:id, qb_order_items_attributes: [:name, :id, :order_item_id])
79
- end
80
82
  end
81
83
  end
@@ -3,7 +3,7 @@ class EffectiveQbSyncDatatable < Effective::Datatable
3
3
  order :created_at, :desc
4
4
 
5
5
  col :created_at
6
- col :state, search: { collection: Effective::QbTicket::STATES }
6
+ col :state
7
7
 
8
8
  val :num_orders, visible: false do |qb_ticket|
9
9
  qb_ticket.qb_requests.length
@@ -24,11 +24,14 @@ class EffectiveQbSyncDatatable < Effective::Datatable
24
24
  end
25
25
  end
26
26
 
27
- actions_col partial: 'admin/qb_syncs/actions', partial_as: :qb_sync
27
+ actions_col do |qb_ticket|
28
+ dropdown_link_to 'Show', effective_qb_sync.admin_qb_sync_path(qb_ticket)
29
+ end
30
+
28
31
  end
29
32
 
30
33
  collection do
31
- Effective::QbTicket.includes(qb_requests: :order)
34
+ Effective::QbTicket.deep.all
32
35
  end
33
36
 
34
37
  end
@@ -2,9 +2,10 @@ module Effective
2
2
  class QbLog < ActiveRecord::Base
3
3
  belongs_to :qb_ticket
4
4
 
5
- # Attributes
6
- # message :text
7
- # timestamps
5
+ effective_resource do
6
+ message :text
7
+ timestamps
8
+ end
8
9
 
9
10
  validates :qb_ticket, presence: true
10
11
  validates :message, presence: true
@@ -27,17 +27,17 @@ module Effective
27
27
 
28
28
  unless authentication_valid?(username, password)
29
29
  log "Authentication failed for user #{username}"
30
- @ticket.update_attributes!(username: username, state: 'Finished', last_error: @last_log_message)
30
+ @ticket.update!(username: username, state: 'Finished', last_error: @last_log_message)
31
31
  return 'nvu' # not valid user
32
32
  end
33
33
 
34
34
  if has_work?
35
35
  log "Authentication successful. Reporting to QuickBooks that there is work to be done."
36
- @ticket.update_attributes!(username: username, state: 'Authenticated')
36
+ @ticket.update!(username: username, state: 'Authenticated')
37
37
  '' # "Any other string value = use this name for company file"
38
38
  else
39
39
  log "Authentication successful, but there is no work to be done"
40
- @ticket.update_attributes!(username: username, state: 'Finished')
40
+ @ticket.update!(username: username, state: 'Finished')
41
41
  'none'
42
42
  end
43
43
  end
@@ -58,7 +58,7 @@ module Effective
58
58
  return '' unless valid?
59
59
 
60
60
  # update the ticket with the metadata sent at the first request for XML (i.e. if not blank)
61
- @ticket.update_attributes!(
61
+ @ticket.update!(
62
62
  hpc_response: (@ticket.hpc_response || params[:hcpresponse]),
63
63
  company_file_name: (@ticket.company_file_name || params[:company]),
64
64
  country: (@ticket.country || params[:country]),
@@ -82,13 +82,13 @@ module Effective
82
82
  # if we don't have a request, then we are done.
83
83
  unless request
84
84
  log "There is no more work to be done. Marking ticket state as finished"
85
- @ticket.update_attributes!(state: 'Finished')
85
+ @ticket.update!(state: 'Finished')
86
86
  return ''
87
87
  end
88
88
 
89
- request.update_attributes!(qb_ticket: @ticket, request_sent_at: Time.zone.now)
89
+ request.update!(qb_ticket: @ticket, request_sent_at: Time.zone.now)
90
90
  qb_xml = request.to_qb_xml
91
- request.update_attributes!(request_qbxml: qb_xml)
91
+ request.update!(request_qbxml: qb_xml)
92
92
 
93
93
  # set the ticket into a Processing state
94
94
  @ticket.state = 'Processing'
@@ -134,7 +134,7 @@ module Effective
134
134
 
135
135
  # also update the request if it is able to be found
136
136
  request = find_outstanding_request(responseXML)
137
- request.update_attributes!(response_qbxml: responseXML, state: 'Error') if request
137
+ request.update!(response_qbxml: responseXML, state: 'Error') if request
138
138
 
139
139
  return -1
140
140
  end
@@ -161,12 +161,12 @@ module Effective
161
161
  unless request.consume_response_xml(responseXML)
162
162
  # this request for some reason did not succeeed. Update the request and the ticket
163
163
  log "Request [#{request.state}] could not process the QuickBooks response: #{request.error}"
164
- request.update_attributes!(response_qbxml: responseXML, state: 'Error')
164
+ request.update!(response_qbxml: responseXML, state: 'Error')
165
165
  @ticket.error! @last_log_message
166
166
  return -1
167
167
  end
168
168
 
169
- request.update_attributes!(response_qbxml: responseXML) # This was changed for effective_qb_sync
169
+ request.update!(response_qbxml: responseXML) # This was changed for effective_qb_sync
170
170
 
171
171
  # the request has processed the response XML. if it does not have any more work to do, then detach it
172
172
 
@@ -174,7 +174,7 @@ module Effective
174
174
  log "Request [#{request.state}] has more work to do on the next request"
175
175
  else
176
176
  # detach the current request
177
- @ticket.update_attributes!(qb_request: nil)
177
+ @ticket.update!(qb_request: nil)
178
178
  log "Request [#{request.state}] has completed its work"
179
179
  end
180
180
 
@@ -214,7 +214,7 @@ module Effective
214
214
  def op_close_connection
215
215
  return 'Close error: invalid ticket' unless valid?
216
216
 
217
- @ticket.update_attributes!(state: 'Finished') unless ['ConnectionError', 'RequestError'].include?(@ticket.state)
217
+ @ticket.update!(state: 'Finished') unless ['ConnectionError', 'RequestError'].include?(@ticket.state)
218
218
  log "Closed connection with QuickBooks"
219
219
 
220
220
  'OK'
@@ -253,8 +253,13 @@ module Effective
253
253
  protected
254
254
 
255
255
  # determines if this username and password is valid
256
+ # username is optional depending on your config file
256
257
  def authentication_valid?(username,password)
257
- Array(EffectiveQbSync.quickbooks_username).include?(username) && Array(EffectiveQbSync.quickbooks_password).include?(password)
258
+ if EffectiveQbSync.quickbooks_username.present?
259
+ return false unless Array(EffectiveQbSync.quickbooks_username).include?(username)
260
+ end
261
+
262
+ Array(EffectiveQbSync.quickbooks_password).include?(password)
258
263
  end
259
264
 
260
265
  # returns how much more work is to be done. If there is no more work to be done, it will return 0, else,
@@ -2,9 +2,10 @@ module Effective
2
2
  class QbOrderItem < ActiveRecord::Base
3
3
  belongs_to :order_item
4
4
 
5
- # Attributes
6
- # name :string
7
- # timestamps
5
+ effective_resource do
6
+ name :string
7
+ timestamps
8
+ end
8
9
 
9
10
  validates :order_item, presence: true
10
11
  validates :name, presence: true
@@ -9,17 +9,20 @@ module Effective
9
9
  COMPLETED_STATES = ['Finished', 'Error']
10
10
  PROCESSING_STATES = ['Processing', 'CustomerQuery', 'CreateCustomer', 'OrderSync']
11
11
 
12
- # Attributes
13
- # request_qbxml :text
14
- # response_qbxml :text
12
+ effective_resource do
13
+ state :string
14
+ error :text
15
15
 
16
- # request_sent_at :datetime
17
- # response_received_at :datetime
16
+ request_type :string
18
17
 
19
- # state :string
20
- # error :text
18
+ request_qbxml :text
19
+ response_qbxml :text
21
20
 
22
- # timestamps
21
+ request_sent_at :datetime
22
+ response_received_at :datetime
23
+
24
+ timestamps
25
+ end
23
26
 
24
27
  validates :state, inclusion: { in: COMPLETED_STATES + PROCESSING_STATES }
25
28
  validates :qb_ticket, presence: true
@@ -60,7 +63,7 @@ module Effective
60
63
  # parses the response XML and processes it.
61
64
  # returns true if the responseXML indicates success, false otherwise
62
65
  def consume_response_xml(xml)
63
- update_attributes!(response_qbxml: xml)
66
+ update!(response_qbxml: xml)
64
67
  handle_response_xml(xml)
65
68
  end
66
69
 
@@ -113,7 +116,7 @@ module Effective
113
116
  # transitions the request state and also outputs a log statement
114
117
  def transition_state(state)
115
118
  old_state = self.state
116
- update_attributes!(state: state)
119
+ update!(state: state)
117
120
  log "Transitioned request state from [#{old_state}] to [#{state}]"
118
121
  end
119
122
 
@@ -1,34 +1,37 @@
1
1
  module Effective
2
2
  class QbTicket < ActiveRecord::Base
3
- belongs_to :qb_request # the current request
3
+ belongs_to :qb_request, optional: true # the current request. Only optional when set_all_orders_finished
4
4
  has_many :qb_requests
5
5
  has_many :orders, through: :qb_requests
6
6
  has_many :qb_logs
7
7
 
8
8
  STATES = ['Ready', 'Authenticated', 'Processing', 'Finished', 'ConnectionError', 'RequestError']
9
9
 
10
- # Attributes
11
- # username :string
12
- # company_file_name :string
13
- # country :string
10
+ effective_resource do
11
+ username :string
12
+ company_file_name :string
13
+ country :string
14
14
 
15
- # qbxml_major_version :string
16
- # qbxml_minor_version :string
15
+ qbxml_major_version :string
16
+ qbxml_minor_version :string
17
17
 
18
- # state :string, default: 'Ready'
19
- # percent :integer
18
+ state :string # , default: 'Ready'
19
+ percent :integer
20
20
 
21
- # hpc_response :text
22
- # connection_error_hresult :text
23
- # connection_error_message :text
24
- # last_error :text
21
+ hpc_response :text
22
+ connection_error_hresult :text
23
+ connection_error_message :text
24
+ last_error :text
25
25
 
26
- # timestamps
26
+ timestamps
27
+ end
28
+
29
+ scope :deep, -> { includes(qb_requests: :order) }
27
30
 
28
31
  validates :state, inclusion: { in: STATES }
29
32
 
30
33
  def request_error!(error, atts={})
31
- self.error!(error, atts.reverse_merge({state: 'RequestError'}))
34
+ self.error!(error, atts.reverse_merge(state: 'RequestError'))
32
35
  end
33
36
 
34
37
  # This is the entry point for a standard error.
@@ -39,9 +42,9 @@ module Effective
39
42
  to: EffectiveQbSync.error_email,
40
43
  subject: "Quickbooks failed to synchronize order ##{qb_request.try(:order).try(:to_param) || 'unknown'}",
41
44
  template: 'qb_sync_error'
42
- ).public_send(EffectiveOrders.mailer[:deliver_method])
45
+ ).deliver_now
43
46
 
44
- self.update_attributes!(atts.reverse_merge({last_error: error}))
47
+ update!(atts.reverse_merge(last_error: error))
45
48
  end
46
49
 
47
50
  # persists a new log message to this ticket
@@ -8,11 +8,7 @@
8
8
  %td= value
9
9
 
10
10
  %h3 Orders
11
-
12
- - if defined?(EffectiveBootstrap)
13
- = render 'form', qb_order_items_form: @qb_order_items_form, qb_ticket: @qb_ticket
14
- - else
15
- = render 'simple_form', qb_order_items_form: @qb_order_items_form, qb_ticket: @qb_ticket
11
+ = render 'form', qb_order_items_form: @qb_order_items_form, qb_ticket: @qb_ticket
16
12
 
17
13
  %h3 Sync Log
18
14
 
@@ -1,8 +1,8 @@
1
1
  <QBWCXML>
2
- <AppName><%= Rails.application.class.parent_name.upcase %> Web Connector</AppName>
2
+ <AppName><%= EffectiveQbSync.qwc_name.upcase %> Web Connector</AppName>
3
3
  <AppID>{<%= SecureRandom.uuid.upcase %>}</AppID>
4
4
  <AppURL><%= effective_qb_sync.qb_sync_url(protocol: 'https') %></AppURL>
5
- <AppDescription><%= Rails.application.class.parent_name.upcase %> EffectiveOrders to Quickbooks Web Connector</AppDescription>
5
+ <AppDescription><%= EffectiveQbSync.qwc_name.upcase %> EffectiveOrders to Quickbooks Web Connector</AppDescription>
6
6
  <AppSupport><%= root_url(protocol: 'https') %></AppSupport>
7
7
  <UserName><%= EffectiveQbSync.quickbooks_username || 'MISSING' %></UserName>
8
8
  <OwnerID>{<%= SecureRandom.uuid.upcase %>}</OwnerID>
@@ -5,36 +5,10 @@ EffectiveQbSync.setup do |config|
5
5
  config.qb_logs_table_name = :qb_logs
6
6
  config.qb_order_items_table_name = :qb_order_items
7
7
 
8
- # Authorization Method
9
- #
10
- # This method is called by all controller actions with the appropriate action and resource
11
- # If the method returns false, an Effective::AccessDenied Error will be raised (see README.md for complete info)
12
- #
13
- # Use via Proc (and with CanCan):
14
- # config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) }
15
- #
16
- # Use via custom method:
17
- # config.authorization_method = :my_authorization_method
18
- #
19
- # And then in your application_controller.rb:
20
- #
21
- # def my_authorization_method(action, resource)
22
- # current_user.is?(:admin)
23
- # end
24
- #
25
- # Or disable the check completely:
26
- # config.authorization_method = false
27
- config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCanCan
28
-
29
- # All EffectiveQbSync controllers will use this layout
30
- config.layout = 'application'
31
-
32
- # SimpleForm Options
33
- # This Hash of options will be passed into any admin facing simple_form_for() calls
34
- config.admin_simple_form_options = {} # For the /admin/qb_syncs form
8
+ # Layout Settings
9
+ # config.layout = { admin: 'admin' }
35
10
 
36
11
  # Quickbooks Company File Settings
37
-
38
12
  # The username / password of the Quickbooks user that should be allowed to synchronize.
39
13
  # This must match the user configured in the Quickbooks .qwc file
40
14
  config.quickbooks_username = ''
data/config/routes.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  EffectiveQbSync::Engine.routes.draw do
2
- scope :module => 'effective' do
2
+ scope module: 'effective' do
3
3
  match 'quickbooks/api', to: 'qb_sync#api', as: 'qb_sync', via: :all
4
4
  end
5
5
 
@@ -2,28 +2,10 @@ module EffectiveQbSync
2
2
  class Engine < ::Rails::Engine
3
3
  engine_name 'effective_qb_sync'
4
4
 
5
- config.autoload_paths += Dir["#{config.root}/app/models/**/"]
6
-
7
5
  # Set up our default configuration options.
8
6
  initializer "effective_qb_sync.defaults", before: :load_config_initializers do |app|
9
7
  eval File.read("#{config.root}/config/effective_qb_sync.rb")
10
8
  end
11
9
 
12
- # Include acts_as_addressable concern and allow any ActiveRecord object to call it
13
- initializer 'effective_qb_sync.active_record' do |app|
14
- Rails.application.config.to_prepare do
15
- ActiveSupport.on_load :active_record do
16
- Effective::OrderItem.class_eval do
17
- has_one :qb_order_item
18
-
19
- # first or build
20
- def qb_item_name
21
- (qb_order_item || build_qb_order_item(name: purchasable.qb_item_name)).name
22
- end
23
- end
24
- end
25
- end
26
- end
27
-
28
10
  end
29
11
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveQbSync
2
- VERSION = '1.2.5'.freeze
2
+ VERSION = '1.3.3'.freeze
3
3
  end
@@ -1,48 +1,22 @@
1
+ require 'effective_resources'
1
2
  require 'effective_orders'
2
3
  require 'effective_qb_sync/engine'
3
4
  require 'effective_qb_sync/version'
4
5
 
5
6
  module EffectiveQbSync
6
- # The following are all valid config keys
7
- mattr_accessor :qb_requests_table_name
8
- mattr_accessor :qb_tickets_table_name
9
- mattr_accessor :qb_logs_table_name
10
- mattr_accessor :qb_order_items_table_name
11
7
 
12
- mattr_accessor :authorization_method
13
-
14
- mattr_accessor :quickbooks_username
15
- mattr_accessor :quickbooks_password
16
- mattr_accessor :quickbooks_tax_name
17
-
18
- mattr_accessor :error_email
19
-
20
- mattr_accessor :layout
21
- mattr_accessor :admin_simple_form_options
22
-
23
- def self.setup
24
- yield self
25
- end
26
-
27
- def self.authorized?(controller, action, resource)
28
- @_exceptions ||= [Effective::AccessDenied, (CanCan::AccessDenied if defined?(CanCan)), (Pundit::NotAuthorizedError if defined?(Pundit))].compact
29
-
30
- return !!authorization_method unless authorization_method.respond_to?(:call)
31
- controller = controller.controller if controller.respond_to?(:controller)
32
-
33
- begin
34
- !!(controller || self).instance_exec((controller || self), action, resource, &authorization_method)
35
- rescue *@_exceptions
36
- false
37
- end
8
+ def self.config_keys
9
+ [
10
+ :qb_requests_table_name, :qb_tickets_table_name, :qb_logs_table_name, :qb_order_items_table_name,
11
+ :quickbooks_username, :quickbooks_password, :quickbooks_tax_name,
12
+ :layout, :error_email
13
+ ]
38
14
  end
39
15
 
40
- def self.authorize!(controller, action, resource)
41
- raise Effective::AccessDenied.new('Access Denied', action, resource) unless authorized?(controller, action, resource)
42
- end
16
+ include EffectiveGem
43
17
 
44
18
  def self.permitted_params
45
- [:note]
19
+ @permitted_params ||= [:note]
46
20
  end
47
21
 
48
22
  def self.skip_order!(order)
@@ -72,4 +46,8 @@ module EffectiveQbSync
72
46
  true
73
47
  end
74
48
 
49
+ def self.qwc_name
50
+ (defined?(Tenant) ? Tenant.current.to_s : Rails.application.class.parent_name).downcase
51
+ end
52
+
75
53
  end
@@ -209,7 +209,7 @@ describe Effective::QbMachine, "Sending Request qbXML to QuickBooks (op_send_req
209
209
  end
210
210
 
211
211
  it "should transition ticket to the RequestError state if the ticket is not in the Authenticated or Processing states" do
212
- @qb_machine.ticket.update_attributes!(state: 'Finished')
212
+ @qb_machine.ticket.update!(state: 'Finished')
213
213
  @qb_machine.op_send_request_xml(@default_request_params)
214
214
  @qb_machine.ticket.state.should eql('RequestError')
215
215
  end
@@ -314,25 +314,25 @@ describe Effective::QbMachine, "Receiving response qbXML from QuickBooks (op_rec
314
314
  end
315
315
 
316
316
  it "should return -1 to indicate error if the ticket state is not in the Processing state" do
317
- @qb_machine.ticket.update_attributes! :state=>'Finished'
317
+ @qb_machine.ticket.update! :state=>'Finished'
318
318
  result = @qb_machine.op_receive_response_xml(@default_response_params)
319
319
  result.should eql(-1)
320
320
  end
321
321
 
322
322
  it "should set the ticket state to RequestError if the ticket state was previously Authenticated" do
323
- @qb_machine.ticket.update_attributes! :state=>'Authenticated'
323
+ @qb_machine.ticket.update! :state=>'Authenticated'
324
324
  @qb_machine.op_receive_response_xml(@default_response_params)
325
325
  @qb_machine.ticket.state.should eql('RequestError')
326
326
  end
327
327
 
328
328
  it "should set the ticket state to RequestError if the ticket state was previously Ready" do
329
- @qb_machine.ticket.update_attributes! :state=>'Ready'
329
+ @qb_machine.ticket.update! :state=>'Ready'
330
330
  @qb_machine.op_receive_response_xml(@default_response_params)
331
331
  @qb_machine.ticket.state.should eql('RequestError')
332
332
  end
333
333
 
334
334
  it "should set the ticket state to RequestError if the ticket state was previously Finished" do
335
- @qb_machine.ticket.update_attributes! :state=>'Finished'
335
+ @qb_machine.ticket.update! :state=>'Finished'
336
336
  @qb_machine.op_receive_response_xml(@default_response_params)
337
337
  @qb_machine.ticket.state.should eql('RequestError')
338
338
  end
@@ -487,7 +487,7 @@ describe Effective::QbMachine, "Receiving a request from the QBWC to provide the
487
487
  before :each do
488
488
  @qb_machine = Effective::QbMachine.new
489
489
  @last_error = 'What?'
490
- @qb_machine.ticket.update_attributes! :last_error=>@last_error
490
+ @qb_machine.ticket.update! :last_error=>@last_error
491
491
  end
492
492
 
493
493
  it "should return the last error" do
@@ -495,11 +495,11 @@ describe Effective::QbMachine, "Receiving a request from the QBWC to provide the
495
495
  end
496
496
 
497
497
  it "should return '' if the last error is blank" do
498
- @qb_machine.ticket.update_attributes! :last_error=>nil
498
+ @qb_machine.ticket.update! :last_error=>nil
499
499
  error = @qb_machine.op_last_error
500
500
  error.should eql('')
501
501
 
502
- @qb_machine.ticket.update_attributes! :last_error=>''
502
+ @qb_machine.ticket.update! :last_error=>''
503
503
  error = @qb_machine.op_last_error
504
504
  error.should eql('')
505
505
  end
@@ -513,42 +513,40 @@ describe Effective::QbMachine, "Closing the connection (op_close_connection)" do
513
513
  end
514
514
 
515
515
  it "should not transition ticket state on close_connection if state is Finished" do
516
- @qb_machine.ticket.update_attributes! :state=>'Finished'
516
+ @qb_machine.ticket.update! :state=>'Finished'
517
517
  @qb_machine.op_close_connection
518
518
  @qb_machine.ticket.state.should eql('Finished')
519
519
  end
520
520
 
521
521
  it "should not transition ticket state on close_connection if state is ConnectionError" do
522
- @qb_machine.ticket.update_attributes! :state=>'ConnectionError'
522
+ @qb_machine.ticket.update! :state=>'ConnectionError'
523
523
  @qb_machine.op_close_connection
524
524
  @qb_machine.ticket.state.should eql('ConnectionError')
525
525
  end
526
526
 
527
527
  it "should not transition ticket state on close_connection if state is RequestError" do
528
- @qb_machine.ticket.update_attributes! :state=>'RequestError'
528
+ @qb_machine.ticket.update! :state=>'RequestError'
529
529
  @qb_machine.op_close_connection
530
530
  @qb_machine.ticket.state.should eql('RequestError')
531
531
  end
532
532
 
533
533
  it "should transition ticket state to Finished if state is Ready " do
534
- @qb_machine.ticket.update_attributes! :state=>'Ready'
534
+ @qb_machine.ticket.update! :state=>'Ready'
535
535
  @qb_machine.op_close_connection
536
536
  @qb_machine.ticket.state.should eql('Finished')
537
537
  end
538
538
 
539
539
  it "should transition ticket state to Finished if state is Authenticated" do
540
- @qb_machine.ticket.update_attributes! :state=>'Authenticated'
540
+ @qb_machine.ticket.update! :state=>'Authenticated'
541
541
  @qb_machine.op_close_connection
542
542
  @qb_machine.ticket.state.should eql('Finished')
543
543
  end
544
544
 
545
545
  it "should transition ticket state to Finished if state is Processing" do
546
- @qb_machine.ticket.update_attributes! :state=>'Processing'
546
+ @qb_machine.ticket.update! :state=>'Processing'
547
547
  @qb_machine.op_close_connection
548
548
  @qb_machine.ticket.state.should eql('Finished')
549
549
  end
550
550
 
551
551
 
552
552
  end
553
-
554
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_qb_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-04 00:00:00.000000000 Z
11
+ date: 2021-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -25,35 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: coffee-rails
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: jquery-rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: devise
28
+ name: nokogiri
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
31
  - - ">="
@@ -67,7 +39,7 @@ dependencies:
67
39
  - !ruby/object:Gem::Version
68
40
  version: '0'
69
41
  - !ruby/object:Gem::Dependency
70
- name: nokogiri
42
+ name: effective_resources
71
43
  requirement: !ruby/object:Gem::Requirement
72
44
  requirements:
73
45
  - - ">="
@@ -81,7 +53,7 @@ dependencies:
81
53
  - !ruby/object:Gem::Version
82
54
  version: '0'
83
55
  - !ruby/object:Gem::Dependency
84
- name: sass-rails
56
+ name: effective_datatables
85
57
  requirement: !ruby/object:Gem::Requirement
86
58
  requirements:
87
59
  - - ">="
@@ -120,7 +92,6 @@ files:
120
92
  - app/controllers/admin/qb_syncs_controller.rb
121
93
  - app/controllers/effective/qb_sync_controller.rb
122
94
  - app/datatables/effective_qb_sync_datatable.rb
123
- - app/models/effective/access_denied.rb
124
95
  - app/models/effective/qb_log.rb
125
96
  - app/models/effective/qb_machine.rb
126
97
  - app/models/effective/qb_order_item.rb
@@ -128,10 +99,8 @@ files:
128
99
  - app/models/effective/qb_request.rb
129
100
  - app/models/effective/qb_ticket.rb
130
101
  - app/models/effective/qbwc_supervisor.rb
131
- - app/views/admin/qb_syncs/_actions.html.haml
132
102
  - app/views/admin/qb_syncs/_form.html.haml
133
103
  - app/views/admin/qb_syncs/_qb_item_names.html.haml
134
- - app/views/admin/qb_syncs/_simple_form.html.haml
135
104
  - app/views/admin/qb_syncs/index.html.haml
136
105
  - app/views/admin/qb_syncs/instructions.html.haml
137
106
  - app/views/admin/qb_syncs/show.html.haml
@@ -192,8 +161,6 @@ files:
192
161
  - spec/dummy/config/secrets.yml
193
162
  - spec/dummy/db/schema.rb
194
163
  - spec/dummy/db/test.sqlite3
195
- - spec/dummy/log/development.log
196
- - spec/dummy/log/test.log
197
164
  - spec/dummy/public/404.html
198
165
  - spec/dummy/public/422.html
199
166
  - spec/dummy/public/500.html
@@ -211,7 +178,7 @@ homepage: https://github.com/code-and-effect/effective_qb_sync
211
178
  licenses:
212
179
  - MIT
213
180
  metadata: {}
214
- post_install_message:
181
+ post_install_message:
215
182
  rdoc_options: []
216
183
  require_paths:
217
184
  - lib
@@ -226,62 +193,59 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
193
  - !ruby/object:Gem::Version
227
194
  version: '0'
228
195
  requirements: []
229
- rubyforge_project:
230
- rubygems_version: 2.4.5.1
231
- signing_key:
196
+ rubygems_version: 3.1.2
197
+ signing_key:
232
198
  specification_version: 4
233
199
  summary: Synchronize EffectiveOrders with QuickBooks Web Connector.
234
200
  test_files:
235
- - spec/dummy/app/assets/javascripts/application.js
236
- - spec/dummy/app/assets/stylesheets/application.css
237
- - spec/dummy/app/controllers/application_controller.rb
238
- - spec/dummy/app/helpers/application_helper.rb
201
+ - spec/spec_helper.rb
239
202
  - spec/dummy/app/models/product.rb
240
203
  - spec/dummy/app/models/product_with_float_price.rb
241
204
  - spec/dummy/app/models/user.rb
205
+ - spec/dummy/app/controllers/application_controller.rb
242
206
  - spec/dummy/app/views/layouts/application.html.erb
207
+ - spec/dummy/app/assets/javascripts/application.js
208
+ - spec/dummy/app/assets/stylesheets/application.css
209
+ - spec/dummy/app/helpers/application_helper.rb
210
+ - spec/dummy/bin/rake
243
211
  - spec/dummy/bin/bundle
244
212
  - spec/dummy/bin/rails
245
- - spec/dummy/bin/rake
246
- - spec/dummy/config/application.rb
247
- - spec/dummy/config/boot.rb
248
- - spec/dummy/config/database.yml
249
- - spec/dummy/config/environment.rb
250
- - spec/dummy/config/environments/development.rb
213
+ - spec/dummy/config/secrets.yml
214
+ - spec/dummy/config/routes.rb
215
+ - spec/dummy/config/locales/en.yml
251
216
  - spec/dummy/config/environments/production.rb
217
+ - spec/dummy/config/environments/development.rb
252
218
  - spec/dummy/config/environments/test.rb
219
+ - spec/dummy/config/environment.rb
220
+ - spec/dummy/config/application.rb
221
+ - spec/dummy/config/database.yml
222
+ - spec/dummy/config/boot.rb
253
223
  - spec/dummy/config/initializers/backtrace_silencers.rb
254
- - spec/dummy/config/initializers/cookies_serializer.rb
255
- - spec/dummy/config/initializers/devise.rb
224
+ - spec/dummy/config/initializers/mime_types.rb
256
225
  - spec/dummy/config/initializers/effective_addresses.rb
257
- - spec/dummy/config/initializers/effective_orders.rb
258
- - spec/dummy/config/initializers/effective_qb_sync.rb
259
226
  - spec/dummy/config/initializers/filter_parameter_logging.rb
260
- - spec/dummy/config/initializers/inflections.rb
261
- - spec/dummy/config/initializers/mime_types.rb
262
227
  - spec/dummy/config/initializers/session_store.rb
263
- - spec/dummy/config/initializers/simple_form.rb
264
228
  - spec/dummy/config/initializers/wrap_parameters.rb
265
- - spec/dummy/config/locales/en.yml
266
- - spec/dummy/config/routes.rb
267
- - spec/dummy/config/secrets.yml
229
+ - spec/dummy/config/initializers/effective_qb_sync.rb
230
+ - spec/dummy/config/initializers/cookies_serializer.rb
231
+ - spec/dummy/config/initializers/devise.rb
232
+ - spec/dummy/config/initializers/effective_orders.rb
233
+ - spec/dummy/config/initializers/simple_form.rb
234
+ - spec/dummy/config/initializers/inflections.rb
268
235
  - spec/dummy/config.ru
269
- - spec/dummy/db/schema.rb
270
- - spec/dummy/db/test.sqlite3
271
- - spec/dummy/log/development.log
272
- - spec/dummy/log/test.log
273
- - spec/dummy/public/404.html
236
+ - spec/dummy/Rakefile
237
+ - spec/dummy/public/favicon.ico
274
238
  - spec/dummy/public/422.html
275
239
  - spec/dummy/public/500.html
276
- - spec/dummy/public/favicon.ico
277
- - spec/dummy/Rakefile
240
+ - spec/dummy/public/404.html
241
+ - spec/dummy/db/schema.rb
242
+ - spec/dummy/db/test.sqlite3
278
243
  - spec/dummy/README.rdoc
279
- - spec/fixtures/qbxml_response_error.xml
280
- - spec/fixtures/qbxml_response_success.xml
281
- - spec/models/acts_as_purchasable_spec.rb
282
- - spec/models/factories_spec.rb
283
- - spec/models/qb_machine_spec.rb
284
244
  - spec/models/qb_request_spec.rb
285
245
  - spec/models/qb_ticket_spec.rb
286
- - spec/spec_helper.rb
246
+ - spec/models/qb_machine_spec.rb
247
+ - spec/models/factories_spec.rb
248
+ - spec/models/acts_as_purchasable_spec.rb
287
249
  - spec/support/factories.rb
250
+ - spec/fixtures/qbxml_response_success.xml
251
+ - spec/fixtures/qbxml_response_error.xml
@@ -1,17 +0,0 @@
1
- unless defined?(Effective::AccessDenied)
2
- module Effective
3
- class AccessDenied < StandardError
4
- attr_reader :action, :subject
5
-
6
- def initialize(message = nil, action = nil, subject = nil)
7
- @message = message
8
- @action = action
9
- @subject = subject
10
- end
11
-
12
- def to_s
13
- @message || I18n.t(:'unauthorized.default', :default => 'Access Denied')
14
- end
15
- end
16
- end
17
- end
@@ -1,8 +0,0 @@
1
- - show_path = effective_qb_sync.admin_qb_sync_path(qb_sync)
2
-
3
- - if defined?(EffectiveBootstrap)
4
- = dropdown(variation: :dropleft) do
5
- = dropdown_link_to 'View', show_path
6
- - else
7
- = link_to show_path, title: 'View' do
8
- %span.glyphicon.glyphicon-eye-open
@@ -1,19 +0,0 @@
1
- = simple_form_for qb_order_items_form, (EffectiveOrders.admin_simple_form_options || {}).merge(url: effective_qb_sync.admin_qb_sync_path(qb_order_items_form)) do |f|
2
- %table.table
3
- %thead
4
- %tr
5
- %th Order
6
- %th Order Item
7
- %th Quickbooks Item Name
8
- %tbody
9
- - qb_ticket.orders.each do |order|
10
- - order.order_items.each_with_index do |order_item, index|
11
- %tr
12
- %td= (link_to(('#' + order.to_param.to_s), effective_orders.admin_order_path(order)) if index == 0)
13
- %td= order_item
14
- %td
15
- = f.simple_fields_for :qb_order_items, order_item.qb_order_item do |foi|
16
- = foi.input :order_item_id, as: :hidden, value: order_item.id
17
- = foi.input :name, label: false, required: false
18
-
19
- %p= f.button :submit, 'Save Quickbooks Item Names', data: { disable_with: 'Saving...' }
@@ -1,90 +0,0 @@
1
-  (17.9ms) CREATE TABLE "qb_logs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "qb_ticket_id" integer, "message" text, "created_at" datetime, "updated_at" datetime) 
2
-  (0.1ms) select sqlite_version(*)
3
-  (1.1ms) CREATE INDEX "index_qb_logs_on_qb_ticket_id" ON "qb_logs" ("qb_ticket_id")
4
-  (1.2ms) CREATE TABLE "qb_order_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_item_id" integer, "name" varchar, "created_at" datetime, "updated_at" datetime)
5
-  (1.1ms) CREATE INDEX "index_qb_order_items_on_order_item_id" ON "qb_order_items" ("order_item_id")
6
-  (1.0ms) CREATE TABLE "qb_requests" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "qb_ticket_id" integer, "state" varchar DEFAULT 'Processing', "error" text, "request_type" varchar, "request_qbxml" text, "response_qbxml" text, "request_sent_at" datetime, "response_received_at" datetime, "created_at" datetime, "updated_at" datetime)
7
-  (1.0ms) CREATE INDEX "index_qb_requests_on_order_id" ON "qb_requests" ("order_id")
8
-  (1.0ms) CREATE TABLE "qb_tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "qb_request_id" integer, "username" varchar, "hpc_response" text, "company_file_name" varchar, "country" varchar, "qbxml_major_version" varchar, "qbxml_minor_version" varchar, "state" varchar DEFAULT 'Ready', "percent" integer DEFAULT 0, "connection_error_hresult" text, "connection_error_message" text, "last_error" text, "created_at" datetime, "updated_at" datetime)
9
-  (0.8ms) CREATE INDEX "index_qb_tickets_on_qb_request_id" ON "qb_tickets" ("qb_request_id")
10
-  (1.0ms) CREATE TABLE "addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_type" varchar, "addressable_id" integer, "category" varchar(64), "full_name" varchar, "address1" varchar, "address2" varchar, "city" varchar, "state_code" varchar, "country_code" varchar, "postal_code" varchar, "updated_at" datetime, "created_at" datetime)
11
-  (0.9ms) CREATE INDEX "index_addresses_on_addressable_id" ON "addresses" ("addressable_id")
12
-  (0.1ms) SELECT sql
13
- FROM sqlite_master
14
- WHERE name='index_addresses_on_addressable_id' AND type='index'
15
- UNION ALL
16
- SELECT sql
17
- FROM sqlite_temp_master
18
- WHERE name='index_addresses_on_addressable_id' AND type='index'
19
-
20
-  (0.8ms) CREATE INDEX "index_addresses_on_addressable_type_and_addressable_id" ON "addresses" ("addressable_type", "addressable_id")
21
-  (0.9ms) CREATE TABLE "cart_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "cart_id" integer, "purchasable_type" varchar, "purchasable_id" integer, "quantity" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
22
-  (1.2ms) CREATE INDEX "index_cart_items_on_cart_id" ON "cart_items" ("cart_id")
23
-  (0.1ms) SELECT sql
24
- FROM sqlite_master
25
- WHERE name='index_cart_items_on_cart_id' AND type='index'
26
- UNION ALL
27
- SELECT sql
28
- FROM sqlite_temp_master
29
- WHERE name='index_cart_items_on_cart_id' AND type='index'
30
-
31
-  (1.1ms) CREATE INDEX "index_cart_items_on_purchasable_id" ON "cart_items" ("purchasable_id")
32
-  (0.1ms) SELECT sql
33
- FROM sqlite_master
34
- WHERE name='index_cart_items_on_purchasable_id' AND type='index'
35
- UNION ALL
36
- SELECT sql
37
- FROM sqlite_temp_master
38
- WHERE name='index_cart_items_on_purchasable_id' AND type='index'
39
-
40
-  (0.1ms)  SELECT sql
41
- FROM sqlite_master
42
- WHERE name='index_cart_items_on_cart_id' AND type='index'
43
- UNION ALL
44
- SELECT sql
45
- FROM sqlite_temp_master
46
- WHERE name='index_cart_items_on_cart_id' AND type='index'
47
- 
48
-  (0.9ms) CREATE INDEX "index_cart_items_on_purchasable_type_and_purchasable_id" ON "cart_items" ("purchasable_type", "purchasable_id")
49
-  (1.0ms) CREATE TABLE "carts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
50
-  (0.9ms) CREATE INDEX "index_carts_on_user_id" ON "carts" ("user_id")
51
-  (0.8ms) CREATE TABLE "custom_products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "price" integer DEFAULT 0, "tax_exempt" boolean, "created_at" datetime, "updated_at" datetime) 
52
-  (1.0ms) CREATE TABLE "customers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "stripe_customer_id" varchar, "stripe_active_card" varchar, "stripe_connect_access_token" varchar, "created_at" datetime, "updated_at" datetime)
53
-  (2.2ms) CREATE TABLE "order_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "order_id" integer, "seller_id" integer, "purchasable_type" varchar, "purchasable_id" integer, "title" varchar, "quantity" integer, "price" integer DEFAULT 0, "tax_exempt" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
54
-  (1.1ms) CREATE INDEX "index_order_items_on_order_id" ON "order_items" ("order_id")
55
-  (0.1ms)  SELECT sql
56
- FROM sqlite_master
57
- WHERE name='index_order_items_on_order_id' AND type='index'
58
- UNION ALL
59
- SELECT sql
60
- FROM sqlite_temp_master
61
- WHERE name='index_order_items_on_order_id' AND type='index'
62
- 
63
-  (0.9ms) CREATE INDEX "index_order_items_on_purchasable_id" ON "order_items" ("purchasable_id")
64
-  (0.1ms)  SELECT sql
65
- FROM sqlite_master
66
- WHERE name='index_order_items_on_purchasable_id' AND type='index'
67
- UNION ALL
68
- SELECT sql
69
- FROM sqlite_temp_master
70
- WHERE name='index_order_items_on_purchasable_id' AND type='index'
71
- 
72
-  (0.1ms) SELECT sql
73
- FROM sqlite_master
74
- WHERE name='index_order_items_on_order_id' AND type='index'
75
- UNION ALL
76
- SELECT sql
77
- FROM sqlite_temp_master
78
- WHERE name='index_order_items_on_order_id' AND type='index'
79
-
80
-  (1.0ms) CREATE INDEX "index_order_items_on_purchasable_type_and_purchasable_id" ON "order_items" ("purchasable_type", "purchasable_id")
81
-  (1.1ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "purchase_state" varchar, "purchased_at" datetime, "payment" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL, "note" text, "total" integer, "tax_rate" decimal(6,3), "subtotal" integer, "tax" integer, "payment_provider" varchar, "payment_card" varchar)
82
-  (1.8ms) CREATE INDEX "index_orders_on_user_id" ON "orders" ("user_id")
83
-  (0.8ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "price" integer DEFAULT 0, "tax_exempt" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
84
-  (0.9ms) CREATE TABLE "product_with_float_prices" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar, "price" decimal DEFAULT 0, "tax_exempt" boolean, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
85
-  (1.0ms) CREATE TABLE "subscriptions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "customer_id" integer, "stripe_plan_id" varchar, "stripe_subscription_id" varchar, "stripe_coupon_id" varchar, "title" varchar, "price" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime)
86
-  (1.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "encrypted_password" varchar, "reset_password_token" varchar, "reset_password_sent_at" datetime, "remember_created_at" datetime, "confirmation_sent_at" datetime, "confirmed_at" datetime, "confirmation_token" varchar, "unconfirmed_email" varchar, "sign_in_count" integer DEFAULT 0, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar, "last_sign_in_ip" varchar, "email" varchar, "roles_mask" integer DEFAULT 0, "archived" boolean DEFAULT 'f', "updated_at" datetime, "created_at" datetime) 
87
-  (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
88
-  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
89
-  (0.1ms) SELECT version FROM "schema_migrations"
90
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('5')
@@ -1 +0,0 @@
1
-  (0.5ms) SELECT MAX("orders"."id") FROM "orders"