spree_mercado_pago_payment_method 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (358) hide show
  1. checksums.yaml +7 -0
  2. data/app/assets/javascripts/{admin → spree/admin}/spree_mercado_pago_payment_method.js +0 -0
  3. data/app/assets/javascripts/spree/frontend/spree_mercado_pago_payment_method.js +25 -0
  4. data/app/controllers/spree/mercado_pago_controller.rb +53 -31
  5. data/app/models/mercado_pago/client.rb +63 -0
  6. data/app/models/mercado_pago/client/api.rb +43 -0
  7. data/app/models/mercado_pago/client/authentication.rb +36 -0
  8. data/app/models/mercado_pago/client/preferences.rb +20 -0
  9. data/app/models/mercado_pago/notification.rb +8 -0
  10. data/app/models/mercado_pago/order_preferences_builder.rb +68 -0
  11. data/app/models/spree/payment_method/mercado_pago.rb +46 -0
  12. data/app/services/mercado_pago/handle_received_notification.rb +18 -0
  13. data/app/services/mercado_pago/process_notification.rb +54 -0
  14. data/app/views/spree/checkout/payment/_mercadopago.html.erb +15 -1
  15. data/config/locales/en.yml +3 -12
  16. data/config/locales/es.yml +3 -13
  17. data/config/routes.rb +5 -7
  18. data/lib/generators/spree_mercado_pago_payment_method/install/install_generator.rb +15 -10
  19. data/lib/spree_mercado_pago_payment_method.rb +1 -0
  20. data/lib/spree_mercado_pago_payment_method/engine.rb +1 -2
  21. data/lib/tasks/mercado_user.rake +0 -1
  22. data/spec/controllers/spree/mercado_pago_controller_spec.rb +18 -76
  23. data/spec/dummy/README.rdoc +15 -248
  24. data/spec/dummy/Rakefile +1 -2
  25. data/spec/dummy/app/assets/stylesheets/application.css +5 -3
  26. data/spec/dummy/app/controllers/application_controller.rb +3 -1
  27. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  28. data/spec/dummy/bin/bundle +3 -0
  29. data/spec/dummy/bin/rails +4 -0
  30. data/spec/dummy/bin/rake +4 -0
  31. data/spec/dummy/config.ru +1 -1
  32. data/spec/dummy/config/application.rb +0 -36
  33. data/spec/dummy/config/database.yml +3 -5
  34. data/spec/dummy/config/environment.rb +3 -5
  35. data/spec/dummy/config/environments/development.rb +19 -19
  36. data/spec/dummy/config/environments/production.rb +41 -30
  37. data/spec/dummy/config/environments/test.rb +3 -6
  38. data/spec/dummy/config/initializers/assets.rb +8 -0
  39. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  40. data/spec/dummy/config/initializers/devise.rb +3 -0
  41. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  42. data/spec/dummy/config/initializers/inflections.rb +6 -5
  43. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  44. data/spec/dummy/config/initializers/session_store.rb +1 -6
  45. data/spec/dummy/config/initializers/spree.rb +4 -4
  46. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  47. data/spec/dummy/config/locales/en.yml +20 -2
  48. data/spec/dummy/config/routes.rb +8 -2
  49. data/spec/dummy/config/secrets.yml +22 -0
  50. data/spec/dummy/config/spree.yml +1 -1
  51. data/spec/dummy/db/migrate/20141112193407_spree_one_two.spree.rb +482 -0
  52. data/spec/dummy/db/migrate/20141112193408_spree_promo_one_two.spree.rb +46 -0
  53. data/spec/dummy/db/migrate/{20121121030242_add_tax_rate_label.spree.rb → 20141112193409_add_tax_rate_label.spree.rb} +0 -0
  54. data/spec/dummy/db/migrate/{20121121030243_add_toggle_tax_rate_display.spree.rb → 20141112193410_add_toggle_tax_rate_display.spree.rb} +0 -0
  55. data/spec/dummy/db/migrate/20141112193411_remove_unused_preference_columns.spree.rb +9 -0
  56. data/spec/dummy/db/migrate/{20121121030244_add_lock_version_to_variant.spree.rb → 20141112193412_add_lock_version_to_variant.spree.rb} +0 -0
  57. data/spec/dummy/db/migrate/20141112193413_add_states_required_to_countries.spree.rb +6 -0
  58. data/spec/dummy/db/migrate/20141112193414_add_on_demand_to_product_and_variant.spree.rb +7 -0
  59. data/spec/dummy/db/migrate/{20121121030245_remove_not_null_constraint_from_products_on_hand.spree.rb → 20141112193415_remove_not_null_constraint_from_products_on_hand.spree.rb} +0 -0
  60. data/spec/dummy/db/migrate/20141112193416_split_prices_from_variants.spree.rb +32 -0
  61. data/spec/dummy/db/migrate/20141112193417_remove_not_null_from_spree_prices_amount.spree.rb +10 -0
  62. data/spec/dummy/db/migrate/20141112193418_add_currency_to_line_items.spree.rb +6 -0
  63. data/spec/dummy/db/migrate/20141112193419_add_currency_to_orders.spree.rb +6 -0
  64. data/spec/dummy/db/migrate/20141112193420_add_cost_currency_to_variants.spree.rb +6 -0
  65. data/spec/dummy/db/migrate/20141112193421_remove_display_on_from_payment_methods.spree.rb +6 -0
  66. data/spec/dummy/db/migrate/20141112193422_add_position_to_taxonomies.spree.rb +6 -0
  67. data/spec/dummy/db/migrate/20141112193423_add_last_ip_to_spree_orders.spree.rb +6 -0
  68. data/spec/dummy/db/migrate/20141112193424_add_state_to_spree_adjustments.spree.rb +7 -0
  69. data/spec/dummy/db/migrate/20141112193425_add_display_on_to_spree_payment_methods.spree.rb +10 -0
  70. data/spec/dummy/db/migrate/20141112193426_add_position_to_product_properties.spree.rb +7 -0
  71. data/spec/dummy/db/migrate/20141112193427_add_identifier_to_spree_payments.spree.rb +6 -0
  72. data/spec/dummy/db/migrate/20141112193428_add_order_id_index_to_payments.spree.rb +10 -0
  73. data/spec/dummy/db/migrate/20141112193429_add_primary_to_spree_products_taxons.spree.rb +6 -0
  74. data/spec/dummy/db/migrate/20141112193430_create_spree_stock_items.spree.rb +15 -0
  75. data/spec/dummy/db/migrate/20141112193431_create_spree_stock_locations.spree.rb +12 -0
  76. data/spec/dummy/db/migrate/20141112193432_create_default_stock.spree.rb +31 -0
  77. data/spec/dummy/db/migrate/20141112193433_add_order_id_index_to_shipments.spree.rb +6 -0
  78. data/spec/dummy/db/migrate/20141112193434_change_meta_description_on_spree_products_to_text.spree.rb +6 -0
  79. data/spec/dummy/db/migrate/20141112193435_add_stock_location_id_to_spree_shipments.spree.rb +6 -0
  80. data/spec/dummy/db/migrate/20141112193436_add_pending_to_inventory_unit.spree.rb +7 -0
  81. data/spec/dummy/db/migrate/20141112193437_remove_on_demand_from_product_and_variant.spree.rb +7 -0
  82. data/spec/dummy/db/migrate/20141112193438_create_shipping_method_zone.spree.rb +23 -0
  83. data/spec/dummy/db/migrate/20141112193439_remove_shipping_category_id_from_shipping_method.spree.rb +6 -0
  84. data/spec/dummy/db/migrate/20141112193440_create_shipping_method_categories.spree.rb +14 -0
  85. data/spec/dummy/db/migrate/20141112193441_add_tracking_url_to_spree_shipping_methods.spree.rb +6 -0
  86. data/spec/dummy/db/migrate/20141112193442_create_spree_shipping_rates.spree.rb +25 -0
  87. data/spec/dummy/db/migrate/20141112193443_remove_category_match_attributes_from_shipping_method.spree.rb +8 -0
  88. data/spec/dummy/db/migrate/20141112193444_create_stock_movements.spree.rb +13 -0
  89. data/spec/dummy/db/migrate/20141112193445_add_address_fields_to_stock_location.spree.rb +23 -0
  90. data/spec/dummy/db/migrate/20141112193446_add_active_field_to_stock_locations.spree.rb +6 -0
  91. data/spec/dummy/db/migrate/20141112193447_add_backorderable_to_stock_item.spree.rb +6 -0
  92. data/spec/dummy/db/migrate/20141112193448_add_default_quantity_to_stock_movement.spree.rb +6 -0
  93. data/spec/dummy/db/migrate/20141112193449_add_source_and_destination_to_stock_movements.spree.rb +9 -0
  94. data/spec/dummy/db/migrate/20141112193450_change_orders_total_precision.spree.rb +9 -0
  95. data/spec/dummy/db/migrate/20141112193451_change_spree_payments_amount_precision.spree.rb +8 -0
  96. data/spec/dummy/db/migrate/20141112193452_change_spree_return_authorization_amount_precision.spree.rb +8 -0
  97. data/spec/dummy/db/migrate/20141112193453_change_adjustments_amount_precision.spree.rb +8 -0
  98. data/spec/dummy/db/migrate/20141112193454_add_originator_to_stock_movement.spree.rb +8 -0
  99. data/spec/dummy/db/migrate/20141112193455_drop_source_and_destination_from_stock_movement.spree.rb +16 -0
  100. data/spec/dummy/db/migrate/20141112193456_migrate_inventory_unit_sold_to_on_hand.spree.rb +10 -0
  101. data/spec/dummy/db/migrate/20141112193457_add_stock_location_to_rma.spree.rb +6 -0
  102. data/spec/dummy/db/migrate/20141112193458_update_shipment_state_for_canceled_orders.spree.rb +16 -0
  103. data/spec/dummy/db/migrate/20141112193459_add_seo_metas_to_taxons.spree.rb +10 -0
  104. data/spec/dummy/db/migrate/20141112193460_remove_stock_item_and_variant_lock.spree.rb +15 -0
  105. data/spec/dummy/db/migrate/20141112193461_add_name_to_spree_credit_cards.spree.rb +6 -0
  106. data/spec/dummy/db/migrate/20141112193462_update_name_fields_on_spree_credit_cards.spree.rb +14 -0
  107. data/spec/dummy/db/migrate/20141112193463_add_index_to_source_columns_on_adjustments.spree.rb +6 -0
  108. data/spec/dummy/db/migrate/20141112193464_update_adjustment_states.spree.rb +17 -0
  109. data/spec/dummy/db/migrate/20141112193465_add_shipping_rates_to_shipments.spree.rb +16 -0
  110. data/spec/dummy/db/migrate/20141112193466_create_spree_stock_transfers.spree.rb +15 -0
  111. data/spec/dummy/db/migrate/20141112193467_drop_products_count_on_hand.spree.rb +6 -0
  112. data/spec/dummy/db/migrate/20141112193468_set_default_shipping_rate_cost.spree.rb +6 -0
  113. data/spec/dummy/db/migrate/20141112193469_add_number_to_stock_transfer.spree.rb +24 -0
  114. data/spec/dummy/db/migrate/20141112193470_add_sku_index_to_spree_variants.spree.rb +6 -0
  115. data/spec/dummy/db/migrate/20141112193471_add_backorderable_default_to_spree_stock_location.spree.rb +6 -0
  116. data/spec/dummy/db/migrate/20141112193472_add_propage_all_variants_to_spree_stock_location.spree.rb +6 -0
  117. data/spec/dummy/db/migrate/20141112193473_rename_shipping_methods_zones_to_spree_shipping_methods_zones.spree.rb +11 -0
  118. data/spec/dummy/db/migrate/20141112193474_add_user_id_index_to_spree_orders.spree.rb +6 -0
  119. data/spec/dummy/db/migrate/20141112193475_add_updated_at_to_spree_countries.spree.rb +10 -0
  120. data/spec/dummy/db/migrate/20141112193476_add_updated_at_to_spree_states.spree.rb +10 -0
  121. data/spec/dummy/db/migrate/20141112193477_add_cvv_result_code_and_cvv_result_message_to_spree_payments.spree.rb +7 -0
  122. data/spec/dummy/db/migrate/20141112193478_add_unique_index_to_permalink_on_spree_products.spree.rb +6 -0
  123. data/spec/dummy/db/migrate/20141112193479_add_unique_index_to_orders_shipments_and_stock_transfers.spree.rb +8 -0
  124. data/spec/dummy/db/migrate/20141112193480_add_deleted_at_to_spree_tax_rates.spree.rb +6 -0
  125. data/spec/dummy/db/migrate/20141112193481_remove_lock_version_from_inventory_units.spree.rb +7 -0
  126. data/spec/dummy/db/migrate/20141112193482_add_cost_price_to_line_item.spree.rb +6 -0
  127. data/spec/dummy/db/migrate/20141112193483_set_backorderable_to_default_to_false.spree.rb +7 -0
  128. data/spec/dummy/db/migrate/20141112193484_add_created_by_id_to_spree_orders.spree.rb +6 -0
  129. data/spec/dummy/db/migrate/20141112193485_index_completed_at_on_spree_orders.spree.rb +6 -0
  130. data/spec/dummy/db/migrate/20141112193486_add_tax_category_id_to_spree_line_items.spree.rb +6 -0
  131. data/spec/dummy/db/migrate/20141112193487_migrate_tax_categories_to_line_items.spree.rb +11 -0
  132. data/spec/dummy/db/migrate/20141112193488_drop_spree_mail_methods.spree.rb +13 -0
  133. data/spec/dummy/db/migrate/20141112193489_set_default_stock_location_on_shipments.spree.rb +9 -0
  134. data/spec/dummy/db/migrate/20141112193490_upgrade_adjustments.spree.rb +40 -0
  135. data/spec/dummy/db/migrate/20141112193491_rename_adjustment_fields.spree.rb +15 -0
  136. data/spec/dummy/db/migrate/20141112193492_add_admin_name_column_to_spree_shipping_methods.spree.rb +6 -0
  137. data/spec/dummy/db/migrate/20141112193493_add_admin_name_column_to_spree_stock_locations.spree.rb +6 -0
  138. data/spec/dummy/db/migrate/20141112193494_add_shipment_total_to_spree_orders.spree.rb +6 -0
  139. data/spec/dummy/db/migrate/20141112193495_expand_order_number_size.spree.rb +10 -0
  140. data/spec/dummy/db/migrate/20141112193496_rename_activators_to_promotions.spree.rb +6 -0
  141. data/spec/dummy/db/migrate/20141112193497_add_adjustment_total_to_line_items.spree.rb +6 -0
  142. data/spec/dummy/db/migrate/20141112193498_add_adjustment_total_to_shipments.spree.rb +6 -0
  143. data/spec/dummy/db/migrate/20141112193499_add_depth_to_spree_taxons.spree.rb +17 -0
  144. data/spec/dummy/db/migrate/20141112193500_add_tax_total_to_line_items_shipments_and_orders.spree.rb +9 -0
  145. data/spec/dummy/db/migrate/20141112193501_add_shipping_category_to_shipping_methods_and_products.spree.rb +16 -0
  146. data/spec/dummy/db/migrate/20141112193502_migrate_old_shipping_calculators.spree.rb +20 -0
  147. data/spec/dummy/db/migrate/20141112193503_add_code_to_spree_promotion_rules.spree.rb +6 -0
  148. data/spec/dummy/db/migrate/20141112193504_change_states_required_for_countries.spree.rb +10 -0
  149. data/spec/dummy/db/migrate/20141112193505_add_deleted_at_to_spree_stock_items.spree.rb +6 -0
  150. data/spec/dummy/db/migrate/20141112193506_remove_promotions_event_name_field.spree.rb +6 -0
  151. data/spec/dummy/db/migrate/20141112193507_add_promo_total_to_line_items_and_shipments_and_orders.spree.rb +8 -0
  152. data/spec/dummy/db/migrate/20141112193508_remove_unused_credit_card_fields.spree.rb +17 -0
  153. data/spec/dummy/db/migrate/20141112193509_add_track_inventory_to_variant.spree.rb +6 -0
  154. data/spec/dummy/db/migrate/20141112193510_add_tax_category_to_variants.spree.rb +7 -0
  155. data/spec/dummy/db/migrate/20141112193511_add_channel_to_spree_orders.spree.rb +6 -0
  156. data/spec/dummy/db/migrate/20141112193512_add_included_to_adjustments.spree.rb +6 -0
  157. data/spec/dummy/db/migrate/20141112193513_rename_tax_total_fields.spree.rb +12 -0
  158. data/spec/dummy/db/migrate/20141112193514_add_line_item_id_to_spree_inventory_units.spree.rb +22 -0
  159. data/spec/dummy/db/migrate/20141112193515_add_updated_at_to_variants.spree.rb +6 -0
  160. data/spec/dummy/db/migrate/20141112193516_add_position_to_classifications.spree.rb +6 -0
  161. data/spec/dummy/db/migrate/20141112193517_create_spree_orders_promotions.spree.rb +9 -0
  162. data/spec/dummy/db/migrate/20141112193518_unique_shipping_method_categories.spree.rb +25 -0
  163. data/spec/dummy/db/migrate/20141112193519_add_item_count_to_spree_orders.spree.rb +6 -0
  164. data/spec/dummy/db/migrate/20141112193520_remove_value_type_from_spree_preferences.spree.rb +9 -0
  165. data/spec/dummy/db/migrate/20141112193521_rename_permalink_to_slug_for_products.spree.rb +6 -0
  166. data/spec/dummy/db/migrate/20141112193522_add_index_to_variant_id_and_currency_on_prices.spree.rb +6 -0
  167. data/spec/dummy/db/migrate/20141112193523_rename_activator_id_in_rules_and_actions_to_promotion_id.spree.rb +7 -0
  168. data/spec/dummy/db/migrate/20141112193524_add_deleted_at_to_spree_prices.spree.rb +6 -0
  169. data/spec/dummy/db/migrate/20141112193525_add_approver_id_and_approved_at_to_orders.spree.rb +7 -0
  170. data/spec/dummy/db/migrate/20141112193526_add_confirmation_delivered_to_spree_orders.spree.rb +6 -0
  171. data/spec/dummy/db/migrate/20141112193527_add_auto_capture_to_payment_methods.spree.rb +6 -0
  172. data/spec/dummy/db/migrate/20141112193528_create_spree_payment_capture_events.spree.rb +13 -0
  173. data/spec/dummy/db/migrate/20141112193529_add_uncaptured_amount_to_payments.spree.rb +6 -0
  174. data/spec/dummy/db/migrate/20141112193530_default_variant_weight_to_zero.spree.rb +12 -0
  175. data/spec/dummy/db/migrate/20141112193531_add_tax_category_id_to_shipping_methods.spree.rb +6 -0
  176. data/spec/dummy/db/migrate/20141112193532_add_tax_rate_id_to_shipping_rates.spree.rb +6 -0
  177. data/spec/dummy/db/migrate/20141112193533_add_pre_tax_amount_to_line_items_and_shipments.spree.rb +7 -0
  178. data/spec/dummy/db/migrate/20141112193534_add_more_indexes.spree.rb +14 -0
  179. data/spec/dummy/db/migrate/20141112193535_add_considered_risky_to_orders.spree.rb +6 -0
  180. data/spec/dummy/db/migrate/20141112193536_add_preference_store_to_everything.spree.rb +9 -0
  181. data/spec/dummy/db/migrate/20141112193537_add_user_id_to_spree_credit_cards.spree.rb +14 -0
  182. data/spec/dummy/db/migrate/20141112193538_migrate_old_preferences.spree.rb +24 -0
  183. data/spec/dummy/db/migrate/20141112193539_create_spree_stores.spree.rb +26 -0
  184. data/spec/dummy/db/migrate/20141112193540_create_store_from_preferences.spree.rb +31 -0
  185. data/spec/dummy/db/migrate/20141112193541_add_timestamps_to_spree_assets.spree.rb +7 -0
  186. data/spec/dummy/db/migrate/20141112193542_add_additional_store_fields.spree.rb +9 -0
  187. data/spec/dummy/db/migrate/20141112193543_add_many_missing_indexes.spree.rb +19 -0
  188. data/spec/dummy/db/migrate/20141112193544_correct_some_polymorphic_index_and_add_more_missing.spree.rb +67 -0
  189. data/spec/dummy/db/migrate/20141112193545_add_user_id_created_by_id_index_to_order.spree.rb +6 -0
  190. data/spec/dummy/db/migrate/20141112193546_change_spree_price_amount_precision.spree.rb +9 -0
  191. data/spec/dummy/db/migrate/20141112193547_add_token_to_spree_orders.spree.rb +6 -0
  192. data/spec/dummy/db/migrate/20141112193548_move_order_token_from_tokenized_permission.spree.rb +30 -0
  193. data/spec/dummy/db/migrate/20141112193549_set_shipment_total_for_users_upgrading.spree.rb +11 -0
  194. data/spec/dummy/db/migrate/20141112193550_drop_credit_card_first_name_and_last_name.spree.rb +7 -0
  195. data/spec/dummy/db/migrate/20141112193551_add_deleted_at_to_spree_promotion_actions.spree.rb +7 -0
  196. data/spec/dummy/db/migrate/20141112193552_remove_uncaptured_amount_from_spree_payments.spree.rb +6 -0
  197. data/spec/dummy/db/migrate/20141112193553_add_default_to_shipment_cost.spree.rb +11 -0
  198. data/spec/dummy/db/migrate/20141112193554_default_pre_tax_amount_should_be_zero.spree.rb +7 -0
  199. data/spec/dummy/db/migrate/20141112193555_add_state_lock_version_to_order.spree.rb +6 -0
  200. data/spec/dummy/db/migrate/20141112193556_fix_adjustment_order_presence.spree.rb +14 -0
  201. data/spec/dummy/db/migrate/20141112193557_update_classifications_positions.spree.rb +10 -0
  202. data/spec/dummy/db/migrate/20141112193558_add_api_key_to_spree_users.spree_api.rb +8 -0
  203. data/spec/dummy/db/migrate/20141112193559_resize_api_key_field.spree_api.rb +8 -0
  204. data/spec/dummy/db/migrate/20141112193560_rename_api_key_to_spree_api_key.spree_api.rb +8 -0
  205. data/spec/dummy/db/migrate/20141112193561_add_index_to_user_spree_api_key.spree_api.rb +8 -0
  206. data/spec/dummy/db/migrate/{20121121030246_create_users.spree_auth.rb → 20141112193562_create_users.spree_auth.rb} +0 -0
  207. data/spec/dummy/db/migrate/{20121121030247_rename_columns_for_devise.spree_auth.rb → 20141112193563_rename_columns_for_devise.spree_auth.rb} +0 -0
  208. data/spec/dummy/db/migrate/{20121121030248_convert_user_remember_field.spree_auth.rb → 20141112193564_convert_user_remember_field.spree_auth.rb} +0 -0
  209. data/spec/dummy/db/migrate/{20121121030249_add_reset_password_sent_at_to_spree_users.spree_auth.rb → 20141112193565_add_reset_password_sent_at_to_spree_users.spree_auth.rb} +0 -0
  210. data/spec/dummy/db/migrate/{20121121030250_make_users_email_index_unique.spree_auth.rb → 20141112193566_make_users_email_index_unique.spree_auth.rb} +0 -0
  211. data/spec/dummy/db/migrate/20141202172111_create_spree_mercado_pago_notifications.spree_mercado_pago_payment_method_engine.rb +10 -0
  212. data/spec/dummy/db/schema.rb +581 -260
  213. data/spec/dummy/db/seeds.rb +2 -2
  214. data/spec/dummy/db/spree_development.sqlite3 +0 -0
  215. data/spec/dummy/db/spree_test.sqlite3 +0 -0
  216. data/spec/dummy/log/development.log +27822 -1376
  217. data/spec/dummy/log/test.log +87064 -37048
  218. data/spec/dummy/public/404.html +54 -13
  219. data/spec/dummy/public/422.html +54 -13
  220. data/spec/dummy/public/500.html +53 -12
  221. data/spec/dummy/tmp/cache/17E/D61/spree%2Fapp_configuration%2Fdefault_seo_title +1 -0
  222. data/spec/dummy/tmp/cache/2CC/B21/spree%2Fapp_configuration%2Frequire_master_price +1 -0
  223. data/spec/dummy/tmp/cache/334/AA1/spree%2Fapp_configuration%2Fdefault_meta_keywords +1 -0
  224. data/spec/dummy/tmp/cache/397/F31/spree%2Fapp_configuration%2Fbinary_inventory_cache +1 -0
  225. data/spec/dummy/tmp/cache/39C/F91/spree%2Fapp_configuration%2Ftax_using_ship_address +1 -0
  226. data/spec/dummy/tmp/cache/3A7/4A1/spree%2Fapp_configuration%2Faddress_requires_state +1 -0
  227. data/spec/dummy/tmp/cache/3B7/CD1/spree%2Fapp_configuration%2Fredirect_https_to_http +1 -0
  228. data/spec/dummy/tmp/cache/3BE/851/spree%2Fapp_configuration%2Ftrack_inventory_levels +1 -0
  229. data/spec/dummy/tmp/cache/460/D81/spree%2Fapp_configuration%2Fdefault_meta_description +1 -0
  230. data/spec/dummy/tmp/cache/5AE/6A1/spree%2Fapp_configuration%2Falways_include_confirm_step +1 -0
  231. data/spec/dummy/tmp/cache/DD9/320/spree%2Fapp_configuration%2Fsite_url +1 -0
  232. data/spec/dummy/tmp/cache/DDD/2D0/spree%2Fapp_configuration%2Fcurrency +1 -0
  233. data/spec/dummy/tmp/cache/E27/320/spree%2Fapp_configuration%2Fsite_name +1 -0
  234. data/spec/dummy/tmp/cache/E9B/7F0/spree%2Fapp_configuration%2Fmails_from +1 -0
  235. data/spec/dummy/tmp/cache/F01/FD0/spree%2Ffrontend_configuration%2Flocale +1 -0
  236. data/spec/dummy/{app/assets/javascripts/admin → vendor/assets/javascripts/spree/backend}/all.js +2 -1
  237. data/spec/dummy/{app/assets/javascripts/store → vendor/assets/javascripts/spree/frontend}/all.js +2 -1
  238. data/spec/dummy/{app/assets/stylesheets/admin → vendor/assets/stylesheets/spree/backend}/all.css +2 -1
  239. data/spec/dummy/{app/assets/stylesheets/store → vendor/assets/stylesheets/spree/frontend}/all.css +2 -1
  240. data/spec/models/mercado_pago/client_spec.rb +138 -0
  241. data/spec/models/mercado_pago/notification_spec.rb +17 -0
  242. data/spec/models/mercado_pago/order_preferences_builder_spec.rb +66 -0
  243. data/spec/services/mercado_pago/process_notification_spec.rb +57 -0
  244. data/spec/spec_helper.rb +12 -53
  245. metadata +444 -328
  246. data/app/assets/javascripts/store/spree_mercado_pago_payment_method.js +0 -1
  247. data/app/controllers/spree/checkout_controller_decorator.rb +0 -29
  248. data/app/models/payment_method/mercado_pago.rb +0 -33
  249. data/app/models/spree_mercado_pago_client.rb +0 -102
  250. data/app/views/spree/mercado_pago/failure.html.erb +0 -1
  251. data/app/views/spree/mercado_pago/pending.html.erb +0 -1
  252. data/app/views/spree/mercado_pago/success.html.erb +0 -1
  253. data/spec/controllers/spree/checkout_controller_spec.rb +0 -57
  254. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  255. data/spec/dummy/db/migrate/20121121030140_spree_zero_nine_zero.spree.rb +0 -392
  256. data/spec/dummy/db/migrate/20121121030141_create_indexes_for_inventory_units.spree.rb +0 -7
  257. data/spec/dummy/db/migrate/20121121030142_add_count_on_hand_to_variants_and_products.spree.rb +0 -50
  258. data/spec/dummy/db/migrate/20121121030143_change_taxons_to_nested_set.spree.rb +0 -47
  259. data/spec/dummy/db/migrate/20121121030144_move_to_configurable_gateways.spree.rb +0 -55
  260. data/spec/dummy/db/migrate/20121121030145_add_open_id_authentication_tables.spree.rb +0 -16
  261. data/spec/dummy/db/migrate/20121121030146_add_openid_field_to_users.spree.rb +0 -27
  262. data/spec/dummy/db/migrate/20121121030147_change_preference_value_type.spree.rb +0 -11
  263. data/spec/dummy/db/migrate/20121121030148_create_billing_integrations.spree.rb +0 -13
  264. data/spec/dummy/db/migrate/20121121030149_charge_refactoring.spree.rb +0 -40
  265. data/spec/dummy/db/migrate/20121121030150_add_some_indexes.spree.rb +0 -12
  266. data/spec/dummy/db/migrate/20121121030151_checkout_state_machine.spree.rb +0 -6
  267. data/spec/dummy/db/migrate/20121121030152_state_for_shipments.spree.rb +0 -6
  268. data/spec/dummy/db/migrate/20121121030153_make_state_events_polymorphic.spree.rb +0 -13
  269. data/spec/dummy/db/migrate/20121121030154_ship_address_id_for_checkouts.spree.rb +0 -6
  270. data/spec/dummy/db/migrate/20121121030155_shipping_method_id_for_checkouts.spree.rb +0 -6
  271. data/spec/dummy/db/migrate/20121121030156_creditcard_last_four_digits.spree.rb +0 -15
  272. data/spec/dummy/db/migrate/20121121030157_populate_legacy_shipment_state.spree.rb +0 -16
  273. data/spec/dummy/db/migrate/20121121030158_add_cost_price.spree.rb +0 -6
  274. data/spec/dummy/db/migrate/20121121030159_shipment_id_for_inventory_units.spree.rb +0 -26
  275. data/spec/dummy/db/migrate/20121121030160_cim_fields_for_creditcards.spree.rb +0 -7
  276. data/spec/dummy/db/migrate/20121121030161_create_return_authorizations.spree.rb +0 -13
  277. data/spec/dummy/db/migrate/20121121030162_add_return_authorization_to_inventory_units.spree.rb +0 -6
  278. data/spec/dummy/db/migrate/20121121030163_create_trackers.spree.rb +0 -11
  279. data/spec/dummy/db/migrate/20121121030164_creditcard_id_for_creditcard_txns.spree.rb +0 -6
  280. data/spec/dummy/db/migrate/20121121030165_original_creditcard_txn_id_for_creditcard_txns.spree.rb +0 -6
  281. data/spec/dummy/db/migrate/20121121030166_add_test_mode_to_billing_integration.spree.rb +0 -7
  282. data/spec/dummy/db/migrate/20121121030167_create_payment_methods.spree.rb +0 -17
  283. data/spec/dummy/db/migrate/20121121030168_polymorphic_payments.spree.rb +0 -43
  284. data/spec/dummy/db/migrate/20121121030169_change_payments_payment_method_to_belongs_to.spree.rb +0 -12
  285. data/spec/dummy/db/migrate/20121121030170_assign_creditcard_txns_to_payment.spree.rb +0 -24
  286. data/spec/dummy/db/migrate/20121121030171_sti_for_transactions.spree.rb +0 -16
  287. data/spec/dummy/db/migrate/20121121030172_drop_billing_integrations.spree.rb +0 -17
  288. data/spec/dummy/db/migrate/20121121030173_deleted_at_for_payment_methods.spree.rb +0 -15
  289. data/spec/dummy/db/migrate/20121121030174_add_adjustments_index.spree.rb +0 -7
  290. data/spec/dummy/db/migrate/20121121030175_add_alt_text_to_images.spree.rb +0 -6
  291. data/spec/dummy/db/migrate/20121121030176_fix_existing_coupon_credits.spree.rb +0 -14
  292. data/spec/dummy/db/migrate/20121121030177_add_display_to_payment_methods.spree.rb +0 -6
  293. data/spec/dummy/db/migrate/20121121030178_add_addresses_checkouts_indexes.spree.rb +0 -9
  294. data/spec/dummy/db/migrate/20121121030179_add_icon_to_taxons.spree.rb +0 -18
  295. data/spec/dummy/db/migrate/20121121030180_add_description_to_taxons.spree.rb +0 -12
  296. data/spec/dummy/db/migrate/20121121030181_index_for_shipments_number.spree.rb +0 -6
  297. data/spec/dummy/db/migrate/20121121030182_add_index_on_users_persistence_token.spree.rb +0 -8
  298. data/spec/dummy/db/migrate/20121121030183_add_default_to_tax_categories.spree.rb +0 -6
  299. data/spec/dummy/db/migrate/20121121030184_add_display_to_shipping_methods.spree.rb +0 -6
  300. data/spec/dummy/db/migrate/20121121030185_rename_payment_method_display.spree.rb +0 -6
  301. data/spec/dummy/db/migrate/20121121030186_rename_preferences_field.spree.rb +0 -6
  302. data/spec/dummy/db/migrate/20121121030187_add_guest_flag.spree.rb +0 -8
  303. data/spec/dummy/db/migrate/20121121030188_drop_order_token.spree.rb +0 -10
  304. data/spec/dummy/db/migrate/20121121030189_payments_state_and_assigned_to_order_only.spree.rb +0 -15
  305. data/spec/dummy/db/migrate/20121121030190_create_address_keys_for_order.spree.rb +0 -7
  306. data/spec/dummy/db/migrate/20121121030191_payment_total_for_orders.spree.rb +0 -6
  307. data/spec/dummy/db/migrate/20121121030192_shipping_method_id_for_orders.spree.rb +0 -6
  308. data/spec/dummy/db/migrate/20121121030193_add_shipment_and_payment_state.spree.rb +0 -7
  309. data/spec/dummy/db/migrate/20121121030194_refactor_adjustments.spree.rb +0 -30
  310. data/spec/dummy/db/migrate/20121121030195_response_code_and_avs_response_for_payments.spree.rb +0 -7
  311. data/spec/dummy/db/migrate/20121121030196_change_guest_flag_to_anonymous.spree.rb +0 -8
  312. data/spec/dummy/db/migrate/20121121030197_email_for_orders.spree.rb +0 -6
  313. data/spec/dummy/db/migrate/20121121030198_create_mail_methods.spree.rb +0 -11
  314. data/spec/dummy/db/migrate/20121121030199_rename_frozen_to_locked.spree.rb +0 -6
  315. data/spec/dummy/db/migrate/20121121030200_move_special_instructions_to_orders.spree.rb +0 -11
  316. data/spec/dummy/db/migrate/20121121030201_create_log_entries.spree.rb +0 -12
  317. data/spec/dummy/db/migrate/20121121030202_migrate_transactions_to_payment_state.spree.rb +0 -99
  318. data/spec/dummy/db/migrate/20121121030203_delete_in_progress_orders.spree.rb +0 -20
  319. data/spec/dummy/db/migrate/20121121030204_migrate_checkout_to_orders.spree.rb +0 -24
  320. data/spec/dummy/db/migrate/20121121030205_remove_shipped_state.spree.rb +0 -13
  321. data/spec/dummy/db/migrate/20121121030206_prevent_nil_payment_total.spree.rb +0 -9
  322. data/spec/dummy/db/migrate/20121121030207_prevent_nil_email.spree.rb +0 -10
  323. data/spec/dummy/db/migrate/20121121030208_generate_anonymous_users.spree.rb +0 -21
  324. data/spec/dummy/db/migrate/20121121030209_update_order_state.spree.rb +0 -13
  325. data/spec/dummy/db/migrate/20121121030210_cleanup_legacy_tables.spree.rb +0 -12
  326. data/spec/dummy/db/migrate/20121121030211_remove_number_and_cvv_from_credicard.spree.rb +0 -12
  327. data/spec/dummy/db/migrate/20121121030212_drop_anonymous_field_for_user.spree.rb +0 -12
  328. data/spec/dummy/db/migrate/20121121030213_renamed_rma_cancelled_state.spree.rb +0 -10
  329. data/spec/dummy/db/migrate/20121121030214_fix_problematic_index_names.spree.rb +0 -14
  330. data/spec/dummy/db/migrate/20121121030215_add_position_to_variants.spree.rb +0 -6
  331. data/spec/dummy/db/migrate/20121121030216_add_next_state_to_state_events.spree.rb +0 -6
  332. data/spec/dummy/db/migrate/20121121030217_add_position_to_option_types.spree.rb +0 -6
  333. data/spec/dummy/db/migrate/20121121030218_remove_trailing_slashes_in_taxon_permalinks.spree.rb +0 -20
  334. data/spec/dummy/db/migrate/20121121030219_create_activators.spree.rb +0 -15
  335. data/spec/dummy/db/migrate/20121121030220_eligible_for_adjustments.spree.rb +0 -6
  336. data/spec/dummy/db/migrate/20121121030221_namespace_top_level_models.spree.rb +0 -67
  337. data/spec/dummy/db/migrate/20121121030222_migrate_namespaced_polymorphic_models.spree.rb +0 -53
  338. data/spec/dummy/db/migrate/20121121030223_make_adjustments_polymorphic.spree.rb +0 -10
  339. data/spec/dummy/db/migrate/20121121030224_add_company_to_addresses.spree.rb +0 -6
  340. data/spec/dummy/db/migrate/20121121030225_add_inc_tax_to_tax_rates.spree.rb +0 -6
  341. data/spec/dummy/db/migrate/20121121030226_rename_inc_price_attribute.spree.rb +0 -6
  342. data/spec/dummy/db/migrate/20121121030227_add_default_tax_zone.spree.rb +0 -6
  343. data/spec/dummy/db/migrate/20121121030228_associate_shipping_methods_and_shipping_categories.spree.rb +0 -8
  344. data/spec/dummy/db/migrate/20121121030229_add_match_rules_to_shipping_methods.spree.rb +0 -8
  345. data/spec/dummy/db/migrate/20121121030230_new_preferences.spree.rb +0 -49
  346. data/spec/dummy/db/migrate/20121121030231_rename_state_events_to_state_changes.spree.rb +0 -10
  347. data/spec/dummy/db/migrate/20121121030232_add_deleted_at_to_tax_category.spree.rb +0 -6
  348. data/spec/dummy/db/migrate/20121121030233_migrate_images_from_products_to_variants.spree.rb +0 -38
  349. data/spec/dummy/db/migrate/20121121030234_rename_attachment_size_to_attachment_file_size.spree.rb +0 -6
  350. data/spec/dummy/db/migrate/20121121030235_increase_scale_of_tax_rate_amount.spree.rb +0 -10
  351. data/spec/dummy/db/migrate/20121121030236_create_tokenized_permissions_table.spree.rb +0 -17
  352. data/spec/dummy/db/migrate/20121121030237_convert_sales_tax_to_default_tax.spree.rb +0 -10
  353. data/spec/dummy/db/migrate/20121121030238_rename_creditcards_to_credit_cards.spree.rb +0 -12
  354. data/spec/dummy/db/migrate/20121121030239_add_deleted_at_to_spree_shipping_methods.spree.rb +0 -6
  355. data/spec/dummy/db/migrate/20121121030240_remove_credit_total_from_orders.spree.rb +0 -6
  356. data/spec/dummy/db/migrate/20121121030241_add_counter_cache_to_zone_members.spree.rb +0 -15
  357. data/spec/dummy/script/rails +0 -6
  358. data/spec/models/spree_mercado_pago_client_spec.rb +0 -131
