tb_checkout 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +162 -0
  4. data/Rakefile +24 -0
  5. data/app/assets/images/tb_checkout/admin/shopping_carts.png +0 -0
  6. data/app/assets/images/tb_checkout/admin/transactions.png +0 -0
  7. data/app/assets/javascripts/tb_checkout/admin/carts.js +2 -0
  8. data/app/assets/javascripts/tb_checkout/admin/transactions.js +2 -0
  9. data/app/assets/javascripts/tb_checkout/application.js +13 -0
  10. data/app/assets/javascripts/tb_checkout/cart_items.js +2 -0
  11. data/app/assets/javascripts/tb_checkout/carts.js +2 -0
  12. data/app/assets/javascripts/tb_checkout/transactions.js +2 -0
  13. data/app/assets/stylesheets/tb_checkout/admin/carts.css +4 -0
  14. data/app/assets/stylesheets/tb_checkout/admin/transactions.css +4 -0
  15. data/app/assets/stylesheets/tb_checkout/application.css +15 -0
  16. data/app/assets/stylesheets/tb_checkout/cart_items.css +4 -0
  17. data/app/assets/stylesheets/tb_checkout/carts.css +4 -0
  18. data/app/assets/stylesheets/tb_checkout/transactions.css +4 -0
  19. data/app/controllers/concerns/tb_checkout/controller_helpers.rb +16 -0
  20. data/app/controllers/tb_checkout/admin/carts_controller.rb +39 -0
  21. data/app/controllers/tb_checkout/admin/transactions_controller.rb +26 -0
  22. data/app/controllers/tb_checkout/application_controller.rb +6 -0
  23. data/app/controllers/tb_checkout/cart_items_controller.rb +63 -0
  24. data/app/controllers/tb_checkout/carts_controller.rb +8 -0
  25. data/app/controllers/tb_checkout/transactions_controller.rb +87 -0
  26. data/app/helpers/tb_checkout/admin/carts_helper.rb +13 -0
  27. data/app/helpers/tb_checkout/admin/transactions_helper.rb +16 -0
  28. data/app/helpers/tb_checkout/application_helper.rb +138 -0
  29. data/app/helpers/tb_checkout/transactions_helper.rb +2 -0
  30. data/app/models/concerns/tb_checkout/belongs_to_user_session.rb +15 -0
  31. data/app/models/concerns/tb_checkout/purchasable.rb +81 -0
  32. data/app/models/tb_checkout/basic_product.rb +6 -0
  33. data/app/models/tb_checkout/cart.rb +56 -0
  34. data/app/models/tb_checkout/cart_item.rb +48 -0
  35. data/app/models/tb_checkout/transaction.rb +253 -0
  36. data/app/views/tb_checkout/admin/carts/index.html.erb +54 -0
  37. data/app/views/tb_checkout/admin/carts/show.html.erb +45 -0
  38. data/app/views/tb_checkout/admin/transactions/_table.html.erb +24 -0
  39. data/app/views/tb_checkout/admin/transactions/index.html.erb +7 -0
  40. data/app/views/tb_checkout/admin/transactions/show.html.erb +70 -0
  41. data/app/views/tb_checkout/cart_items/create.html.erb +2 -0
  42. data/app/views/tb_checkout/cart_items/destroy.html.erb +2 -0
  43. data/app/views/tb_checkout/cart_items/update.html.erb +2 -0
  44. data/app/views/tb_checkout/carts/_cart.html.erb +65 -0
  45. data/app/views/tb_checkout/carts/show.html.erb +10 -0
  46. data/app/views/tb_checkout/transactions/_details.html.erb +17 -0
  47. data/app/views/tb_checkout/transactions/confirm.html.erb +11 -0
  48. data/app/views/tb_checkout/transactions/index.html.erb +29 -0
  49. data/app/views/tb_checkout/transactions/new.html.erb +90 -0
  50. data/app/views/tb_checkout/transactions/show.html.erb +14 -0
  51. data/config/locales/en.yml +23 -0
  52. data/config/routes.rb +20 -0
  53. data/db/migrate/20140703185256_create_tb_checkout_carts.rb +12 -0
  54. data/db/migrate/20140703185258_create_tb_checkout_cart_items.rb +15 -0
  55. data/db/migrate/20140703185259_create_tb_checkout_transactions.rb +23 -0
  56. data/db/migrate/20140707142350_create_tb_checkout_basic_products.rb +8 -0
  57. data/db/migrate/20140915202848_add_spud_user_and_session_id_to_transactions.rb +10 -0
  58. data/lib/tasks/tb_checkout_tasks.rake +19 -0
  59. data/lib/tb_checkout.rb +4 -0
  60. data/lib/tb_checkout/configuration.rb +8 -0
  61. data/lib/tb_checkout/engine.rb +36 -0
  62. data/lib/tb_checkout/schema.rb +51 -0
  63. data/lib/tb_checkout/version.rb +3 -0
  64. data/spec/controllers/tb_checkout/carts_controller_spec.rb +11 -0
  65. data/spec/controllers/tb_checkout/transactions_controller_spec.rb +110 -0
  66. data/spec/dummy/README.rdoc +28 -0
  67. data/spec/dummy/Rakefile +6 -0
  68. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  69. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  70. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  71. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  72. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  73. data/spec/dummy/bin/bundle +3 -0
  74. data/spec/dummy/bin/rails +4 -0
  75. data/spec/dummy/bin/rake +4 -0
  76. data/spec/dummy/config.ru +4 -0
  77. data/spec/dummy/config/application.rb +30 -0
  78. data/spec/dummy/config/boot.rb +5 -0
  79. data/spec/dummy/config/database.yml +13 -0
  80. data/spec/dummy/config/environment.rb +5 -0
  81. data/spec/dummy/config/environments/development.rb +37 -0
  82. data/spec/dummy/config/environments/production.rb +82 -0
  83. data/spec/dummy/config/environments/test.rb +39 -0
  84. data/spec/dummy/config/initializers/assets.rb +8 -0
  85. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  86. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  87. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  88. data/spec/dummy/config/initializers/inflections.rb +16 -0
  89. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  90. data/spec/dummy/config/initializers/session_store.rb +3 -0
  91. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  92. data/spec/dummy/config/locales/en.yml +23 -0
  93. data/spec/dummy/config/routes.rb +4 -0
  94. data/spec/dummy/config/secrets.yml +22 -0
  95. data/spec/dummy/db/migrate/20140915202259_create_spud_admin_permissions.tb_core.rb +12 -0
  96. data/spec/dummy/db/migrate/20140915202260_create_spud_users.tb_core.rb +30 -0
  97. data/spec/dummy/db/migrate/20140915202261_add_time_zone_to_spud_user.tb_core.rb +7 -0
  98. data/spec/dummy/db/migrate/20140915202262_add_scope_to_spud_admin_permissions.tb_core.rb +7 -0
  99. data/spec/dummy/db/migrate/20140915202263_create_spud_user_settings.tb_core.rb +12 -0
  100. data/spec/dummy/db/migrate/20140915202264_create_spud_roles.tb_core.rb +11 -0
  101. data/spec/dummy/db/migrate/20140915202265_create_spud_permissions.tb_core.rb +11 -0
  102. data/spec/dummy/db/migrate/20140915202266_create_spud_role_permissions.tb_core.rb +12 -0
  103. data/spec/dummy/db/migrate/20140915202267_drop_spud_admin_permissions.tb_core.rb +16 -0
  104. data/spec/dummy/db/migrate/20140915202268_create_tb_checkout_carts.tb_checkout_engine.rb +13 -0
  105. data/spec/dummy/db/migrate/20140915202269_create_tb_checkout_cart_items.tb_checkout_engine.rb +16 -0
  106. data/spec/dummy/db/migrate/20140915202270_create_tb_checkout_transactions.tb_checkout_engine.rb +24 -0
  107. data/spec/dummy/db/migrate/20140915202271_create_tb_checkout_basic_products.tb_checkout_engine.rb +9 -0
  108. data/spec/dummy/db/migrate/20140915234534_add_spud_user_and_session_id_to_transactions.tb_checkout_engine.rb +11 -0
  109. data/spec/dummy/db/schema.rb +135 -0
  110. data/spec/dummy/public/404.html +67 -0
  111. data/spec/dummy/public/422.html +67 -0
  112. data/spec/dummy/public/500.html +66 -0
  113. data/spec/dummy/public/favicon.ico +0 -0
  114. data/spec/factories/spud_users.rb +16 -0
  115. data/spec/factories/tb_checkout_basic_products.rb +8 -0
  116. data/spec/factories/tb_checkout_cart_items.rb +11 -0
  117. data/spec/factories/tb_checkout_carts.rb +14 -0
  118. data/spec/factories/tb_checkout_transactions.rb +37 -0
  119. data/spec/models/tb_checkout/transaction_spec.rb +5 -0
  120. data/spec/rails_helper.rb +73 -0
  121. data/spec/spec_helper.rb +85 -0
  122. metadata +335 -0
