radiant-shop-extension 0.11.6 → 0.90.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. data/HISTORY.md +21 -3
  2. data/LICENSE +42 -0
  3. data/README.md +62 -25
  4. data/Rakefile +4 -5
  5. data/VERSION +1 -1
  6. data/app/controllers/admin/shop/categories_controller.rb +1 -0
  7. data/app/controllers/admin/shop/orders_controller.rb +1 -1
  8. data/app/controllers/admin/shop/products_controller.rb +18 -7
  9. data/app/helpers/shop_helper.rb +8 -0
  10. data/app/models/form_address.rb +5 -5
  11. data/app/models/form_checkout.rb +25 -17
  12. data/app/models/form_line_item.rb +1 -1
  13. data/app/models/shop_category.rb +22 -7
  14. data/app/models/shop_customer.rb +1 -1
  15. data/app/models/shop_line_item.rb +26 -26
  16. data/app/models/shop_order.rb +0 -2
  17. data/app/models/shop_product.rb +15 -18
  18. data/app/views/.DS_Store +0 -0
  19. data/app/views/admin/shop/categories/edit/meta/_status.html.haml +3 -0
  20. data/app/views/admin/shop/products/edit/_foot.html.haml +1 -8
  21. data/app/views/admin/shop/products/edit/meta/_layout.html.haml +6 -0
  22. data/app/views/admin/shop/products/edit/meta/_status.html.haml +3 -0
  23. data/app/views/admin/shop/products/index/_product.html.haml +1 -1
  24. data/config/locales/en.yml +8 -7
  25. data/config/routes.rb +4 -16
  26. data/db/migrate/20101011063133_setup_shop.rb +94 -0
  27. data/db/seeds/forms.rb +113 -154
  28. data/db/seeds/layouts.rb +67 -103
  29. data/db/seeds/pages.rb +101 -0
  30. data/db/seeds/products.rb +29 -0
  31. data/db/seeds/snippets.rb +36 -21
  32. data/lib/shop/controllers/application_controller.rb +5 -3
  33. data/lib/shop/models/form_extension.rb +1 -2
  34. data/lib/shop/models/page.rb +0 -1
  35. data/lib/shop/models/user.rb +0 -1
  36. data/lib/shop/tags/card.rb +8 -2
  37. data/lib/shop/tags/cart.rb +5 -1
  38. data/lib/shop/tags/helpers.rb +35 -60
  39. data/lib/shop/tags/item.rb +2 -16
  40. data/lib/shop/tags/product.rb +7 -0
  41. data/lib/tasks/shop_extension_tasks.rake +9 -4
  42. data/public/javascripts/admin/extensions/shop/products/edit.js +0 -25
  43. data/radiant-shop-extension.gemspec +25 -201
  44. data/shop_extension.rb +18 -19
  45. data/spec/datasets/forms.rb +25 -28
  46. data/spec/datasets/shop_categories.rb +2 -2
  47. data/spec/datasets/shop_config.rb +24 -0
  48. data/spec/datasets/shop_customers.rb +1 -0
  49. data/spec/datasets/shop_line_items.rb +21 -3
  50. data/spec/datasets/shop_products.rb +4 -1
  51. data/spec/datasets/tags.rb +19 -0
  52. data/spec/lib/shop/models/page_spec.rb +1 -1
  53. data/spec/lib/shop/tags/card_spec.rb +30 -4
  54. data/spec/lib/shop/tags/cart_spec.rb +29 -12
  55. data/spec/lib/shop/tags/helpers_spec.rb +45 -66
  56. data/spec/lib/shop/tags/item_spec.rb +6 -10
  57. data/spec/lib/shop/tags/product_spec.rb +27 -2
  58. data/spec/models/form_address_spec.rb +9 -8
  59. data/spec/models/form_checkout_spec.rb +28 -22
  60. data/spec/models/shop_category_spec.rb +2 -10
  61. data/spec/models/shop_line_item_spec.rb +71 -34
  62. data/spec/models/shop_order_spec.rb +5 -5
  63. data/spec/models/shop_product_attachment_spec.rb +1 -0
  64. data/spec/models/shop_product_spec.rb +4 -47
  65. data/spec/spec.opts +3 -5
  66. metadata +60 -248
  67. data/Gemfile +0 -26
  68. data/Gemfile.lock +0 -75
  69. data/MIT-LICENSE +0 -20
  70. data/app/controllers/admin/shop/discounts/discountables_controller.rb +0 -44
  71. data/app/controllers/admin/shop/discounts_controller.rb +0 -64
  72. data/app/controllers/admin/shop/packages/packings_controller.rb +0 -90
  73. data/app/controllers/admin/shop/packages_controller.rb +0 -63
  74. data/app/controllers/admin/shop/products/variant_templates_controller.rb +0 -27
  75. data/app/controllers/admin/shop/products/variants_controller.rb +0 -60
  76. data/app/controllers/admin/shop/variants_controller.rb +0 -48
  77. data/app/models/form_discount.rb +0 -39
  78. data/app/models/shop_discount.rb +0 -37
  79. data/app/models/shop_discountable.rb +0 -64
  80. data/app/models/shop_group.rb +0 -15
  81. data/app/models/shop_grouping.rb +0 -6
  82. data/app/models/shop_package.rb +0 -74
  83. data/app/models/shop_packing.rb +0 -22
  84. data/app/models/shop_product_variant.rb +0 -34
  85. data/app/models/shop_variant.rb +0 -23
  86. data/app/views/admin/pages/_shop_category.html.haml +0 -4
  87. data/app/views/admin/pages/_shop_product.html.haml +0 -4
  88. data/app/views/admin/shop/discounts/edit/_foot.html.haml +0 -16
  89. data/app/views/admin/shop/discounts/edit/_form.html.haml +0 -15
  90. data/app/views/admin/shop/discounts/edit/_head.html.haml +0 -4
  91. data/app/views/admin/shop/discounts/edit/_inputs.html.haml +0 -2
  92. data/app/views/admin/shop/discounts/edit/_meta.html.haml +0 -8
  93. data/app/views/admin/shop/discounts/edit/_parts.html.haml +0 -9
  94. data/app/views/admin/shop/discounts/edit/_popups.html.haml +0 -4
  95. data/app/views/admin/shop/discounts/edit/buttons/_browse_categories.html.haml +0 -1
  96. data/app/views/admin/shop/discounts/edit/buttons/_browse_products.html.haml +0 -1
  97. data/app/views/admin/shop/discounts/edit/inputs/_amount.html.haml +0 -3
  98. data/app/views/admin/shop/discounts/edit/inputs/_code.html.haml +0 -3
  99. data/app/views/admin/shop/discounts/edit/inputs/_name.html.haml +0 -3
  100. data/app/views/admin/shop/discounts/edit/meta/_finish.html.haml +0 -5
  101. data/app/views/admin/shop/discounts/edit/meta/_start.html.haml +0 -5
  102. data/app/views/admin/shop/discounts/edit/parts/_categories.html.haml +0 -3
  103. data/app/views/admin/shop/discounts/edit/parts/_products.html.haml +0 -3
  104. data/app/views/admin/shop/discounts/edit/popups/_browse_categories.html.haml +0 -6
  105. data/app/views/admin/shop/discounts/edit/popups/_browse_products.html.haml +0 -6
  106. data/app/views/admin/shop/discounts/edit/shared/_category.html.haml +0 -11
  107. data/app/views/admin/shop/discounts/edit/shared/_product.html.haml +0 -12
  108. data/app/views/admin/shop/discounts/edit.html.haml +0 -11
  109. data/app/views/admin/shop/discounts/index/_discount.html.haml +0 -13
  110. data/app/views/admin/shop/discounts/index/_foot.html.haml +0 -5
  111. data/app/views/admin/shop/discounts/index/_head.html.haml +0 -2
  112. data/app/views/admin/shop/discounts/index/buttons/_new_discount.html.haml +0 -1
  113. data/app/views/admin/shop/discounts/index.html.haml +0 -13
  114. data/app/views/admin/shop/discounts/new.html.haml +0 -11
  115. data/app/views/admin/shop/discounts/remove.html.haml +0 -12
  116. data/app/views/admin/shop/packages/edit/_foot.html.haml +0 -17
  117. data/app/views/admin/shop/packages/edit/_form.html.haml +0 -15
  118. data/app/views/admin/shop/packages/edit/_head.html.haml +0 -4
  119. data/app/views/admin/shop/packages/edit/_inputs.html.haml +0 -2
  120. data/app/views/admin/shop/packages/edit/_meta.html.haml +0 -8
  121. data/app/views/admin/shop/packages/edit/_parts.html.haml +0 -9
  122. data/app/views/admin/shop/packages/edit/_popups.html.haml +0 -4
  123. data/app/views/admin/shop/packages/edit/buttons/_browse_products.html.haml +0 -1
  124. data/app/views/admin/shop/packages/edit/inputs/_name.html.haml +0 -3
  125. data/app/views/admin/shop/packages/edit/inputs/_price.html.haml +0 -3
  126. data/app/views/admin/shop/packages/edit/meta/_sku.html.haml +0 -5
  127. data/app/views/admin/shop/packages/edit/parts/_description.html.haml +0 -1
  128. data/app/views/admin/shop/packages/edit/parts/_products.html.haml +0 -3
  129. data/app/views/admin/shop/packages/edit/popups/_browse_products.html.haml +0 -7
  130. data/app/views/admin/shop/packages/edit/shared/_product.html.haml +0 -8
  131. data/app/views/admin/shop/packages/edit.html.haml +0 -11
  132. data/app/views/admin/shop/packages/index/_foot.html.haml +0 -8
  133. data/app/views/admin/shop/packages/index/_head.html.haml +0 -2
  134. data/app/views/admin/shop/packages/index/_package.html.haml +0 -9
  135. data/app/views/admin/shop/packages/index/buttons/_new_package.html.haml +0 -1
  136. data/app/views/admin/shop/packages/index.html.haml +0 -13
  137. data/app/views/admin/shop/packages/new.html.haml +0 -11
  138. data/app/views/admin/shop/packages/remove.html.haml +0 -12
  139. data/app/views/admin/shop/products/edit/buttons/_browse_templates.html.haml +0 -1
  140. data/app/views/admin/shop/products/edit/buttons/_new_variant.html.haml +0 -1
  141. data/app/views/admin/shop/products/edit/parts/_variants.html.haml +0 -3
  142. data/app/views/admin/shop/products/edit/popups/_browse_templates.html.haml +0 -6
  143. data/app/views/admin/shop/products/edit/popups/_new_variant.html.haml +0 -16
  144. data/app/views/admin/shop/products/edit/shared/_template.html.haml +0 -6
  145. data/app/views/admin/shop/products/edit/shared/_variant.html.haml +0 -10
  146. data/app/views/admin/shop/products/index/buttons/_variants.html.haml +0 -1
  147. data/app/views/admin/shop/variants/edit/_foot.html.haml +0 -9
  148. data/app/views/admin/shop/variants/edit/_form.html.haml +0 -13
  149. data/app/views/admin/shop/variants/edit/_head.html.haml +0 -4
  150. data/app/views/admin/shop/variants/edit/_inputs.html.haml +0 -2
  151. data/app/views/admin/shop/variants/edit/_meta.html.haml +0 -8
  152. data/app/views/admin/shop/variants/edit/_parts.html.haml +0 -9
  153. data/app/views/admin/shop/variants/edit/_popups.html.haml +0 -4
  154. data/app/views/admin/shop/variants/edit/inputs/_name.html.haml +0 -3
  155. data/app/views/admin/shop/variants/edit/inputs/_options.html.haml +0 -3
  156. data/app/views/admin/shop/variants/edit.html.haml +0 -11
  157. data/app/views/admin/shop/variants/index/_foot.html.haml +0 -5
  158. data/app/views/admin/shop/variants/index/_head.html.haml +0 -2
  159. data/app/views/admin/shop/variants/index/_variant.html.haml +0 -9
  160. data/app/views/admin/shop/variants/index/buttons/_add_variant.html.haml +0 -1
  161. data/app/views/admin/shop/variants/index/buttons/_categories.html.haml +0 -1
  162. data/app/views/admin/shop/variants/index.html.haml +0 -13
  163. data/app/views/admin/shop/variants/new.html.haml +0 -11
  164. data/app/views/admin/shop/variants/remove.html.haml +0 -12
  165. data/app/views/shop/categories/show.html.haml +0 -1
  166. data/app/views/shop/orders/show.html.haml +0 -1
  167. data/app/views/shop/products/index.html.haml +0 -1
  168. data/app/views/shop/products/show.html.haml +0 -1
  169. data/cucumber.yml +0 -1
  170. data/db/migrate/20100311053701_initial.rb +0 -153
  171. data/db/migrate/20100927041219_remove_payment_methods.rb +0 -16
  172. data/db/migrate/20100927041624_change_payments_add_gateway.rb +0 -11
  173. data/db/migrate/20100927140446_change_payment_add_card_type_card_number.rb +0 -11
  174. data/db/migrate/20100929011106_fix_relationship_foreign_keys.rb +0 -101
  175. data/db/migrate/20100929011607_drop_shop_addressables.rb +0 -25
  176. data/db/migrate/20100929030510_create_shop_groups.rb +0 -19
  177. data/db/migrate/20100929080301_shop_groups_change_add_description.rb +0 -11
  178. data/db/migrate/20100929081200_create_variants.rb +0 -20
  179. data/db/migrate/20100929143531_change_variants_add_updated_by.rb +0 -25
  180. data/db/migrate/20100929145641_change_created_by_to_id.rb +0 -75
  181. data/db/migrate/20100929235221_change_category_add_variant_id.rb +0 -9
  182. data/db/migrate/20100930235221_create_packages.rb +0 -31
  183. data/db/migrate/20101005231713_create_page_ids.rb +0 -11
  184. data/db/migrate/20101006051214_create_pages_for_products_and_categories.rb +0 -73
  185. data/db/migrate/20101007111845_add_default_position_to_attachment.rb +0 -9
  186. data/db/migrate/20101010071143_create_discounts.rb +0 -29
  187. data/db/migrate/20101010072225_modify_categories_remove_variant.rb +0 -9
  188. data/db/migrate/20101010130034_change_discountables_add_observer.rb +0 -15
  189. data/db/migrate/20101011063133_change_orders_set_limits_to_null.rb +0 -11
  190. data/features/support/env.rb +0 -16
  191. data/features/support/paths.rb +0 -14
  192. data/lib/shop/interface/packages.rb +0 -34
  193. data/lib/shop/interface/variants.rb +0 -34
  194. data/lib/shop/tags/package.rb +0 -95
  195. data/lib/shop/tags/product_variant.rb +0 -52
  196. data/lib/shop/tags/responses.rb +0 -34
  197. data/mockups/balsamiq/products-retro_fun_tshirt-more.bmml +0 -0
  198. data/mockups/balsamiq/products-retro_fun_tshirt.bmml +0 -0
  199. data/mockups/discounts/new-edit.bmml +0 -492
  200. data/public/javascripts/admin/extensions/shop/discounts/edit.js +0 -76
  201. data/public/javascripts/admin/extensions/shop/packages/edit.js +0 -109
  202. data/public/stylesheets/sass/admin/extensions/shop/discounts/edit.sass +0 -125
  203. data/public/stylesheets/sass/admin/extensions/shop/packages/edit.sass +0 -162
  204. data/spec/controllers/admin/shop/discounts/discountables_controller_spec.rb +0 -73
  205. data/spec/controllers/admin/shop/discounts_controller_spec.rb +0 -81
  206. data/spec/controllers/admin/shop/packages/packings_controller_spec.rb +0 -188
  207. data/spec/controllers/admin/shop/packages_controller_spec.rb +0 -32
  208. data/spec/controllers/admin/shop/products/variant_templates_controller_spec.rb +0 -53
  209. data/spec/controllers/admin/shop/products/variants_controller_spec.rb +0 -116
  210. data/spec/controllers/admin/shop/variants_controller_spec.rb +0 -67
  211. data/spec/datasets/shop_discountables.rb +0 -22
  212. data/spec/datasets/shop_discounts.rb +0 -29
  213. data/spec/datasets/shop_groups.rb +0 -15
  214. data/spec/datasets/shop_packages.rb +0 -25
  215. data/spec/datasets/shop_product_variants.rb +0 -22
  216. data/spec/datasets/shop_variants.rb +0 -17
  217. data/spec/lib/shop/tags/package_spec.rb +0 -342
  218. data/spec/lib/shop/tags/product_variant_spec.rb +0 -175
  219. data/spec/lib/shop/tags/responses_spec.rb +0 -129
  220. data/spec/models/form_discount_spec.rb +0 -63
  221. data/spec/models/shop_discount_spec.rb +0 -130
  222. data/spec/models/shop_discountable_spec.rb +0 -114
  223. data/spec/models/shop_group_spec.rb +0 -38
  224. data/spec/models/shop_package_spec.rb +0 -117
  225. data/spec/models/shop_packing_spec.rb +0 -67
  226. data/spec/models/shop_product_variant_spec.rb +0 -92
  227. data/spec/models/shop_variant_spec.rb +0 -32
