mechanize_store 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +8 -8
  2. data/README.rdoc +3 -11
  3. data/app/controllers/mechanize_store/orders_controller.rb +2 -2
  4. data/app/models/mechanize_store/order.rb +24 -3
  5. data/app/models/mechanize_store/payment.rb +67 -4
  6. data/app/models/mechanize_store/payment_type.rb +2 -0
  7. data/app/views/mechanize_store/orders/index.html.erb +4 -4
  8. data/config/locales/mechanize_store.pt-BR.yml +28 -8
  9. data/db/migrate/20140602124615_rename_columns.rb +7 -0
  10. data/lib/mechanize_store/version.rb +1 -1
  11. data/spec/controllers/mechanize_store/orders_controller_spec.rb +2 -4
  12. data/spec/dummy/db/development.sqlite3 +0 -0
  13. data/spec/dummy/db/schema.rb +7 -25
  14. data/spec/dummy/db/test.sqlite3 +0 -0
  15. data/spec/dummy/log/development.log +124 -0
  16. data/spec/dummy/log/test.log +4733 -0
  17. data/spec/dummy/public/photos/1/medium.png +0 -0
  18. data/spec/dummy/public/photos/1/thumb.png +0 -0
  19. data/spec/factories/{store_flags.rb → mechanize_store_flags.rb} +0 -0
  20. data/spec/factories/{store_payments.rb → mechanize_store_payments.rb} +0 -0
  21. data/spec/factories/{store_product_categories.rb → mechanize_store_product_categories.rb} +0 -0
  22. data/spec/factories/{store_product_photos.rb → mechanize_store_product_photos.rb} +0 -0
  23. data/spec/factories/{store_stores.rb → mechanize_store_stores.rb} +0 -0
  24. data/spec/models/{store → mechanize_store}/flag_spec.rb +0 -0
  25. data/spec/models/{store → mechanize_store}/freight_spec.rb +0 -0
  26. data/spec/models/{store → mechanize_store}/order_spec.rb +0 -0
  27. data/spec/models/{store → mechanize_store}/payment_spec.rb +0 -0
  28. data/spec/models/{store → mechanize_store}/product_category_spec.rb +0 -0
  29. data/spec/models/{store → mechanize_store}/product_photo_spec.rb +0 -0
  30. data/spec/models/{store → mechanize_store}/product_spec.rb +0 -0
  31. data/spec/models/{store → mechanize_store}/store_spec.rb +0 -0
  32. metadata +29 -103
  33. data/app/controllers/mechanize_store/order_statuses_controller.rb +0 -77
  34. data/app/controllers/mechanize_store/payment_statuses_controller.rb +0 -77
  35. data/app/controllers/mechanize_store/payment_types_controller.rb +0 -77
  36. data/app/models/mechanize_store/order_status.rb +0 -10
  37. data/app/models/mechanize_store/payment_status.rb +0 -20
  38. data/app/views/mechanize_store/order_statuses/_form.html.erb +0 -11
  39. data/app/views/mechanize_store/order_statuses/edit.html.erb +0 -12
  40. data/app/views/mechanize_store/order_statuses/index.html.erb +0 -46
  41. data/app/views/mechanize_store/order_statuses/new.html.erb +0 -9
  42. data/app/views/mechanize_store/order_statuses/show.html.erb +0 -15
  43. data/app/views/mechanize_store/payment_statuses/_form.html.erb +0 -11
  44. data/app/views/mechanize_store/payment_statuses/edit.html.erb +0 -12
  45. data/app/views/mechanize_store/payment_statuses/index.html.erb +0 -46
  46. data/app/views/mechanize_store/payment_statuses/new.html.erb +0 -9
  47. data/app/views/mechanize_store/payment_statuses/show.html.erb +0 -15
  48. data/app/views/mechanize_store/payment_types/_form.html.erb +0 -11
  49. data/app/views/mechanize_store/payment_types/edit.html.erb +0 -12
  50. data/app/views/mechanize_store/payment_types/index.html.erb +0 -46
  51. data/app/views/mechanize_store/payment_types/new.html.erb +0 -9
  52. data/app/views/mechanize_store/payment_types/show.html.erb +0 -15
  53. data/db/migrate/20140401203246_create_mechanize_store_order_statuses.rb +0 -9
  54. data/db/migrate/20140402140318_create_mechanize_store_payment_statuses.rb +0 -9
  55. data/db/migrate/20140402140325_create_mechanize_store_payment_types.rb +0 -9
  56. data/spec/controllers/mechanize_store/order_statuses_controller_spec.rb +0 -138
  57. data/spec/controllers/mechanize_store/payment_statuses_controller_spec.rb +0 -139
  58. data/spec/controllers/mechanize_store/payment_types_controller_spec.rb +0 -139
  59. data/spec/dummy/db/migrate/20140508135827_create_mechanize_store_freights.mechanize_store.rb +0 -13
  60. data/spec/dummy/db/migrate/20140508135828_create_mechanize_store_order_statuses.mechanize_store.rb +0 -10
  61. data/spec/dummy/db/migrate/20140508135829_create_mechanize_store_payment_statuses.mechanize_store.rb +0 -10
  62. data/spec/dummy/db/migrate/20140508135830_create_mechanize_store_payment_types.mechanize_store.rb +0 -10
  63. data/spec/dummy/db/migrate/20140508135831_create_mechanize_store_payments.mechanize_store.rb +0 -16
  64. data/spec/dummy/db/migrate/20140508135832_create_mechanize_store_flags.mechanize_store.rb +0 -10
  65. data/spec/dummy/db/migrate/20140508135833_create_mechanize_store_products.mechanize_store.rb +0 -17
  66. data/spec/dummy/db/migrate/20140508135834_create_mechanize_store_product_photos.mechanize_store.rb +0 -11
  67. data/spec/dummy/db/migrate/20140508135835_create_mechanize_store_orders.mechanize_store.rb +0 -12
  68. data/spec/dummy/db/migrate/20140508135836_create_mechanize_store_product_categories.mechanize_store.rb +0 -11
  69. data/spec/dummy/db/migrate/20140508135837_add_width_to_mechanize_store_product.mechanize_store.rb +0 -7
  70. data/spec/dummy/db/migrate/20140508135838_create_mechanize_store_order_items.mechanize_store.rb +0 -13
  71. data/spec/dummy/db/migrate/20140508135839_add_payment_type_id_to_payment.mechanize_store.rb +0 -7
  72. data/spec/dummy/db/migrate/20140508135840_add_time_to_freight.mechanize_store.rb +0 -6
  73. data/spec/factories/mechanize_store_payment_types.rb +0 -7
  74. data/spec/factories/store_order_statuses.rb +0 -7
  75. data/spec/factories/store_payment_statuses.rb +0 -7
  76. data/spec/models/store/order_status_spec.rb +0 -7
  77. data/spec/models/store/payment_status_spec.rb +0 -7
  78. data/spec/models/store/payment_type_spec.rb +0 -7
  79. data/spec/routing/store/order_statuses_routing_spec.rb +0 -39
  80. data/spec/routing/store/payment_statuses_routing_spec.rb +0 -38
  81. data/spec/routing/store/payment_types_routing_spec.rb +0 -38