@@ -0,0 +1,39 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+
37
+ # Raises error for missing translations
38
+ # config.action_view.raise_on_missing_translations = true
39
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount TbCheckout::Engine => "/tb_checkout"
4
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 7bfce07e05e9ec9ea648500099e36754dab3c0b35997798e35fb03d5ffed6e8b2d0bae9db65934fe62f4b237714c4035953bff8dff63186e65de2d04bfbb3132
15
+
16
+ test:
17
+ secret_key_base: 507091c64d1c1eb9ac4a328e9cb20c4f13223b4c9d5c87ca829d66ed6722c8575c8f6c2e11b1d2251a091141df0f30cbea78d2926df1b434565ef32a74417aad
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,12 @@
1
+ # This migration comes from tb_core (originally 20111214161011)
2
+ class CreateSpudAdminPermissions < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_admin_permissions do |t|
5
+ t.integer :user_id
6
+ t.string :name
7
+ t.boolean :access
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,30 @@
1
+ # This migration comes from tb_core (originally 20111214161146)
2
+ class CreateSpudUsers < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_users do |t|
5
+
6
+ t.string :first_name
7
+ t.string :last_name
8
+ t.boolean :super_admin
9
+ t.string :login, :null => false # optional, you can use email instead, or both
10
+ t.string :email, :null => false # optional, you can use login instead, or both
11
+ t.string :crypted_password, :null => false # optional, see below
12
+ t.string :password_salt, :null => false # optional, but highly recommended
13
+ t.string :persistence_token, :null => false # required
14
+ t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params
15
+ t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability
16
+
17
+ # Magic columns, just like ActiveRecord's created_at and updated_at. These are automatically maintained by Authlogic if they are present.
18
+ t.integer :login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
19
+ t.integer :failed_login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
20
+ t.datetime :last_request_at # optional, see Authlogic::Session::MagicColumns
21
+ t.datetime :current_login_at # optional, see Authlogic::Session::MagicColumns
22
+ t.datetime :last_login_at # optional, see Authlogic::Session::MagicColumns
23
+ t.string :current_login_ip # optional, see Authlogic::Session::MagicColumns
24
+ t.string :last_login_ip # optional, see Authlogic::Session::MagicColumns
25
+ t.timestamps
26
+ end
27
+ add_index :spud_users,:login
28
+ add_index :spud_users,:email
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from tb_core (originally 20120327124229)
2
+ class AddTimeZoneToSpudUser < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_users, :time_zone, :string
5
+
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from tb_core (originally 20120328235431)
2
+ class AddScopeToSpudAdminPermissions < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_admin_permissions, :scope, :string
5
+
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from tb_core (originally 20120329174000)
2
+ class CreateSpudUserSettings < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_user_settings do |t|
5
+ t.integer :spud_user_id
6
+ t.string :key
7
+ t.string :value
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from tb_core (originally 20130620143010)
2
+ class CreateSpudRoles < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_roles do |t|
5
+ t.string :name
6
+ t.timestamps
7
+ end
8
+ add_column :spud_users, :spud_role_id, :integer
9
+ add_index :spud_users, :spud_role_id
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from tb_core (originally 20130620143941)
2
+ class CreateSpudPermissions < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_permissions do |t|
5
+ t.string :name, :null => false
6
+ t.string :tag, :null => false
7
+ t.timestamps
8
+ end
9
+ add_index :spud_permissions, :tag, :unique => true
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from tb_core (originally 20130620151132)
2
+ class CreateSpudRolePermissions < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_role_permissions do |t|
5
+ t.integer :spud_role_id, :null => false
6
+ t.string :spud_permission_tag, :null => false
7
+ t.timestamps
8
+ end
9
+ add_index :spud_role_permissions, :spud_role_id
10
+ add_index :spud_role_permissions, :spud_permission_tag
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from tb_core (originally 20130620163144)
2
+ class DropSpudAdminPermissions < ActiveRecord::Migration
3
+ def up
4
+ drop_table :spud_admin_permissions
5
+ end
6
+
7
+ def down
8
+ create_table :spud_admin_permissions do |t|
9
+ t.integer :user_id
10
+ t.string :name
11
+ t.boolean :access
12
+ t.string :scope
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ # This migration comes from tb_checkout_engine (originally 20140703185256)
2
+ class CreateTbCheckoutCarts < ActiveRecord::Migration
3
+ def change
4
+ create_table :tb_checkout_carts do |t|
5
+ t.integer :spud_user_id
6
+ t.index :spud_user_id
7
+ t.string :session_id, :limit => 32
8
+ t.boolean :is_completed, :default => false
9
+ t.boolean :is_abandoned, :default => false
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from tb_checkout_engine (originally 20140703185258)
2
+ class CreateTbCheckoutCartItems < ActiveRecord::Migration
3
+ def change
4
+ create_table :tb_checkout_cart_items do |t|
5
+ t.integer :cart_id, :null => false
6
+ t.integer :item_id, :null => false
7
+ t.string :item_type, :null => false
8
+ t.string :item_description
9
+ t.decimal :item_price, :precision => 8, :scale => 2
10
+ t.integer :quantity, :default => 1
11
+ t.timestamps
12
+ end
13
+ add_index :tb_checkout_cart_items, :cart_id
14
+ add_index :tb_checkout_cart_items, [:item_id, :item_type]
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ # This migration comes from tb_checkout_engine (originally 20140703185259)
2
+ class CreateTbCheckoutTransactions < ActiveRecord::Migration
3
+ def change
4
+ create_table :tb_checkout_transactions do |t|
5
+ t.integer :cart_id
6
+ t.string :status, :default => 'pending'
7
+ t.string :invoice_num
8
+ t.integer :gateway_transaction_id, :limit => 8
9
+ t.decimal :amount_charged, :precision => 8, :scale => 2
10
+ t.string :card_display
11
+ t.string :card_type
12
+ t.string :billing_first_name
13
+ t.string :billing_last_name
14
+ t.string :billing_address_1
15
+ t.string :billing_address_2
16
+ t.string :billing_city
17
+ t.string :billing_state
18
+ t.string :billing_postal
19
+ t.text :response_text
20
+ t.timestamps
21
+ end
22
+ add_index :tb_checkout_transactions, :cart_id
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ # This migration comes from tb_checkout_engine (originally 20140707142350)
2
+ class CreateTbCheckoutBasicProducts < ActiveRecord::Migration
3
+ def change
4
+ create_table :tb_checkout_basic_products do |t|
5
+ t.tb_checkout_purchasable
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from tb_checkout_engine (originally 20140915202848)
2
+ class AddSpudUserAndSessionIdToTransactions < ActiveRecord::Migration
3
+ def change
4
+ change_table :tb_checkout_transactions do |t|
5
+ t.integer :spud_user_id
6
+ t.index :spud_user_id
7
+ t.string :session_id, :limit => 32
8
+ t.index :session_id
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,135 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140915234534) do
15
+
16
+ create_table "spud_permissions", force: true do |t|
17
+ t.string "name", null: false
18
+ t.string "tag", null: false
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ end
22
+
23
+ add_index "spud_permissions", ["tag"], name: "index_spud_permissions_on_tag", unique: true, using: :btree
24
+
25
+ create_table "spud_role_permissions", force: true do |t|
26
+ t.integer "spud_role_id", null: false
27
+ t.string "spud_permission_tag", null: false
28
+ t.datetime "created_at"
29
+ t.datetime "updated_at"
30
+ end
31
+
32
+ add_index "spud_role_permissions", ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag", using: :btree
33
+ add_index "spud_role_permissions", ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id", using: :btree
34
+
35
+ create_table "spud_roles", force: true do |t|
36
+ t.string "name"
37
+ t.datetime "created_at"
38
+ t.datetime "updated_at"
39
+ end
40
+
41
+ create_table "spud_user_settings", force: true do |t|
42
+ t.integer "spud_user_id"
43
+ t.string "key"
44
+ t.string "value"
45
+ t.datetime "created_at"
46
+ t.datetime "updated_at"
47
+ end
48
+
49
+ create_table "spud_users", force: true do |t|
50
+ t.string "first_name"
51
+ t.string "last_name"
52
+ t.boolean "super_admin"
53
+ t.string "login", null: false
54
+ t.string "email", null: false
55
+ t.string "crypted_password", null: false
56
+ t.string "password_salt", null: false
57
+ t.string "persistence_token", null: false
58
+ t.string "single_access_token", null: false
59
+ t.string "perishable_token", null: false
60
+ t.integer "login_count", default: 0, null: false
61
+ t.integer "failed_login_count", default: 0, null: false
62
+ t.datetime "last_request_at"
63
+ t.datetime "current_login_at"
64
+ t.datetime "last_login_at"
65
+ t.string "current_login_ip"
66
+ t.string "last_login_ip"
67
+ t.datetime "created_at"
68
+ t.datetime "updated_at"
69
+ t.string "time_zone"
70
+ t.integer "spud_role_id"
71
+ end
72
+
73
+ add_index "spud_users", ["email"], name: "index_spud_users_on_email", using: :btree
74
+ add_index "spud_users", ["login"], name: "index_spud_users_on_login", using: :btree
75
+ add_index "spud_users", ["spud_role_id"], name: "index_spud_users_on_spud_role_id", using: :btree
76
+
77
+ create_table "tb_checkout_basic_products", force: true do |t|
78
+ t.string "description"
79
+ t.decimal "price", precision: 8, scale: 2
80
+ t.datetime "created_at"
81
+ t.datetime "updated_at"
82
+ end
83
+
84
+ create_table "tb_checkout_cart_items", force: true do |t|
85
+ t.integer "cart_id", null: false
86
+ t.integer "item_id", null: false
87
+ t.string "item_type", null: false
88
+ t.string "item_description"
89
+ t.decimal "item_price", precision: 8, scale: 2
90
+ t.integer "quantity", default: 1
91
+ t.datetime "created_at"
92
+ t.datetime "updated_at"
93
+ end
94
+
95
+ add_index "tb_checkout_cart_items", ["cart_id"], name: "index_tb_checkout_cart_items_on_cart_id", using: :btree
96
+ add_index "tb_checkout_cart_items", ["item_id", "item_type"], name: "index_tb_checkout_cart_items_on_item_id_and_item_type", using: :btree
97
+
98
+ create_table "tb_checkout_carts", force: true do |t|
99
+ t.integer "spud_user_id"
100
+ t.string "session_id", limit: 32
101
+ t.boolean "is_completed", default: false
102
+ t.boolean "is_abandoned", default: false
103
+ t.datetime "created_at"
104
+ t.datetime "updated_at"
105
+ end
106
+
107
+ add_index "tb_checkout_carts", ["spud_user_id"], name: "index_tb_checkout_carts_on_spud_user_id", using: :btree
108
+
109
+ create_table "tb_checkout_transactions", force: true do |t|
110
+ t.integer "cart_id"
111
+ t.string "status", default: "pending"
112
+ t.string "invoice_num"
113
+ t.integer "gateway_transaction_id", limit: 8
114
+ t.decimal "amount_charged", precision: 8, scale: 2
115
+ t.string "card_display"
116
+ t.string "card_type"
117
+ t.string "billing_first_name"
118
+ t.string "billing_last_name"
119
+ t.string "billing_address_1"
120
+ t.string "billing_address_2"
121
+ t.string "billing_city"
122
+ t.string "billing_state"
123
+ t.string "billing_postal"
124
+ t.text "response_text"
125
+ t.datetime "created_at"
126
+ t.datetime "updated_at"
127
+ t.integer "spud_user_id"
128
+ t.string "session_id", limit: 32
129
+ end
130
+
131
+ add_index "tb_checkout_transactions", ["cart_id"], name: "index_tb_checkout_transactions_on_cart_id", using: :btree
132
+ add_index "tb_checkout_transactions", ["session_id"], name: "index_tb_checkout_transactions_on_session_id", using: :btree
133
+ add_index "tb_checkout_transactions", ["spud_user_id"], name: "index_tb_checkout_transactions_on_spud_user_id", using: :btree
134
+
135
+ end