spree_mercado_pago_payment_method 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. data/app/assets/javascripts/admin/spree_mercado_pago_payment_method.js +1 -0
  2. data/app/assets/javascripts/store/spree_mercado_pago_payment_method.js +1 -0
  3. data/app/assets/stylesheets/admin/spree_mercado_pago_payment_method.css +3 -0
  4. data/app/assets/stylesheets/store/spree_mercado_pago_payment_method.css +3 -0
  5. data/app/controllers/spree/checkout_controller_decorator.rb +29 -0
  6. data/app/controllers/spree/mercado_pago_controller.rb +47 -0
  7. data/app/models/payment_method/mercado_pago.rb +33 -0
  8. data/app/models/spree_mercado_pago_client.rb +102 -0
  9. data/app/views/spree/admin/payments/source_forms/_mercadopago.html.erb +1 -0
  10. data/app/views/spree/admin/payments/source_views/_mercadopago.html.erb +1 -0
  11. data/app/views/spree/checkout/mercado_pago_error.html.erb +0 -0
  12. data/app/views/spree/checkout/payment/_mercadopago.html.erb +1 -0
  13. data/app/views/spree/mercado_pago/failure.html.erb +1 -0
  14. data/app/views/spree/mercado_pago/pending.html.erb +1 -0
  15. data/app/views/spree/mercado_pago/success.html.erb +1 -0
  16. data/config/locales/en.yml +13 -0
  17. data/config/locales/es.yml +14 -0
  18. data/config/routes.rb +8 -0
  19. data/lib/generators/spree_mercado_pago_payment_method/install/install_generator.rb +29 -0
  20. data/lib/spree_mercado_pago_payment_method.rb +3 -0
  21. data/lib/spree_mercado_pago_payment_method/engine.rb +23 -0
  22. data/lib/tasks/mercado_user.rake +6 -0
  23. data/spec/controllers/spree/checkout_controller_spec.rb +57 -0
  24. data/spec/controllers/spree/mercado_pago_controller_spec.rb +90 -0
  25. data/spec/dummy/README.rdoc +261 -0
  26. data/spec/dummy/Rakefile +7 -0
  27. data/spec/dummy/app/assets/javascripts/admin/all.js +12 -0
  28. data/spec/dummy/app/assets/javascripts/store/all.js +12 -0
  29. data/spec/dummy/app/assets/stylesheets/admin/all.css +11 -0
  30. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  31. data/spec/dummy/app/assets/stylesheets/store/all.css +11 -0
  32. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  33. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  34. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/spec/dummy/config.ru +4 -0
  36. data/spec/dummy/config/application.rb +74 -0
  37. data/spec/dummy/config/boot.rb +6 -0
  38. data/spec/dummy/config/database.yml +11 -0
  39. data/spec/dummy/config/environment.rb +7 -0
  40. data/spec/dummy/config/environments/development.rb +37 -0
  41. data/spec/dummy/config/environments/production.rb +67 -0
  42. data/spec/dummy/config/environments/test.rb +37 -0
  43. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  44. data/spec/dummy/config/initializers/custom_user.rb +1 -0
  45. data/spec/dummy/config/initializers/inflections.rb +15 -0
  46. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  47. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  48. data/spec/dummy/config/initializers/session_store.rb +8 -0
  49. data/spec/dummy/config/initializers/spree.rb +14 -0
  50. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  51. data/spec/dummy/config/locales/en.yml +5 -0
  52. data/spec/dummy/config/routes.rb +3 -0
  53. data/spec/dummy/config/spree.yml +2 -0
  54. data/spec/dummy/db/migrate/20121121030140_spree_zero_nine_zero.spree.rb +392 -0
  55. data/spec/dummy/db/migrate/20121121030141_create_indexes_for_inventory_units.spree.rb +7 -0
  56. data/spec/dummy/db/migrate/20121121030142_add_count_on_hand_to_variants_and_products.spree.rb +50 -0
  57. data/spec/dummy/db/migrate/20121121030143_change_taxons_to_nested_set.spree.rb +47 -0
  58. data/spec/dummy/db/migrate/20121121030144_move_to_configurable_gateways.spree.rb +55 -0
  59. data/spec/dummy/db/migrate/20121121030145_add_open_id_authentication_tables.spree.rb +16 -0
  60. data/spec/dummy/db/migrate/20121121030146_add_openid_field_to_users.spree.rb +27 -0
  61. data/spec/dummy/db/migrate/20121121030147_change_preference_value_type.spree.rb +11 -0
  62. data/spec/dummy/db/migrate/20121121030148_create_billing_integrations.spree.rb +13 -0
  63. data/spec/dummy/db/migrate/20121121030149_charge_refactoring.spree.rb +40 -0
  64. data/spec/dummy/db/migrate/20121121030150_add_some_indexes.spree.rb +12 -0
  65. data/spec/dummy/db/migrate/20121121030151_checkout_state_machine.spree.rb +6 -0
  66. data/spec/dummy/db/migrate/20121121030152_state_for_shipments.spree.rb +6 -0
  67. data/spec/dummy/db/migrate/20121121030153_make_state_events_polymorphic.spree.rb +13 -0
  68. data/spec/dummy/db/migrate/20121121030154_ship_address_id_for_checkouts.spree.rb +6 -0
  69. data/spec/dummy/db/migrate/20121121030155_shipping_method_id_for_checkouts.spree.rb +6 -0
  70. data/spec/dummy/db/migrate/20121121030156_creditcard_last_four_digits.spree.rb +15 -0
  71. data/spec/dummy/db/migrate/20121121030157_populate_legacy_shipment_state.spree.rb +16 -0
  72. data/spec/dummy/db/migrate/20121121030158_add_cost_price.spree.rb +6 -0
  73. data/spec/dummy/db/migrate/20121121030159_shipment_id_for_inventory_units.spree.rb +26 -0
  74. data/spec/dummy/db/migrate/20121121030160_cim_fields_for_creditcards.spree.rb +7 -0
  75. data/spec/dummy/db/migrate/20121121030161_create_return_authorizations.spree.rb +13 -0
  76. data/spec/dummy/db/migrate/20121121030162_add_return_authorization_to_inventory_units.spree.rb +6 -0
  77. data/spec/dummy/db/migrate/20121121030163_create_trackers.spree.rb +11 -0
  78. data/spec/dummy/db/migrate/20121121030164_creditcard_id_for_creditcard_txns.spree.rb +6 -0
  79. data/spec/dummy/db/migrate/20121121030165_original_creditcard_txn_id_for_creditcard_txns.spree.rb +6 -0
  80. data/spec/dummy/db/migrate/20121121030166_add_test_mode_to_billing_integration.spree.rb +7 -0
  81. data/spec/dummy/db/migrate/20121121030167_create_payment_methods.spree.rb +17 -0
  82. data/spec/dummy/db/migrate/20121121030168_polymorphic_payments.spree.rb +43 -0
  83. data/spec/dummy/db/migrate/20121121030169_change_payments_payment_method_to_belongs_to.spree.rb +12 -0
  84. data/spec/dummy/db/migrate/20121121030170_assign_creditcard_txns_to_payment.spree.rb +24 -0
  85. data/spec/dummy/db/migrate/20121121030171_sti_for_transactions.spree.rb +16 -0
  86. data/spec/dummy/db/migrate/20121121030172_drop_billing_integrations.spree.rb +17 -0
  87. data/spec/dummy/db/migrate/20121121030173_deleted_at_for_payment_methods.spree.rb +15 -0
  88. data/spec/dummy/db/migrate/20121121030174_add_adjustments_index.spree.rb +7 -0
  89. data/spec/dummy/db/migrate/20121121030175_add_alt_text_to_images.spree.rb +6 -0
  90. data/spec/dummy/db/migrate/20121121030176_fix_existing_coupon_credits.spree.rb +14 -0
  91. data/spec/dummy/db/migrate/20121121030177_add_display_to_payment_methods.spree.rb +6 -0
  92. data/spec/dummy/db/migrate/20121121030178_add_addresses_checkouts_indexes.spree.rb +9 -0
  93. data/spec/dummy/db/migrate/20121121030179_add_icon_to_taxons.spree.rb +18 -0
  94. data/spec/dummy/db/migrate/20121121030180_add_description_to_taxons.spree.rb +12 -0
  95. data/spec/dummy/db/migrate/20121121030181_index_for_shipments_number.spree.rb +6 -0
  96. data/spec/dummy/db/migrate/20121121030182_add_index_on_users_persistence_token.spree.rb +8 -0
  97. data/spec/dummy/db/migrate/20121121030183_add_default_to_tax_categories.spree.rb +6 -0
  98. data/spec/dummy/db/migrate/20121121030184_add_display_to_shipping_methods.spree.rb +6 -0
  99. data/spec/dummy/db/migrate/20121121030185_rename_payment_method_display.spree.rb +6 -0
  100. data/spec/dummy/db/migrate/20121121030186_rename_preferences_field.spree.rb +6 -0
  101. data/spec/dummy/db/migrate/20121121030187_add_guest_flag.spree.rb +8 -0
  102. data/spec/dummy/db/migrate/20121121030188_drop_order_token.spree.rb +10 -0
  103. data/spec/dummy/db/migrate/20121121030189_payments_state_and_assigned_to_order_only.spree.rb +15 -0
  104. data/spec/dummy/db/migrate/20121121030190_create_address_keys_for_order.spree.rb +7 -0
  105. data/spec/dummy/db/migrate/20121121030191_payment_total_for_orders.spree.rb +6 -0
  106. data/spec/dummy/db/migrate/20121121030192_shipping_method_id_for_orders.spree.rb +6 -0
  107. data/spec/dummy/db/migrate/20121121030193_add_shipment_and_payment_state.spree.rb +7 -0
  108. data/spec/dummy/db/migrate/20121121030194_refactor_adjustments.spree.rb +30 -0
  109. data/spec/dummy/db/migrate/20121121030195_response_code_and_avs_response_for_payments.spree.rb +7 -0
  110. data/spec/dummy/db/migrate/20121121030196_change_guest_flag_to_anonymous.spree.rb +8 -0
  111. data/spec/dummy/db/migrate/20121121030197_email_for_orders.spree.rb +6 -0
  112. data/spec/dummy/db/migrate/20121121030198_create_mail_methods.spree.rb +11 -0
  113. data/spec/dummy/db/migrate/20121121030199_rename_frozen_to_locked.spree.rb +6 -0
  114. data/spec/dummy/db/migrate/20121121030200_move_special_instructions_to_orders.spree.rb +11 -0
  115. data/spec/dummy/db/migrate/20121121030201_create_log_entries.spree.rb +12 -0
  116. data/spec/dummy/db/migrate/20121121030202_migrate_transactions_to_payment_state.spree.rb +99 -0
  117. data/spec/dummy/db/migrate/20121121030203_delete_in_progress_orders.spree.rb +20 -0
  118. data/spec/dummy/db/migrate/20121121030204_migrate_checkout_to_orders.spree.rb +24 -0
  119. data/spec/dummy/db/migrate/20121121030205_remove_shipped_state.spree.rb +13 -0
  120. data/spec/dummy/db/migrate/20121121030206_prevent_nil_payment_total.spree.rb +9 -0
  121. data/spec/dummy/db/migrate/20121121030207_prevent_nil_email.spree.rb +10 -0
  122. data/spec/dummy/db/migrate/20121121030208_generate_anonymous_users.spree.rb +21 -0
  123. data/spec/dummy/db/migrate/20121121030209_update_order_state.spree.rb +13 -0
  124. data/spec/dummy/db/migrate/20121121030210_cleanup_legacy_tables.spree.rb +12 -0
  125. data/spec/dummy/db/migrate/20121121030211_remove_number_and_cvv_from_credicard.spree.rb +12 -0
  126. data/spec/dummy/db/migrate/20121121030212_drop_anonymous_field_for_user.spree.rb +12 -0
  127. data/spec/dummy/db/migrate/20121121030213_renamed_rma_cancelled_state.spree.rb +10 -0
  128. data/spec/dummy/db/migrate/20121121030214_fix_problematic_index_names.spree.rb +14 -0
  129. data/spec/dummy/db/migrate/20121121030215_add_position_to_variants.spree.rb +6 -0
  130. data/spec/dummy/db/migrate/20121121030216_add_next_state_to_state_events.spree.rb +6 -0
  131. data/spec/dummy/db/migrate/20121121030217_add_position_to_option_types.spree.rb +6 -0
  132. data/spec/dummy/db/migrate/20121121030218_remove_trailing_slashes_in_taxon_permalinks.spree.rb +20 -0
  133. data/spec/dummy/db/migrate/20121121030219_create_activators.spree.rb +15 -0
  134. data/spec/dummy/db/migrate/20121121030220_eligible_for_adjustments.spree.rb +6 -0
  135. data/spec/dummy/db/migrate/20121121030221_namespace_top_level_models.spree.rb +67 -0
  136. data/spec/dummy/db/migrate/20121121030222_migrate_namespaced_polymorphic_models.spree.rb +53 -0
  137. data/spec/dummy/db/migrate/20121121030223_make_adjustments_polymorphic.spree.rb +10 -0
  138. data/spec/dummy/db/migrate/20121121030224_add_company_to_addresses.spree.rb +6 -0
  139. data/spec/dummy/db/migrate/20121121030225_add_inc_tax_to_tax_rates.spree.rb +6 -0
  140. data/spec/dummy/db/migrate/20121121030226_rename_inc_price_attribute.spree.rb +6 -0
  141. data/spec/dummy/db/migrate/20121121030227_add_default_tax_zone.spree.rb +6 -0
  142. data/spec/dummy/db/migrate/20121121030228_associate_shipping_methods_and_shipping_categories.spree.rb +8 -0
  143. data/spec/dummy/db/migrate/20121121030229_add_match_rules_to_shipping_methods.spree.rb +8 -0
  144. data/spec/dummy/db/migrate/20121121030230_new_preferences.spree.rb +49 -0
  145. data/spec/dummy/db/migrate/20121121030231_rename_state_events_to_state_changes.spree.rb +10 -0
  146. data/spec/dummy/db/migrate/20121121030232_add_deleted_at_to_tax_category.spree.rb +6 -0
  147. data/spec/dummy/db/migrate/20121121030233_migrate_images_from_products_to_variants.spree.rb +38 -0
  148. data/spec/dummy/db/migrate/20121121030234_rename_attachment_size_to_attachment_file_size.spree.rb +6 -0
  149. data/spec/dummy/db/migrate/20121121030235_increase_scale_of_tax_rate_amount.spree.rb +10 -0
  150. data/spec/dummy/db/migrate/20121121030236_create_tokenized_permissions_table.spree.rb +17 -0
  151. data/spec/dummy/db/migrate/20121121030237_convert_sales_tax_to_default_tax.spree.rb +10 -0
  152. data/spec/dummy/db/migrate/20121121030238_rename_creditcards_to_credit_cards.spree.rb +12 -0
  153. data/spec/dummy/db/migrate/20121121030239_add_deleted_at_to_spree_shipping_methods.spree.rb +6 -0
  154. data/spec/dummy/db/migrate/20121121030240_remove_credit_total_from_orders.spree.rb +6 -0
  155. data/spec/dummy/db/migrate/20121121030241_add_counter_cache_to_zone_members.spree.rb +15 -0
  156. data/spec/dummy/db/migrate/20121121030242_add_tax_rate_label.spree.rb +6 -0
  157. data/spec/dummy/db/migrate/20121121030243_add_toggle_tax_rate_display.spree.rb +6 -0
  158. data/spec/dummy/db/migrate/20121121030244_add_lock_version_to_variant.spree.rb +6 -0
  159. data/spec/dummy/db/migrate/20121121030245_remove_not_null_constraint_from_products_on_hand.spree.rb +12 -0
  160. data/spec/dummy/db/migrate/20121121030246_create_users.spree_auth.rb +30 -0
  161. data/spec/dummy/db/migrate/20121121030247_rename_columns_for_devise.spree_auth.rb +38 -0
  162. data/spec/dummy/db/migrate/20121121030248_convert_user_remember_field.spree_auth.rb +12 -0
  163. data/spec/dummy/db/migrate/20121121030249_add_reset_password_sent_at_to_spree_users.spree_auth.rb +9 -0
  164. data/spec/dummy/db/migrate/20121121030250_make_users_email_index_unique.spree_auth.rb +10 -0
  165. data/spec/dummy/db/schema.rb +548 -0
  166. data/spec/dummy/db/seeds.rb +11 -0
  167. data/spec/dummy/db/spree_development.sqlite3 +0 -0
  168. data/spec/dummy/db/spree_test.sqlite3 +0 -0
  169. data/spec/dummy/log/development.log +1439 -0
  170. data/spec/dummy/log/test.log +37662 -0
  171. data/spec/dummy/public/404.html +26 -0
  172. data/spec/dummy/public/422.html +26 -0
  173. data/spec/dummy/public/500.html +25 -0
  174. data/spec/dummy/public/favicon.ico +0 -0
  175. data/spec/dummy/script/rails +6 -0
  176. data/spec/fixtures/authenticated.json +7 -0
  177. data/spec/fixtures/preferences_created.json +41 -0
  178. data/spec/models/spree_mercado_pago_client_spec.rb +131 -0
  179. data/spec/spec_helper.rb +95 -0
  180. metadata +524 -0