Binary file
Binary file
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mechanize_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilbert Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-30 00:00:00.000000000 Z
11
+ date: 2014-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -263,10 +263,7 @@ files:
263
263
  - app/assets/stylesheets/mechanize_store/sb-admin/sb-admin.css
264
264
  - app/controllers/mechanize_store/application_controller.rb
265
265
  - app/controllers/mechanize_store/flags_controller.rb
266
- - app/controllers/mechanize_store/order_statuses_controller.rb
267
266
  - app/controllers/mechanize_store/orders_controller.rb
268
- - app/controllers/mechanize_store/payment_statuses_controller.rb
269
- - app/controllers/mechanize_store/payment_types_controller.rb
270
267
  - app/controllers/mechanize_store/product_categories_controller.rb
271
268
  - app/controllers/mechanize_store/product_photos_controller.rb
272
269
  - app/controllers/mechanize_store/products_controller.rb
@@ -275,9 +272,7 @@ files:
275
272
  - app/models/mechanize_store/freight.rb
276
273
  - app/models/mechanize_store/order.rb
277
274
  - app/models/mechanize_store/order_item.rb
278
- - app/models/mechanize_store/order_status.rb
279
275
  - app/models/mechanize_store/payment.rb
280
- - app/models/mechanize_store/payment_status.rb
281
276
  - app/models/mechanize_store/payment_type.rb
282
277
  - app/models/mechanize_store/product.rb
283
278
  - app/models/mechanize_store/product_category.rb
@@ -287,23 +282,8 @@ files:
287
282
  - app/views/mechanize_store/flags/index.html.erb