@@ -1,6 +0,0 @@
1
- %h3.title Variant Templates
2
-
3
- %ul#templates
4
- = render :partial => '/admin/shop/products/edit/shared/template', :collection => ShopVariant.all
5
-
6
- %a#browse_templates_popup_close.close{ :href => '#browse_templates_popup_close' }
@@ -1,16 +0,0 @@
1
- %h3.title New Variant
2
-
3
- .popup_content
4
- - form_for :shop_product_variant, :url => admin_shop_product_variants_path(@shop_product.id) do |f|
5
- = f.hidden_field :product_id, :value => @shop_product.id
6
- %ol
7
- %li.name
8
- = f.label :name
9
- = f.text_field :name
10
- %li.price
11
- = f.label :price, t('price_variation')
12
- = f.text_field :price
13
- %li.submit
14
- = f.submit 'Create'
15
-
16
- %a#new_variant_popup.close{ :href => '#new_variant_popup' }
@@ -1,6 +0,0 @@
1
- %li.template
2
- - link_to admin_shop_product_variant_template_path(@shop_product, template), :method => :put, :class => 'wrapper' do
3
- %span.name= template.name
4
- %ul.options
5
- - template.options.each do |option|
6
- %li.option= option
@@ -1,10 +0,0 @@
1
- %li.variant{ :id => "product_#{@shop_product.id}_variant_#{vf.object.id}", :'data-variant_id' => vf.object.id }
2
- %span.name
3
- = vf.text_field :name
4
- %span.price
5
- = vf.label :price, '$'
6
- = vf.text_field :price, :value => input_currency(vf.object.read_attribute(:price))
7
- %span.value
8
- = number_to_currency(vf.object.price)
9
- %span.actions
10
- %span.delete
@@ -1 +0,0 @@
1
- = link_to t("variants"), admin_shop_variants_path
@@ -1,9 +0,0 @@
1
- - render_region :foot do |foot|
2
- - foot.buttons do
3
- %p.buttons
4
- = save_model_button(@shop_variant)
5
- = save_model_and_continue_editing_button(@shop_variant)
6
- = t('or')
7
- = link_to t('cancel'), admin_shop_variants_path
8
- - foot.timestamp do
9
- = updated_stamp @shop_variant
@@ -1,13 +0,0 @@
1
- - form_for [:admin, @shop_variant], :html => {'data-onsubmit_status'=>"Saving Changes…"} do |f|
2
- - render_region :form do |form|
3
- - form.inputs do
4
- = render :partial => '/admin/shop/variants/edit/inputs', :locals => { :f => f }
5
-
6
- - form.meta do
7
- = render :partial => '/admin/shop/variants/edit/meta', :locals => { :f => f }
8
-
9
- - form.parts do
10
- = render :partial => '/admin/shop/variants/edit/parts', :locals => { :f => f }
11
-
12
- - form.foot do
13
- = render :partial => 'admin/shop/variants/edit/foot', :locals => { :f => f }
@@ -1,4 +0,0 @@
1
- %h1
2
- = @page_title
3
- - @buttons.each do |button|
4
- = render :partial => "admin/shop/variants/edit/buttons/#{button}"
@@ -1,2 +0,0 @@
1
- - @inputs.each do |input|
2
- = render :partial => "admin/shop/variants/edit/inputs/#{input}", :locals => { :f => f }
@@ -1,8 +0,0 @@
1
- - if @meta.present?
2
- .drawer
3
- .drawer_contents#attributes
4
- %table.fieldset
5
- - @meta.each do |meta|
6
- = render :partial => "admin/shop/variants/edit/meta/#{meta}", :locals => { :f => f }
7
- .drawer_handle
8
- %a.toggle{:href=>'#attributes', :rel=>"toggle[attributes]", :class=>"#{(meta_errors? ? 'less' : 'more')}"}= meta_label
@@ -1,9 +0,0 @@
1
- #tab_control
2
- #tabs.tabs
3
- #tab_toolbar
4
- #pages.pages
5
- = hidden_field_tag 'page_part_index_field' #important
6
- - @parts.each do |part|
7
- .page{:id => "variant_page_#{part}", 'data-caption'=>h(part)}
8
- .part{:id => "variant_part_#{part}"}
9
- = render :partial => "admin/shop/variants/edit/parts/#{part}", :locals => { :f => f }
@@ -1,4 +0,0 @@
1
- #popups
2
- - @popups.each do |popup|
3
- .popup{ :id => "#{popup}_popup"}
4
- = render :partial => "admin/shop/variants/edit/popups/#{popup}"
@@ -1,3 +0,0 @@
1
- %p.title
2
- %label{:for => 'shop_variant_name'}= t('name')
3
- = f.text_field :name, :class => 'textbox', :maxlenth => 255
@@ -1,3 +0,0 @@
1
- %p.title
2
- %label{:for => 'shop_variant_options'}= t('options')
3
- = f.text_field :options_json, :class => 'textbox', :maxlenth => 255
@@ -1,11 +0,0 @@
1
- - @page_title = @shop_variant.name
2
-
3
- - render_region :main do |main|
4
- - main.head do
5
- = render 'admin/shop/variants/edit/head'
6
-
7
- - main.popups do
8
- = render 'admin/shop/variants/edit/popups'
9
-
10
- - main.form do
11
- = render 'admin/shop/variants/edit/form'
@@ -1,5 +0,0 @@
1
- %ul
2
- - render_region :foot do |foot|
3
- - foot.buttons do
4
- - @buttons.each do |button|
5
- %li= render :partial => "admin/shop/variants/index/buttons/#{button}"
@@ -1,2 +0,0 @@
1
- - render_region :head do |head|
2
- - nil
@@ -1,9 +0,0 @@
1
- %li.variant.object{:id => "variant_#{variant.id}", :'data-id' => variant.id}
2
- .attributes
3
- %span.name.attribute
4
- - render_region :body do |body|
5
- - body.name do
6
- %span.name.attribute= link_to variant.name, edit_admin_shop_variant_path(variant)
7
- - body.modify do
8
- .modify
9
- %span.remove= link_to t('remove'), remove_admin_shop_variant_path(variant)
@@ -1 +0,0 @@
1
- = link_to image('plus') + " " + t("add_variant"), new_admin_shop_variant_path
@@ -1 +0,0 @@
1
- = link_to t("products"), admin_shop_products_path
@@ -1,13 +0,0 @@
1
- - @page_title = t('variants') + ' - ' + default_page_title
2
-
3
- .outset
4
-
5
- #head.min
6
- = render :partial => '/admin/shop/variants/index/head'
7
-
8
- #variants_map.map
9
- %ul#variants
10
- = render :partial => '/admin/shop/variants/index/variant', :collection => @shop_variants
11
-
12
- #actions
13
- = render :partial => '/admin/shop/variants/index/foot'
@@ -1,11 +0,0 @@
1
- - @page_title = t('new_variant')
2
-
3
- - render_region :main do |main|
4
- - main.head do
5
- = render 'admin/shop/variants/edit/head'
6
-
7
- - main.popups do
8
- = render 'admin/shop/variants/edit/popups'
9
-
10
- - main.form do
11
- = render 'admin/shop/variants/edit/form'
@@ -1,12 +0,0 @@
1
- %h1
2
- = t('remove_variant')
3
-
4
- %p
5
- = t('text.remove_variant.warning')
6
-
7
- - form_for [:admin, @shop_variant.becomes(ShopVariant)], :html => {:method => :delete, 'data-onsubmit_status'=>"Removing Variant…"} do
8
-
9
- %p.buttons
10
- %input.button{:type=>"submit", :value => t('delete_variant') }/
11
- = t('or')
12
- = link_to t('cancel'), admin_shop_variants_path
@@ -1 +0,0 @@
1
- -# empty
@@ -1 +0,0 @@
1
- -# empty
@@ -1 +0,0 @@
1
- -# empty
@@ -1 +0,0 @@
1
- -# empty
data/cucumber.yml DELETED
@@ -1 +0,0 @@
1
- default: --format progress features --tags ~@proposed,~@in_progress
@@ -1,153 +0,0 @@
1
- class Initial < ActiveRecord::Migration
2
- def self.up
3
- create_table :shop_products do |t|
4
- t.string :sku
5
- t.string :name
6
- t.text :description
7
- t.integer :position
8
- t.boolean :is_active, :default => true
9
-
10
- t.decimal :price
11
-
12
- t.decimal :weight
13
- t.decimal :height
14
- t.decimal :width
15
- t.decimal :depth
16
-
17
- t.references :layout
18
- t.references :shop_category
19
-
20
- t.integer :created_by
21
- t.integer :updated_by
22
-
23
- t.timestamps
24
- end
25
- add_index :shop_products, :position
26
- add_index :shop_products, :shop_category_id
27
-
28
- create_table :shop_product_attachments do |t|
29
- t.integer :position
30
-
31
- t.references :image
32
- t.references :shop_product
33
- end
34
- add_index :shop_product_attachments, :position
35
- add_index :shop_product_attachments, :image_id
36
- add_index :shop_product_attachments, :shop_product_id
37
-
38
- create_table :shop_categories do |t|
39
- t.string :name
40
- t.string :handle
41
- t.text :description
42
- t.integer :position
43
- t.boolean :is_active, :default => true
44
-
45
- t.references :layout
46
- t.references :product_layout
47
-
48
- t.integer :created_by
49
- t.integer :updated_by
50
-
51
- t.timestamps
52
- end
53
-
54
- create_table :shop_addressables do |t|
55
- t.references :address, :polymorphic => true
56
- t.references :addresser, :polymorphic => true
57
- end
58
- add_index :shop_addressables, :address_id
59
- add_index :shop_addressables, :addresser_id
60
-
61
- create_table :shop_addresses do |t|
62
- t.string :email
63
- t.string :name
64
- t.string :unit
65
- t.string :street
66
- t.string :city
67
- t.string :state
68
- t.string :postcode
69
- t.string :country
70
- end
71
-
72
- create_table :shop_address_billings do |t|
73
- t.references :shop_address
74
- end
75
- add_index :shop_address_billings, :shop_address_id
76
-
77
- create_table :shop_address_shippings do |t|
78
- t.references :shop_address
79
- end
80
- add_index :shop_address_shippings, :shop_address_id
81
-
82
- create_table :shop_line_items do |t|
83
- t.integer :quantity, :default => 1
84
-
85
- t.references :shop_order
86
- t.references :item, :polymorphic => true
87
-
88
- t.integer :created_by
89
- t.integer :updated_by
90
-
91
- t.timestamps
92
- end
93
- add_index :shop_line_items, :shop_order_id
94
- add_index :shop_line_items, :item_id
95
-
96
- create_table :shop_orders do |t|
97
- t.text :notes
98
- t.text :status, :default => 'new'
99
-
100
- t.references :shop_customer
101
- t.references :billing
102
- t.references :shipping
103
-
104
- t.integer :created_by
105
- t.integer :updated_by
106
-
107
- t.timestamps
108
- end
109
- add_index :shop_orders, :shop_customer_id
110
- add_index :shop_orders, :status
111
-
112
- create_table :shop_payments do |t|
113
- t.float :amount
114
-
115
- t.references :shop_order
116
- t.references :shop_payment_method
117
-
118
- t.integer :created_by
119
- t.integer :updated_by
120
-
121
- t.timestamps
122
- end
123
- add_index :shop_payments, :shop_order_id
124
- add_index :shop_payments, :shop_payment_method_id
125
-
126
- create_table :shop_payment_methods do |t|
127
- t.string :name
128
- end
129
-
130
- add_column :pages, :shop_product_id, :integer
131
- add_column :pages, :shop_category_id, :integer
132
-
133
- end
134
-
135
- def self.down
136
- drop_table :shop_products
137
- drop_table :shop_product_images
138
- drop_table :shop_categories
139
- drop_table :shop_orders
140
- drop_table :shop_order_statuses
141
- drop_table :shop_addressables
142
- drop_table :shop_address_shippings
143
- drop_table :shop_address_billings
144
- drop_table :shop_addresses
145
- drop_table :shop_line_items
146
- drop_table :shop_orders
147
- drop_table :shop_payments
148
- drop_table :shop_payment_methods
149
-
150
- remove_column :pages, :shop_product_id
151
- remove_column :pages, :shop_category_id
152
- end
153
- end
@@ -1,16 +0,0 @@
1
- class RemovePaymentMethods < ActiveRecord::Migration
2
- def self.up
3
- drop_table :shop_payment_methods
4
- remove_index :shop_payments, :shop_payment_method_id
5
- remove_column :shop_payments, :shop_payment_method_id
6
- end
7
-
8
- def self.down
9
- add_column :shop_payments, :shop_pamyent_method_id, :integer
10
- add_index :shop_payments, :shop_payment_method_id
11
-
12
- create_table :shop_payment_methods do |t|
13
- t.string :name
14
- end
15
- end
16
- end
@@ -1,11 +0,0 @@
1
- class ChangePaymentsAddGateway < ActiveRecord::Migration
2
- def self.up
3
- add_column :shop_payments, :gateway, :string
4
- add_index :shop_payments, :gateway
5
- end
6
-
7
- def self.down
8
- remove_index :shop_payments, :gateway
9
- remove_column :shop_payments, :gateway
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- class ChangePaymentAddCardTypeCardNumber < ActiveRecord::Migration
2
- def self.up
3
- add_column :shop_payments, :card_type, :string
4
- add_column :shop_payments, :card_number, :string
5
- end
6
-
7
- def self.down
8
- remove_column :shop_payments, :card_type
9
- remove_column :shop_payments, :card_number
10
- end
11
- end
@@ -1,101 +0,0 @@
1
- class FixRelationshipForeignKeys < ActiveRecord::Migration
2
- class ShopProduct < ActiveRecord::Base; end
3
- class ShopProductAttachment < ActiveRecord::Base; end
4
- class ShopLineItem < ActiveRecord::Base; end
5
- class ShopOrder < ActiveRecord::Base; end
6
- class ShopPayment < ActiveRecord::Base; end
7
-
8
- def self.up
9
- # Product - Category
10
- add_column :shop_products, :category_id, :integer
11
- add_index :shop_products, :category_id
12
- ShopProduct.all.each do |p|
13
- p.update_attribute(:category_id, p.shop_category_id)
14
- end
15
- remove_column :shop_products, :shop_category_id
16
- remove_index :shop_products, :shop_category_id
17
-
18
- # ProductAttachment - Product
19
- add_column :shop_product_attachments, :product_id, :integer
20
- add_index :shop_product_attachments, :product_id
21
- ShopProductAttachment.all.each do |a|
22
- a.update_attribute(:product_id, a.shop_product_id)
23
- end
24
- remove_column :shop_product_attachments, :shop_product_id
25
- remove_index :shop_product_attachments, :shop_product_id
26
-
27
- # LineItem - Order
28
- add_column :shop_line_items, :order_id, :integer
29
- add_index :shop_line_items, :order_id
30
- ShopLineItem.all.each do |i|
31
- i.update_attribute(:order_id, i.shop_order_id)
32
- end
33
- remove_column :shop_line_items, :shop_order_id
34
- remove_index :shop_line_items, :shop_order_id
35
-
36
- # Order - Customer
37
- add_column :shop_orders, :customer_id, :integer
38
- add_index :shop_orders, :customer_id
39
- ShopOrder.all.each do |o|
40
- o.update_attribute(:customer_id, o.shop_customer_id)
41
- end
42
- remove_column :shop_orders, :shop_customer_id
43
- remove_index :shop_orders, :shop_customer_id
44
-
45
- # Payment - Order
46
- add_column :shop_payments, :order_id, :integer
47
- add_index :shop_payments, :order_id
48
- ShopPayment.all.each do |p|
49
- p.update_attribute(:order_id, p.shop_order_id)
50
- end
51
- remove_column :shop_payments, :shop_order_id
52
- remove_index :shop_payments, :shop_order_id
53
- end
54
-
55
- def self.down
56
- # Product - Category
57
- add_column :shop_products, :shop_category_id, :integer
58
- add_index :shop_products, :shop_category_id
59
- ShopProduct.all.each do |p|
60
- p.update_attribute(:shop_category_id, p.category_id)
61
- end
62
- remove_column :shop_products, :category_id
63
- remove_index :shop_products, :category_id
64
-
65
- # ProductAttachment - Product
66
- add_column :shop_product_attachments, :shop_product_id, :integer
67
- add_index :shop_product_attachments, :shop_product_id
68
- ShopProductAttachment.all.each do |a|
69
- a.update_attribute(:shop_product_id, a.product_id)
70
- end
71
- remove_column :shop_product_attachments, :product_id
72
- remove_index :shop_product_attachments, :product_id
73
-
74
- # LineItem - Order
75
- add_column :shop_line_items, :shop_order_id, :integer
76
- add_index :shop_line_items, :shop_order_id
77
- ShopLineItem.all.each do |i|
78
- i.update_attribute(:shop_order_id, i.order_id)
79
- end
80
- remove_column :shop_line_items, :order_id
81
- remove_index :shop_line_items, :order_id
82
-
83
- # Order - Customer
84
- add_column :shop_orders, :shop_customer_id, :integer
85
- add_index :shop_orders, :shop_customer_id
86
- ShopOrder.all.each do |o|
87
- o.update_attribute(:shop_customer_id, o.customer_id)
88
- end
89
- remove_column :shop_orders, :customer_id
90
- remove_index :shop_orders, :customer_id
91
-
92
- # Payment - Order
93
- add_column :shop_payments, :shop_order_id, :integer
94
- add_index :shop_payments, :shop_order_id
95
- ShopPayment.all.each do |p|
96
- p.update_attribute(:shop_order_id, p.order_id)
97
- end
98
- remove_column :shop_payments, :order_id
99
- remove_index :shop_payments, :order_id
100
- end
101
- end
@@ -1,25 +0,0 @@
1
- class DropShopAddressables < ActiveRecord::Migration
2
- def self.up
3
- drop_table :shop_addressables
4
- drop_table :shop_address_billings
5
- drop_table :shop_address_shippings
6
- end
7
-
8
- def self.down
9
- create_table :shop_addressables do |t|
10
- t.references :address, :polymorphic => true
11
- t.references :addresser, :polymorphic => true
12
- end
13
- add_index :shop_addressables, :address_id
14
- add_index :shop_addressables, :addresser_id
15
-
16
- create_table :shop_address_billings do |t|
17
- t.references :shop_address
18
- end
19
- add_index :shop_address_billings, :shop_address_id
20
-
21
- create_table :shop_address_shippings do |t|
22
- t.references :shop_address
23
- end
24
- end
25
- end
@@ -1,19 +0,0 @@
1
- class CreateShopGroups < ActiveRecord::Migration
2
- def self.up
3
- create_table :shop_groups do |t|
4
- t.string :name
5
- end
6
-
7
- create_table :shop_groupings do |t|
8
- t.integer :product_id
9
- t.string :group_id
10
- end
11
- add_index :shop_groupings, :product_id
12
- add_index :shop_groupings, :group_id
13
- end
14
-
15
- def self.down
16
- remove_table :shop_groups
17
- remove_table :shop_groupings
18
- end
19
- end
@@ -1,11 +0,0 @@
1
- class ShopGroupsChangeAddDescription < ActiveRecord::Migration
2
- def self.up
3
- add_column :shop_groups, :description, :text
4
- add_column :pages, :shop_group_id, :integer
5
- end
6
-
7
- def self.down
8
- remove_column :shop_groups, :description
9
- remove_column :pages, :shop_group_id
10
- end
11
- end
@@ -1,20 +0,0 @@
1
- class CreateVariants < ActiveRecord::Migration
2
- def self.up
3
- create_table :shop_variants do |t|
4
- t.string :name
5
- t.text :options_json
6
- end
7
-
8
- create_table :shop_product_variants do |t|
9
- t.string :name
10
- t.decimal :price
11
-
12
- t.integer :product_id
13
- end
14
- end
15
-
16
- def self.down
17
- remove_table :shop_variants
18
- remove_table :shop_product_variants
19
- end
20
- end
@@ -1,25 +0,0 @@
1
- class ChangeVariantsAddUpdatedBy < ActiveRecord::Migration
2
- def self.up
3
- add_column :shop_variants, :created_by_id, :integer
4
- add_column :shop_variants, :updated_by_id, :integer
5
- add_column :shop_variants, :created_at, :datetime
6
- add_column :shop_variants, :updated_at, :datetime
7
-
8
- add_column :shop_groups, :created_by_id, :integer
9
- add_column :shop_groups, :updated_by_id, :integer
10
- add_column :shop_groups, :created_at, :datetime
11
- add_column :shop_groups, :updated_at, :datetime
12
- end
13
-
14
- def self.down
15
- remove_column :shop_variants, :created_by_id
16
- remove_column :shop_variants, :created_by_id
17
- remove_column :shop_variants, :created_at
18
- remove_column :shop_variants, :updated_at
19
-
20
- remove_column :shop_groups, :created_by_id
21
- remove_column :shop_groups, :created_by_id
22
- remove_column :shop_groups, :created_at
23
- remove_column :shop_groups, :updated_at
24
- end
25
- end