@@ -0,0 +1,11 @@
1
+
2
+ development:
3
+ adapter: sqlite3
4
+ database: "db/spree_development.sqlite3"
5
+ test:
6
+ adapter: sqlite3
7
+ database: "db/spree_test.sqlite3"
8
+ production:
9
+ adapter: sqlite3
10
+ database: "db/spree_production.sqlite3"
11
+
@@ -0,0 +1,7 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
6
+
7
+ ActiveRecord::Base.include_root_in_json = true
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::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
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -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 @@
1
+ # Spree.user_class = "User"
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
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
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '6b5f7005856b32c5c6c6c7fb9d670aaafd5460fada65bd075c156a49a533b85038761753a8d5c01b7cc1bbb7dd9d38f95e55689b6fb9dd5b2b7b6d286c849b90'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Configure Spree Preferences
2
+ #
3
+ # Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart.
4
+ # If you would like users to be able to update a setting with the Admin it should NOT be set here.
5
+ #
6
+ # In order to initialize a setting do:
7
+ # config.setting_name = 'new value'
8
+ Spree.config do |config|
9
+ # Example:
10
+ # Uncomment to override the default site name.
11
+ # config.site_name = "Spree Demo Site"
12
+ end
13
+
14
+ Spree.user_class = "Spree::LegacyUser"
@@ -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]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Spree::Core::Engine => "/"
3
+ end
@@ -0,0 +1,2 @@
1
+ ---
2
+ version: 1.2.2
@@ -0,0 +1,392 @@
1
+ # This migration comes from spree (originally 20090823005402)
2
+ class SpreeZeroNineZero < ActiveRecord::Migration
3
+ # This is a legacy migration consolidating all of the database changes needed as of Spree 0.9.0
4
+ # (See http://railsdog.lighthouseapp.com/projects/31096-spree/tickets/772)
5
+
6
+ def change
7
+ create_table :addresses, :force => true do |t|
8
+ t.string :firstname, :lastname, :address1, :address2, :city,
9
+ :zipcode, :phone, :state_name, :alternative_phone
10
+ t.references :state
11
+ t.references :country
12
+
13
+ t.timestamps
14
+ end
15
+
16
+ create_table :adjustments, :force => true do |t|
17
+ t.integer :position, :adjustment_source_id
18
+ t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
19
+ t.string :type, :description, :adjustment_source_type, :secondary_type
20
+ t.references :order
21
+
22
+ t.timestamps
23
+ end
24
+
25
+ create_table :assets, :force => true do |t|
26
+ t.integer :viewable_id, :attachment_width, :attachment_height,
27
+ :attachment_size, :position
28
+ t.string :viewable_type, :limit => 50
29
+ t.string :attachment_content_type, :attachment_file_name
30
+ t.string :type, :limit => 75
31
+ t.datetime :attachment_updated_at
32
+ end
33
+
34
+ create_table :calculators, :force => true do |t|
35
+ t.string :type
36
+ t.integer :calculable_id, :null => false
37
+ t.string :calculable_type, :null => false
38
+
39
+ t.timestamps
40
+ end
41
+
42
+ create_table :checkouts, :force => true do |t|
43
+ t.references :order
44
+ t.string :email, :ip_address
45
+ t.text :special_instructions
46
+ t.integer :bill_address_id
47
+ t.datetime :completed_at
48
+
49
+ t.timestamps
50
+ end
51
+
52
+ create_table :configurations, :force => true do |t|
53
+ t.string :name
54
+ t.string :type, :limit => 50
55
+
56
+ t.timestamps
57
+ end
58
+
59
+ add_index :configurations, [:name, :type], :name => 'index_configurations_on_name_and_type'
60
+
61
+ create_table :countries, :force => true do |t|
62
+ t.string :iso_name, :iso, :iso3, :name
63
+ t.integer :numcode
64
+ end
65
+
66
+ create_table :coupons, :force => true do |t|
67
+ t.string :code, :description
68
+ t.integer :usage_limit
69
+ t.boolean :combine
70
+ t.datetime :expires_at, :starts_at
71
+
72
+ t.timestamps
73
+ end
74
+
75
+ create_table :creditcard_txns, :force => true do |t|
76
+ t.integer :creditcard_payment_id, :txn_type
77
+ t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
78
+ t.string :response_code
79
+ t.text :avs_response, :cvv_response
80
+
81
+ t.timestamps
82
+ end
83
+
84
+ create_table :creditcards, :force => true do |t|
85
+ t.text :number, :verification_value
86
+ t.string :month, :year, :cc_type, :display_number, :first_name,
87
+ :last_name, :start_month, :start_year, :issue_number
88
+ t.references :address
89
+ t.references :checkout
90
+
91
+ t.timestamps
92
+ end
93
+
94
+ create_table :gateway_configurations, :force => true do |t|
95
+ t.references :gateway
96
+
97
+ t.timestamps
98
+ end
99
+
100
+ create_table :gateway_option_values, :force => true do |t|
101
+ t.references :gateway_configuration
102
+ t.references :gateway_option
103
+ t.text :value
104
+
105
+ t.timestamps
106
+ end
107
+
108
+ create_table :gateway_options, :force => true do |t|
109
+ t.string :name
110
+ t.text :description
111
+ t.boolean :textarea, :default => false
112
+ t.references :gateway
113
+
114
+ t.timestamps
115
+ end
116
+
117
+ create_table :gateways, :force => true do |t|
118
+ t.string :clazz, :name
119
+ t.text :description
120
+ t.boolean :active
121
+
122
+ t.timestamps
123
+ end
124
+
125
+ create_table :inventory_units, :force => true do |t|
126
+ t.integer :lock_version, :default => 0
127
+ t.string :state
128
+ t.references :variant
129
+ t.references :order
130
+
131
+ t.timestamps
132
+ end
133
+
134
+ create_table :line_items, :force => true do |t|
135
+ t.references :order
136
+ t.references :variant
137
+ t.integer :quantity, :null => false
138
+ t.decimal :price, :precision => 8, :scale => 2, :null => false
139
+
140
+ t.timestamps
141
+ end
142
+
143
+ add_index :line_items, :order_id, :name => 'index_line_items_on_order_id'
144
+ add_index :line_items, :variant_id, :name => 'index_line_items_on_variant_id'
145
+
146
+ create_table :option_types, :force => true do |t|
147
+ t.string :name, :limit => 100
148
+ t.string :presentation, :limit => 100
149
+
150
+ t.timestamps
151
+ end
152
+
153
+ create_table :option_types_prototypes, :id => false, :force => true do |t|
154
+ t.references :prototype
155
+ t.references :option_type
156
+ end
157
+
158
+ create_table :option_values, :force => true do |t|
159
+ t.integer :position
160
+ t.string :name, :presentation
161
+ t.references :option_type
162
+
163
+ t.timestamps
164
+ end
165
+
166
+ create_table :option_values_variants, :id => false, :force => true do |t|
167
+ t.integer :variant_id
168
+ t.integer :option_value_id
169
+ end
170
+
171
+ add_index :option_values_variants, :variant_id, :name => 'index_option_values_variants_on_variant_id'
172
+
173
+ create_table :orders, :force => true do |t|
174
+ t.string :number, :limit => 15
175
+ t.decimal :item_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
176
+ t.decimal :total, :precision => 8, :scale => 2, :default => 0.0, :null => false
177
+ t.string :state
178
+ t.string :token
179
+ t.decimal :adjustment_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
180
+ t.decimal :credit_total, :precision => 8, :scale => 2, :default => 0.0, :null => false
181
+ t.references :user
182
+
183
+ t.timestamps
184
+ end
185
+
186
+ add_index :orders, :number, :name => 'index_orders_on_number'
187
+
188
+ create_table :payments, :force => true do |t|
189
+ t.decimal :amount, :precision => 8, :scale => 2, :default => 0.0, :null => false
190
+ t.string :type
191
+ t.references :order
192
+ t.references :creditcard
193
+
194
+ t.timestamps
195
+ end
196
+
197
+ create_table :preferences, :force => true do |t|
198
+ t.string :attribute, :null => false, :limit => 100
199
+ t.integer :owner_id, :null => false, :limit => 30
200
+ t.string :owner_type, :null => false, :limit => 50
201
+ t.integer :group_id
202
+ t.string :group_type, :limit => 50
203
+ t.string :value
204
+
205
+ t.timestamps
206
+ end
207
+
208
+ add_index :preferences, [:owner_id, :owner_type, :attribute, :group_id, :group_type], :name => 'index_preferences_on_owner_and_attribute_and_preference', :unique => true
209
+
210
+ create_table :product_option_types, :force => true do |t|
211
+ t.integer :position
212
+ t.references :product
213
+ t.references :option_type
214
+
215
+ t.timestamps
216
+ end
217
+
218
+ create_table :product_properties, :force => true do |t|
219
+ t.string :value
220
+ t.references :product
221
+ t.references :property
222
+
223
+ t.timestamps
224
+ end
225
+
226
+ create_table :products, :force => true do |t|
227
+ t.string :name, :default => '', :null => false
228
+ t.text :description
229
+ t.datetime :available_on, :deleted_at
230
+ t.string :permalink, :meta_description, :meta_keywords
231
+ t.references :tax_category
232
+ t.references :shipping_category
233
+
234
+ t.timestamps
235
+ end
236
+
237
+ add_index :products, :available_on, :name => 'index_products_on_available_on'
238
+ add_index :products, :deleted_at, :name => 'index_products_on_deleted_at'
239
+ add_index :products, :name, :name => 'index_products_on_name'
240
+ add_index :products, :permalink, :name => 'index_products_on_permalink'
241
+
242
+ create_table :products_taxons, :id => false, :force => true do |t|
243
+ t.references :product
244
+ t.references :taxon
245
+ end
246
+
247
+ add_index :products_taxons, :product_id, :name => 'index_products_taxons_on_product_id'
248
+ add_index :products_taxons, :taxon_id, :name => 'index_products_taxons_on_taxon_id'
249
+
250
+ create_table :properties, :force => true do |t|
251
+ t.string :name
252
+ t.string :presentation, :null => false
253
+
254
+ t.timestamps
255
+ end
256
+
257
+ create_table :properties_prototypes, :id => false, :force => true do |t|
258
+ t.references :prototype
259
+ t.references :property
260
+ end
261
+
262
+ create_table :prototypes, :force => true do |t|
263
+ t.string :name
264
+
265
+ t.timestamps
266
+ end
267
+
268
+ create_table :roles, :force => true do |t|
269
+ t.string :name
270
+ end
271
+
272
+ create_table :roles_users, :id => false, :force => true do |t|
273
+ t.references :role
274
+ t.references :user
275
+ end
276
+
277
+ add_index :roles_users, :role_id, :name => 'index_roles_users_on_role_id'
278
+ add_index :roles_users, :user_id, :name => 'index_roles_users_on_user_id'
279
+
280
+ create_table :shipments, :force => true do |t|
281
+ t.string :tracking, :number
282
+ t.decimal :cost, :precision => 8, :scale => 2
283
+ t.datetime :shipped_at
284
+ t.references :order
285
+ t.references :shipping_method
286
+ t.references :address
287
+
288
+ t.timestamps
289
+ end
290
+
291
+ create_table :shipping_categories, :force => true do |t|
292
+ t.string :name
293
+
294
+ t.timestamps
295
+ end
296
+
297
+ create_table :shipping_methods, :force => true do |t|
298
+ t.string :name
299
+ t.references :zone
300
+
301
+ t.timestamps
302
+ end
303
+
304
+ create_table :state_events, :force => true do |t|
305
+ t.string :name, :previous_state
306
+ t.references :order
307
+ t.references :user
308
+
309
+ t.timestamps
310
+ end
311
+
312
+ create_table :states, :force => true do |t|
313
+ t.string :name
314
+ t.string :abbr
315
+ t.references :country
316
+ end
317
+
318
+ create_table :tax_categories, :force => true do |t|
319
+ t.string :name, :description
320
+
321
+ t.timestamps
322
+ end
323
+
324
+ create_table :tax_rates, :force => true do |t|
325
+ t.decimal :amount, :precision => 8, :scale => 4
326
+ t.references :zone
327
+ t.references :tax_category
328
+
329
+ t.timestamps
330
+ end
331
+
332
+ create_table :taxonomies, :force => true do |t|
333
+ t.string :name, :null => false
334
+
335
+ t.timestamps
336
+ end
337
+
338
+ create_table :taxons, :force => true do |t|
339
+ t.integer :parent_id
340
+ t.integer :position, :default => 0
341
+ t.string :name, :null => false
342
+ t.string :permalink
343
+ t.references :taxonomy
344
+
345
+ t.timestamps
346
+ end
347
+
348
+ unless defined?(User)
349
+ create_table :users, :force => true do |t|
350
+ t.string :crypted_password, :limit => 128, :default => '', :null => false
351
+ t.string :salt, :limit => 128, :default => '', :null => false
352
+ t.string :email, :remember_token, :remember_token_expires_at,
353
+ :persistence_token, :single_access_token, :perishable_token
354
+ t.integer :login_count, :default => 0, :null => false
355
+ t.integer :failed_login_count, :default => 0, :null => false
356
+ t.datetime :last_request_at, :current_login_at, :last_login_at
357
+ t.string :current_login_ip, :last_login_ip, :login
358
+ t.integer :ship_address_id, :bill_address_id
359
+
360
+ t.timestamps
361
+ end
362
+ end
363
+
364
+ create_table :variants, :force => true do |t|
365
+ t.string :sku, :default => '', :null => false
366
+ t.decimal :price, :precision => 8, :scale => 2, :null => false
367
+ t.decimal :weight, :precision => 8, :scale => 2
368
+ t.decimal :height, :precision => 8, :scale => 2
369
+ t.decimal :width, :precision => 8, :scale => 2
370
+ t.decimal :depth, :precision => 8, :scale => 2
371
+ t.datetime :deleted_at
372
+ t.boolean :is_master, :default => false
373
+ t.references :product
374
+ end
375
+
376
+ add_index :variants, :product_id, :name => 'index_variants_on_product_id'
377
+
378
+ create_table :zone_members, :force => true do |t|
379
+ t.integer :zoneable_id
380
+ t.string :zoneable_type
381
+ t.references :zone
382
+
383
+ t.timestamps
384
+ end
385
+
386
+ create_table :zones, :force => true do |t|
387
+ t.string :name, :description
388
+
389
+ t.timestamps
390
+ end
391
+ end
392
+ end