288
283
  - app/views/mechanize_store/flags/new.html.erb
289
284
  - app/views/mechanize_store/flags/show.html.erb
290
- - app/views/mechanize_store/order_statuses/_form.html.erb
291
- - app/views/mechanize_store/order_statuses/edit.html.erb
292
- - app/views/mechanize_store/order_statuses/index.html.erb
293
- - app/views/mechanize_store/order_statuses/new.html.erb
294
- - app/views/mechanize_store/order_statuses/show.html.erb
295
285
  - app/views/mechanize_store/orders/index.html.erb
296
286
  - app/views/mechanize_store/orders/show.html.erb
297
- - app/views/mechanize_store/payment_statuses/_form.html.erb
298
- - app/views/mechanize_store/payment_statuses/edit.html.erb
299
- - app/views/mechanize_store/payment_statuses/index.html.erb
300
- - app/views/mechanize_store/payment_statuses/new.html.erb
301
- - app/views/mechanize_store/payment_statuses/show.html.erb
302
- - app/views/mechanize_store/payment_types/_form.html.erb
303
- - app/views/mechanize_store/payment_types/edit.html.erb
304
- - app/views/mechanize_store/payment_types/index.html.erb
305
- - app/views/mechanize_store/payment_types/new.html.erb
306
- - app/views/mechanize_store/payment_types/show.html.erb
307
287
  - app/views/mechanize_store/product_categories/_form.html.erb
308
288
  - app/views/mechanize_store/product_categories/edit.html.erb
309
289
  - app/views/mechanize_store/product_categories/index.html.erb
@@ -320,9 +300,6 @@ files:
320
300
  - config/locales/mechanize_store.pt-BR.yml
321
301
  - config/routes.rb
322
302
  - db/migrate/20140401203200_create_mechanize_store_freights.rb
323
- - db/migrate/20140401203246_create_mechanize_store_order_statuses.rb
324
- - db/migrate/20140402140318_create_mechanize_store_payment_statuses.rb
325
- - db/migrate/20140402140325_create_mechanize_store_payment_types.rb
326
303
  - db/migrate/20140402140539_create_mechanize_store_payments.rb
327
304
  - db/migrate/20140402140549_create_mechanize_store_flags.rb
328
305
  - db/migrate/20140402140832_create_mechanize_store_products.rb
@@ -333,6 +310,7 @@ files:
333
310
  - db/migrate/20140409191426_create_mechanize_store_order_items.rb
334
311
  - db/migrate/20140416123100_add_payment_type_id_to_payment.rb
335
312
  - db/migrate/20140417200520_add_time_to_freight.rb
313
+ - db/migrate/20140602124615_rename_columns.rb
336
314
  - lib/mechanize_store.rb
337
315
  - lib/mechanize_store/engine.rb
338
316
  - lib/mechanize_store/version.rb
@@ -344,10 +322,7 @@ files:
344
322
  - lib/templates/erb/scaffold/show.html.erb
345
323
  - lib/templates/rails/scaffold_controller/controller.rb
346
324
  - spec/controllers/mechanize_store/flags_controller_spec.rb
347
- - spec/controllers/mechanize_store/order_statuses_controller_spec.rb
348
325
  - spec/controllers/mechanize_store/orders_controller_spec.rb
349
- - spec/controllers/mechanize_store/payment_statuses_controller_spec.rb
350
- - spec/controllers/mechanize_store/payment_types_controller_spec.rb
351
326
  - spec/controllers/mechanize_store/product_categories_controller_spec.rb
352
327
  - spec/controllers/mechanize_store/product_photos_controller_spec.rb
353
328
  - spec/controllers/mechanize_store/products_controller_spec.rb
@@ -381,20 +356,6 @@ files:
381
356
  - spec/dummy/config/locales/pt-BR.yml
382
357
  - spec/dummy/config/routes.rb
383
358
  - spec/dummy/db/development.sqlite3