@@ -0,0 +1,23 @@
1
+ # This migration comes from spree (originally 20130306181701)
2
+ class AddAddressFieldsToStockLocation < ActiveRecord::Migration
3
+ def change
4
+ remove_column :spree_stock_locations, :address_id
5
+
6
+ add_column :spree_stock_locations, :address1, :string
7
+ add_column :spree_stock_locations, :address2, :string
8
+ add_column :spree_stock_locations, :city, :string
9
+ add_column :spree_stock_locations, :state_id, :integer
10
+ add_column :spree_stock_locations, :state_name, :string
11
+ add_column :spree_stock_locations, :country_id, :integer
12
+ add_column :spree_stock_locations, :zipcode, :string
13
+ add_column :spree_stock_locations, :phone, :string
14
+
15
+
16
+ usa = Spree::Country.where(:iso => 'US').first
17
+ # In case USA isn't found.
18
+ # See #3115
19
+ country = usa || Spree::Country.first
20
+ Spree::Country.reset_column_information
21
+ Spree::StockLocation.update_all(:country_id => country)
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130306191917)
2
+ class AddActiveFieldToStockLocations < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_stock_locations, :active, :boolean, :default => true
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130306195650)
2
+ class AddBackorderableToStockItem < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_stock_items, :backorderable, :boolean, :default => true
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130307161754)
2
+ class AddDefaultQuantityToStockMovement < ActiveRecord::Migration
3
+ def change
4
+ change_column :spree_stock_movements, :quantity, :integer, :default => 0
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ # This migration comes from spree (originally 20130318151756)
2
+ class AddSourceAndDestinationToStockMovements < ActiveRecord::Migration
3
+ def change
4
+ change_table :spree_stock_movements do |t|
5
+ t.references :source, polymorphic: true
6
+ t.references :destination, polymorphic: true
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # This migration comes from spree (originally 20130319062004)
2
+ class ChangeOrdersTotalPrecision < ActiveRecord::Migration
3
+ def change
4
+ change_column :spree_orders, :item_total, :decimal, :precision => 10, :scale => 2, :default => 0.0, :null => false
5
+ change_column :spree_orders, :total, :decimal, :precision => 10, :scale => 2, :default => 0.0, :null => false
6
+ change_column :spree_orders, :adjustment_total, :decimal, :precision => 10, :scale => 2, :default => 0.0, :null => false
7
+ change_column :spree_orders, :payment_total, :decimal, :precision => 10, :scale => 2, :default => 0.0
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree (originally 20130319063911)
2
+ class ChangeSpreePaymentsAmountPrecision < ActiveRecord::Migration
3
+ def change
4
+
5
+ change_column :spree_payments, :amount, :decimal, :precision => 10, :scale => 2, :default => 0.0, :null => false
6
+
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree (originally 20130319064308)
2
+ class ChangeSpreeReturnAuthorizationAmountPrecision < ActiveRecord::Migration
3
+ def change
4
+
5
+ change_column :spree_return_authorizations, :amount, :decimal, :precision => 10, :scale => 2, :default => 0.0, :null => false
6
+
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree (originally 20130319082943)
2
+ class ChangeAdjustmentsAmountPrecision < ActiveRecord::Migration
3
+ def change
4
+
5
+ change_column :spree_adjustments, :amount, :decimal, :precision => 10, :scale => 2
6
+
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree (originally 20130319183250)
2
+ class AddOriginatorToStockMovement < ActiveRecord::Migration
3
+ def change
4
+ change_table :spree_stock_movements do |t|
5
+ t.references :originator, polymorphic: true
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from spree (originally 20130319190507)
2
+ class DropSourceAndDestinationFromStockMovement < ActiveRecord::Migration
3
+ def up
4
+ change_table :spree_stock_movements do |t|
5
+ t.remove_references :source, :polymorphic => true
6
+ t.remove_references :destination, :polymorphic => true
7
+ end
8
+ end
9
+
10
+ def down
11
+ change_table :spree_stock_movements do |t|
12
+ t.references :source, polymorphic: true
13
+ t.references :destination, polymorphic: true
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from spree (originally 20130325163316)
2
+ class MigrateInventoryUnitSoldToOnHand < ActiveRecord::Migration
3
+ def up
4
+ Spree::InventoryUnit.where(:state => 'sold').update_all(:state => 'on_hand')
5
+ end
6
+
7
+ def down
8
+ Spree::InventoryUnit.where(:state => 'on_hand').update_all(:state => 'sold')
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130326175857)
2
+ class AddStockLocationToRma < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_return_authorizations, :stock_location_id, :integer
5
+ end
6
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from spree (originally 20130328130308)
2
+ class UpdateShipmentStateForCanceledOrders < ActiveRecord::Migration
3
+ def up
4
+ shipments = Spree::Shipment.joins(:order).
5
+ where("spree_orders.state = 'canceled'")
6
+ case Spree::Shipment.connection.adapter_name
7
+ when "SQLite3"
8
+ shipments.update_all("state = 'cancelled'")
9
+ when "MySQL" || "PostgreSQL"
10
+ shipments.update_all("spree_shipments.state = 'cancelled'")
11
+ end
12
+ end
13
+
14
+ def down
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from spree (originally 20130328195253)
2
+ class AddSeoMetasToTaxons < ActiveRecord::Migration
3
+ def change
4
+ change_table :spree_taxons do |t|
5
+ t.string :meta_title
6
+ t.string :meta_description
7
+ t.string :meta_keywords
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ # This migration comes from spree (originally 20130329134939)
2
+ class RemoveStockItemAndVariantLock < ActiveRecord::Migration
3
+ def up
4
+ # we are moving to pessimistic locking on stock_items
5
+ remove_column :spree_stock_items, :lock_version
6
+
7
+ # variants no longer manage their count_on_hand so we are removing their lock
8
+ remove_column :spree_variants, :lock_version
9
+ end
10
+
11
+ def down
12
+ add_column :spree_stock_items, :lock_version, :integer
13
+ add_column :spree_variants, :lock_version, :integer
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130413230529)
2
+ class AddNameToSpreeCreditCards < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_credit_cards, :name, :string
5
+ end
6
+ end
@@ -0,0 +1,14 @@
1
+ # This migration comes from spree (originally 20130414000512)
2
+ class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration
3
+ def up
4
+ if ActiveRecord::Base.connection.adapter_name.downcase.include? "mysql"
5
+ execute "UPDATE spree_credit_cards SET name = CONCAT(first_name, ' ', last_name)"
6
+ else
7
+ execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name"
8
+ end
9
+ end
10
+
11
+ def down
12
+ execute "UPDATE spree_credit_cards SET name = NULL"
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130417120034)
2
+ class AddIndexToSourceColumnsOnAdjustments < ActiveRecord::Migration
3
+ def change
4
+ add_index :spree_adjustments, [:source_type, :source_id]
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ # This migration comes from spree (originally 20130417120035)
2
+ class UpdateAdjustmentStates < ActiveRecord::Migration
3
+ def up
4
+ Spree::Order.complete.find_each do |order|
5
+ order.adjustments.update_all(:state => 'closed')
6
+ end
7
+
8
+ Spree::Shipment.shipped.includes(:adjustment).find_each do |shipment|
9
+ shipment.adjustment.update_column(:state, 'finalized') if shipment.adjustment
10
+ end
11
+
12
+ Spree::Adjustment.where(:state => nil).update_all(:state => 'open')
13
+ end
14
+
15
+ def down
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from spree (originally 20130417123427)
2
+ class AddShippingRatesToShipments < ActiveRecord::Migration
3
+ def up
4
+ Spree::Shipment.find_each do |shipment|
5
+ shipment.shipping_rates.create(:shipping_method_id => shipment.shipping_method_id,
6
+ :cost => shipment.cost,
7
+ :selected => true)
8
+ end
9
+
10
+ remove_column :spree_shipments, :shipping_method_id
11
+ end
12
+
13
+ def down
14
+ add_column :spree_shipments, :shipping_method_id, :integer
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # This migration comes from spree (originally 20130418125341)
2
+ class CreateSpreeStockTransfers < ActiveRecord::Migration
3
+ def change
4
+ create_table :spree_stock_transfers do |t|
5
+ t.string :type
6
+ t.string :reference_number
7
+ t.integer :source_location_id
8
+ t.integer :destination_location_id
9
+ t.timestamps
10
+ end
11
+
12
+ add_index :spree_stock_transfers, :source_location_id
13
+ add_index :spree_stock_transfers, :destination_location_id
14
+ end
15
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130423110707)
2
+ class DropProductsCountOnHand < ActiveRecord::Migration
3
+ def up
4
+ remove_column :spree_products, :count_on_hand
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130423223847)
2
+ class SetDefaultShippingRateCost < ActiveRecord::Migration
3
+ def change
4
+ change_column :spree_shipping_rates, :cost, :decimal, default: 0, precision: 8, scale: 2
5
+ end
6
+ end
@@ -0,0 +1,24 @@
1
+ # This migration comes from spree (originally 20130509115210)
2
+ class AddNumberToStockTransfer < ActiveRecord::Migration
3
+ def up
4
+ remove_index :spree_stock_transfers, :source_location_id
5
+ remove_index :spree_stock_transfers, :destination_location_id
6
+
7
+ rename_column :spree_stock_transfers, :reference_number, :reference
8
+ add_column :spree_stock_transfers, :number, :string
9
+
10
+ Spree::StockTransfer.find_each do |transfer|
11
+ transfer.send(:generate_stock_transfer_number)
12
+ transfer.save!
13
+ end
14
+
15
+ add_index :spree_stock_transfers, :number
16
+ add_index :spree_stock_transfers, :source_location_id
17
+ add_index :spree_stock_transfers, :destination_location_id
18
+ end
19
+
20
+ def down
21
+ rename_column :spree_stock_transfers, :reference, :reference_number
22
+ remove_column :spree_stock_transfers, :number, :string
23
+ end
24
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130514151929)
2
+ class AddSkuIndexToSpreeVariants < ActiveRecord::Migration
3
+ def change
4
+ add_index :spree_variants, :sku
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130515180736)
2
+ class AddBackorderableDefaultToSpreeStockLocation < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_stock_locations, :backorderable_default, :boolean, default: true
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130516151222)
2
+ class AddPropageAllVariantsToSpreeStockLocation < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_stock_locations, :propagate_all_variants, :boolean, default: true
5
+ end
6
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from spree (originally 20130611054351)
2
+ class RenameShippingMethodsZonesToSpreeShippingMethodsZones < ActiveRecord::Migration
3
+ def change
4
+ rename_table :shipping_methods_zones, :spree_shipping_methods_zones
5
+ # If Spree::ShippingMethod zones association was patched in
6
+ # CreateShippingMethodZone migrations, it needs to be patched back
7
+ Spree::ShippingMethod.has_and_belongs_to_many :zones, :join_table => 'spree_shipping_methods_zones',
8
+ :class_name => 'Spree::Zone',
9
+ :foreign_key => 'shipping_method_id'
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130611185927)
2
+ class AddUserIdIndexToSpreeOrders < ActiveRecord::Migration
3
+ def change
4
+ add_index :spree_orders, :user_id
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from spree (originally 20130618041418)
2
+ class AddUpdatedAtToSpreeCountries < ActiveRecord::Migration
3
+ def up
4
+ add_column :spree_countries, :updated_at, :datetime
5
+ end
6
+
7
+ def down
8
+ remove_column :spree_countries, :updated_at
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from spree (originally 20130619012236)
2
+ class AddUpdatedAtToSpreeStates < ActiveRecord::Migration
3
+ def up
4
+ add_column :spree_states, :updated_at, :datetime
5
+ end
6
+
7
+ def down
8
+ remove_column :spree_states, :updated_at
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from spree (originally 20130626232741)
2
+ class AddCvvResultCodeAndCvvResultMessageToSpreePayments < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_payments, :cvv_response_code, :string
5
+ add_column :spree_payments, :cvv_response_message, :string
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130628021056)
2
+ class AddUniqueIndexToPermalinkOnSpreeProducts < ActiveRecord::Migration
3
+ def change
4
+ add_index "spree_products", ["permalink"], :name => "permalink_idx_unique", :unique => true
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from spree (originally 20130628022817)
2
+ class AddUniqueIndexToOrdersShipmentsAndStockTransfers < ActiveRecord::Migration
3
+ def add
4
+ add_index "spree_orders", ["number"], :name => "number_idx_unique", :unique => true
5
+ add_index "spree_shipments", ["number"], :name => "number_idx_unique", :unique => true
6
+ add_index "spree_stock_transfers", ["number"], :name => "number_idx_unique", :unique => true
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130708052307)
2
+ class AddDeletedAtToSpreeTaxRates < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_tax_rates, :deleted_at, :datetime
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from spree (originally 20130711200933)
2
+ class RemoveLockVersionFromInventoryUnits < ActiveRecord::Migration
3
+ def change
4
+ # we are moving to pessimistic locking on stock_items
5
+ remove_column :spree_inventory_units, :lock_version
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from spree (originally 20130718042445)
2
+ class AddCostPriceToLineItem < ActiveRecord::Migration
3
+ def change
4
+ add_column :spree_line_items, :cost_price, :decimal, :precision => 8, :scale => 2
5
+ end
6
+ end