384
- - spec/dummy/db/migrate/20140508135827_create_mechanize_store_freights.mechanize_store.rb
385
- - spec/dummy/db/migrate/20140508135828_create_mechanize_store_order_statuses.mechanize_store.rb
386
- - spec/dummy/db/migrate/20140508135829_create_mechanize_store_payment_statuses.mechanize_store.rb
387
- - spec/dummy/db/migrate/20140508135830_create_mechanize_store_payment_types.mechanize_store.rb
388
- - spec/dummy/db/migrate/20140508135831_create_mechanize_store_payments.mechanize_store.rb
389
- - spec/dummy/db/migrate/20140508135832_create_mechanize_store_flags.mechanize_store.rb
390
- - spec/dummy/db/migrate/20140508135833_create_mechanize_store_products.mechanize_store.rb
391
- - spec/dummy/db/migrate/20140508135834_create_mechanize_store_product_photos.mechanize_store.rb
392
- - spec/dummy/db/migrate/20140508135835_create_mechanize_store_orders.mechanize_store.rb
393
- - spec/dummy/db/migrate/20140508135836_create_mechanize_store_product_categories.mechanize_store.rb
394
- - spec/dummy/db/migrate/20140508135837_add_width_to_mechanize_store_product.mechanize_store.rb
395
- - spec/dummy/db/migrate/20140508135838_create_mechanize_store_order_items.mechanize_store.rb
396
- - spec/dummy/db/migrate/20140508135839_add_payment_type_id_to_payment.mechanize_store.rb
397
- - spec/dummy/db/migrate/20140508135840_add_time_to_freight.mechanize_store.rb
398
359
  - spec/dummy/db/schema.rb
399
360
  - spec/dummy/db/test.sqlite3
400
361
  - spec/dummy/log/development.log
@@ -565,38 +526,29 @@ files:
565
526
  - spec/dummy/tmp/cache/assets/development/sprockets/faeec0db256cfb91ad104e66a9453bd9
566
527
  - spec/dummy/tmp/cache/assets/development/sprockets/fbbf6a435d522871a2d29d97e370bfce
567
528
  - spec/dummy/tmp/cache/assets/development/sprockets/ffbf6316da17c85bd6bda4bdb1961baf
529
+ - spec/factories/mechanize_store_flags.rb
568
530
  - spec/factories/mechanize_store_freights.rb
569
531
  - spec/factories/mechanize_store_order_items.rb
570
532
  - spec/factories/mechanize_store_orders.rb
571
- - spec/factories/mechanize_store_payment_types.rb
533
+ - spec/factories/mechanize_store_payments.rb
534
+ - spec/factories/mechanize_store_product_categories.rb
535
+ - spec/factories/mechanize_store_product_photos.rb
572
536
  - spec/factories/mechanize_store_products.rb
573
- - spec/factories/store_flags.rb
574
- - spec/factories/store_order_statuses.rb
575
- - spec/factories/store_payment_statuses.rb
576
- - spec/factories/store_payments.rb
577
- - spec/factories/store_product_categories.rb
578
- - spec/factories/store_product_photos.rb
579
- - spec/factories/store_stores.rb
537
+ - spec/factories/mechanize_store_stores.rb
580
538
  - spec/features/orders_flow_spec.rb
581
539
  - spec/features/products_flow_test.rb
582
540
  - spec/fixtures/rails.png
541
+ - spec/models/mechanize_store/flag_spec.rb
542
+ - spec/models/mechanize_store/freight_spec.rb
583
543
  - spec/models/mechanize_store/order_item_spec.rb
584
- - spec/models/store/flag_spec.rb
585
- - spec/models/store/freight_spec.rb
586
- - spec/models/store/order_spec.rb
587
- - spec/models/store/order_status_spec.rb
588
- - spec/models/store/payment_spec.rb
589
- - spec/models/store/payment_status_spec.rb
590
- - spec/models/store/payment_type_spec.rb
591
- - spec/models/store/product_category_spec.rb
592
- - spec/models/store/product_photo_spec.rb
593
- - spec/models/store/product_spec.rb
594
- - spec/models/store/store_spec.rb
544
+ - spec/models/mechanize_store/order_spec.rb
545
+ - spec/models/mechanize_store/payment_spec.rb
546
+ - spec/models/mechanize_store/product_category_spec.rb
547
+ - spec/models/mechanize_store/product_photo_spec.rb
548
+ - spec/models/mechanize_store/product_spec.rb
549
+ - spec/models/mechanize_store/store_spec.rb
595
550
  - spec/routing/store/flags_routing_spec.rb
596
- - spec/routing/store/order_statuses_routing_spec.rb
597
551
  - spec/routing/store/orders_routing_spec.rb
598
- - spec/routing/store/payment_statuses_routing_spec.rb
599
- - spec/routing/store/payment_types_routing_spec.rb
600
552
  - spec/routing/store/product_categories_routing_spec.rb
601
553
  - spec/routing/store/products_photos_routing_spec.rb
602
554
  - spec/routing/store/products_routing_spec.rb
@@ -628,10 +580,7 @@ summary: Mechanize store is a couple of models that allows you create a simple p
628
580
  store with rails.
629
581
  test_files:
630
582
  - spec/controllers/mechanize_store/flags_controller_spec.rb
631
- - spec/controllers/mechanize_store/order_statuses_controller_spec.rb
632
583
  - spec/controllers/mechanize_store/orders_controller_spec.rb
633
- - spec/controllers/mechanize_store/payment_statuses_controller_spec.rb
634
- - spec/controllers/mechanize_store/payment_types_controller_spec.rb
635
584
  - spec/controllers/mechanize_store/product_categories_controller_spec.rb
636
585
  - spec/controllers/mechanize_store/product_photos_controller_spec.rb
637
586
  - spec/controllers/mechanize_store/products_controller_spec.rb
@@ -663,20 +612,6 @@ test_files:
663
612
  - spec/dummy/config/routes.rb
664
613
  - spec/dummy/config.ru
665
614
  - spec/dummy/db/development.sqlite3
666
- - spec/dummy/db/migrate/20140508135827_create_mechanize_store_freights.mechanize_store.rb
667
- - spec/dummy/db/migrate/20140508135828_create_mechanize_store_order_statuses.mechanize_store.rb
668
- - spec/dummy/db/migrate/20140508135829_create_mechanize_store_payment_statuses.mechanize_store.rb
669
- - spec/dummy/db/migrate/20140508135830_create_mechanize_store_payment_types.mechanize_store.rb
670
- - spec/dummy/db/migrate/20140508135831_create_mechanize_store_payments.mechanize_store.rb
671
- - spec/dummy/db/migrate/20140508135832_create_mechanize_store_flags.mechanize_store.rb
672
- - spec/dummy/db/migrate/20140508135833_create_mechanize_store_products.mechanize_store.rb
673
- - spec/dummy/db/migrate/20140508135834_create_mechanize_store_product_photos.mechanize_store.rb
674
- - spec/dummy/db/migrate/20140508135835_create_mechanize_store_orders.mechanize_store.rb
675
- - spec/dummy/db/migrate/20140508135836_create_mechanize_store_product_categories.mechanize_store.rb
676
- - spec/dummy/db/migrate/20140508135837_add_width_to_mechanize_store_product.mechanize_store.rb
677
- - spec/dummy/db/migrate/20140508135838_create_mechanize_store_order_items.mechanize_store.rb
678
- - spec/dummy/db/migrate/20140508135839_add_payment_type_id_to_payment.mechanize_store.rb
679
- - spec/dummy/db/migrate/20140508135840_add_time_to_freight.mechanize_store.rb
680
615
  - spec/dummy/db/schema.rb
681
616
  - spec/dummy/db/test.sqlite3
682
617
  - spec/dummy/log/development.log
@@ -849,38 +784,29 @@ test_files:
849
784
  - spec/dummy/tmp/cache/assets/development/sprockets/faeec0db256cfb91ad104e66a9453bd9
850
785
  - spec/dummy/tmp/cache/assets/development/sprockets/fbbf6a435d522871a2d29d97e370bfce
851
786
  - spec/dummy/tmp/cache/assets/development/sprockets/ffbf6316da17c85bd6bda4bdb1961baf
787
+ - spec/factories/mechanize_store_flags.rb
852
788
  - spec/factories/mechanize_store_freights.rb
853
789
  - spec/factories/mechanize_store_order_items.rb
854
790
  - spec/factories/mechanize_store_orders.rb
855
- - spec/factories/mechanize_store_payment_types.rb
791
+ - spec/factories/mechanize_store_payments.rb
792
+ - spec/factories/mechanize_store_product_categories.rb
793
+ - spec/factories/mechanize_store_product_photos.rb
856
794
  - spec/factories/mechanize_store_products.rb
857
- - spec/factories/store_flags.rb
858
- - spec/factories/store_order_statuses.rb
859
- - spec/factories/store_payment_statuses.rb
860
- - spec/factories/store_payments.rb
861
- - spec/factories/store_product_categories.rb
862
- - spec/factories/store_product_photos.rb
863
- - spec/factories/store_stores.rb
795
+ - spec/factories/mechanize_store_stores.rb
864
796
  - spec/features/orders_flow_spec.rb
865
797
  - spec/features/products_flow_test.rb
866
798
  - spec/fixtures/rails.png
799
+ - spec/models/mechanize_store/flag_spec.rb
800
+ - spec/models/mechanize_store/freight_spec.rb
867
801
  - spec/models/mechanize_store/order_item_spec.rb
868
- - spec/models/store/flag_spec.rb
869
- - spec/models/store/freight_spec.rb
870
- - spec/models/store/order_spec.rb
871
- - spec/models/store/order_status_spec.rb
872
- - spec/models/store/payment_spec.rb
873
- - spec/models/store/payment_status_spec.rb
874
- - spec/models/store/payment_type_spec.rb
875
- - spec/models/store/product_category_spec.rb
876
- - spec/models/store/product_photo_spec.rb
877
- - spec/models/store/product_spec.rb
878
- - spec/models/store/store_spec.rb
802
+ - spec/models/mechanize_store/order_spec.rb
803
+ - spec/models/mechanize_store/payment_spec.rb
804
+ - spec/models/mechanize_store/product_category_spec.rb
805
+ - spec/models/mechanize_store/product_photo_spec.rb
806
+ - spec/models/mechanize_store/product_spec.rb
807
+ - spec/models/mechanize_store/store_spec.rb
879
808
  - spec/routing/store/flags_routing_spec.rb
880
- - spec/routing/store/order_statuses_routing_spec.rb
881
809
  - spec/routing/store/orders_routing_spec.rb
882
- - spec/routing/store/payment_statuses_routing_spec.rb
883
- - spec/routing/store/payment_types_routing_spec.rb
884
810
  - spec/routing/store/product_categories_routing_spec.rb
885
811
  - spec/routing/store/products_photos_routing_spec.rb
886
812
  - spec/routing/store/products_routing_spec.rb
@@ -1,77 +0,0 @@
1
- module MechanizeStore
2
- class OrderStatusesController < ApplicationController
3
- before_action :set_order_status, only: [:show, :edit, :update, :destroy]
4
-
5
- respond_to :html, :json, :xml
6
-
7
- def index
8
- @search = OrderStatus.search(params[:q])
9
-
10
- @order_statuses = @search.result.paginate(page: params[:page])
11
-
12
- respond_with @order_statuses
13
- end
14
-
15
- def show
16
- respond_with @order_status
17
- end
18
-
19
- def new
20
- @order_status = OrderStatus.new
21
- respond_with @order_status
22
- end
23
-
24
- def edit
25
- respond_with @order_status
26
- end
27
-
28
- def create
29
- @order_status = OrderStatus.new(order_status_params)
30
-
31
- respond_with @order_status do |format|
32
- if @order_status.save
33
- format.html do
34
- flash[:notice] = I18n.t(:created, model: I18n.t(:order_status, scope: "activerecord.models"))
35
- redirect_to @order_status
36
- end
37
- else
38
- format.html { render action: "new" }
39
- end
40
- end
41
- end
42
-
43
- def update
44
- @order_status = OrderStatus.find(params[:id])
45
-
46
- respond_with @order_status do |format|
47
- if @order_status.update(order_status_params)
48
- format.html do
49
- flash[:notice] = I18n.t(:updated, model: I18n.t(:order_status, scope: "activerecord.models"))
50
- redirect_to @order_status
51
- end
52
- else
53
- format.html { render action: "edit" }
54
- end
55
- end
56
- end
57
-
58
- def destroy
59
- @order_status = OrderStatus.find(params[:id])
60
-
61
- flash[:alert] = I18n.t(:deleted, model: I18n.t(:order_status, scope: "activerecord.models")) if @order_status.destroy
62
-
63
- respond_with @order_status, :location => order_statuses_url
64
- end
65
-
66
- private
67
- # Use callbacks to share common setup or constraints between actions.
68
- def set_order_status
69
- @order_status = OrderStatus.find(params[:id])
70
- end
71
-
72
- # Only allow a trusted parameter "white list" through.
73
- def order_status_params
74
- params.require(:order_status).permit(:name)
75
- end
76
- end
77
- end
@@ -1,77 +0,0 @@
1
- module MechanizeStore
2
- class PaymentStatusesController < ApplicationController
3
- before_action :set_payment_status, only: [:show, :edit, :update, :destroy]
4
-
5
- respond_to :html, :json, :xml
6
-
7
- def index
8
- @search = PaymentStatus.search(params[:q])
9
-
10
- @payment_statuses = @search.result.paginate(page: params[:page])
11
-
12
- respond_with @payment_statuses
13
- end
14
-
15
- def show
16
- respond_with @payment_status
17
- end
18
-
19
- def new
20
- @payment_status = PaymentStatus.new
21
- respond_with @payment_status
22
- end
23
-
24
- def edit
25
- respond_with @payment_status
26
- end
27
-
28
- def create
29
- @payment_status = PaymentStatus.new(payment_status_params)
30
-
31
- respond_with @payment_status do |format|
32
- if @payment_status.save
33
- format.html do
34
- flash[:notice] = I18n.t(:created, model: I18n.t(:payment_status, scope: "activerecord.models"))
35
- redirect_to @payment_status
36
- end
37
- else
38
- format.html { render action: "new" }
39
- end
40
- end
41
- end
42
-
43
- def update
44
- @payment_status = PaymentStatus.find(params[:id])
45
-
46
- respond_with @payment_status do |format|
47
- if @payment_status.update(payment_status_params)
48
- format.html do
49
- flash[:notice] = I18n.t(:updated, model: I18n.t(:payment_status, scope: "activerecord.models"))
50
- redirect_to @payment_status
51
- end
52
- else
53
- format.html { render action: "edit" }
54
- end
55
- end
56
- end
57
-
58
- def destroy
59
- @payment_status = PaymentStatus.find(params[:id])
60
-
61
- flash[:alert] = I18n.t(:deleted, model: I18n.t(:payment_status, scope: "activerecord.models")) if @payment_status.destroy
62
-
63
- respond_with @payment_status, :location => payment_statuses_url
64
- end
65
-
66
- private
67
- # Use callbacks to share common setup or constraints between actions.
68
- def set_payment_status
69
- @payment_status = PaymentStatus.find(params[:id])
70
- end
71
-
72
- # Only allow a trusted parameter "white list" through.
73
- def payment_status_params
74
- params.require(:payment_status).permit(:name)
75
- end
76
- end
77
- end
@@ -1,77 +0,0 @@
1
- module MechanizeStore
2
- class PaymentTypesController < ApplicationController
3
- before_action :set_payment_type, only: [:show, :edit, :update, :destroy]
4
-
5
- respond_to :html, :json, :xml
6
-
7
- def index
8
- @search = PaymentType.search(params[:q])
9
-
10
- @payment_types = @search.result.paginate(page: params[:page])
11
-
12
- respond_with @payment_types
13
- end
14
-
15
- def show
16
- respond_with @payment_type
17
- end
18
-
19
- def new
20
- @payment_type = PaymentType.new
21
- respond_with @payment_type
22
- end
23
-
24
- def edit
25
- respond_with @payment_type
26
- end
27
-
28
- def create
29
- @payment_type = PaymentType.new(payment_type_params)
30
-
31
- respond_with @payment_type do |format|
32
- if @payment_type.save
33
- format.html do
34
- flash[:notice] = I18n.t(:created, model: I18n.t(:payment_type, scope: "activerecord.models"))
35
- redirect_to @payment_type
36
- end
37
- else
38
- format.html { render action: "new" }
39
- end
40
- end
41
- end
42
-
43
- def update
44
- @payment_type = PaymentType.find(params[:id])
45
-
46
- respond_with @payment_type do |format|
47
- if @payment_type.update(payment_type_params)
48
- format.html do
49
- flash[:notice] = I18n.t(:updated, model: I18n.t(:payment_type, scope: "activerecord.models"))
50
- redirect_to @payment_type
51
- end
52
- else
53
- format.html { render action: "edit" }
54
- end
55
- end
56
- end
57
-
58
- def destroy
59
- @payment_type = PaymentType.find(params[:id])
60
-
61
- flash[:alert] = I18n.t(:deleted, model: I18n.t(:payment_type, scope: "activerecord.models")) if @payment_type.destroy
62
-
63
- respond_with @payment_type, :location => payment_types_url
64
- end
65
-
66
- private
67
- # Use callbacks to share common setup or constraints between actions.
68
- def set_payment_type
69
- @payment_type = PaymentType.find(params[:id])
70
- end
71
-
72
- # Only allow a trusted parameter "white list" through.
73
- def payment_type_params
74
- params.require(:payment_type).permit(:name)
75
- end
76
- end
77
- end