mechanize_store 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +8 -8
  2. data/app/controllers/mechanize_store/orders_controller.rb +1 -0
  3. data/app/models/mechanize_store/freight.rb +2 -0
  4. data/app/models/mechanize_store/payment.rb +2 -0
  5. data/config/locales/mechanize_store.pt-BR.yml +3 -0
  6. data/lib/mechanize_store/version.rb +1 -1
  7. data/spec/controllers/mechanize_store/orders_controller_spec.rb +5 -2
  8. data/spec/dummy/db/migrate/{20140407144119_create_mechanize_store_freights.mechanize_store.rb → 20140424193635_create_mechanize_store_freights.mechanize_store.rb} +0 -0
  9. data/spec/dummy/db/migrate/{20140407144120_create_mechanize_store_order_statuses.mechanize_store.rb → 20140424193636_create_mechanize_store_order_statuses.mechanize_store.rb} +0 -0
  10. data/spec/dummy/db/migrate/{20140407144121_create_mechanize_store_payment_statuses.mechanize_store.rb → 20140424193637_create_mechanize_store_payment_statuses.mechanize_store.rb} +0 -0
  11. data/spec/dummy/db/migrate/{20140407144122_create_mechanize_store_payment_types.mechanize_store.rb → 20140424193638_create_mechanize_store_payment_types.mechanize_store.rb} +0 -0
  12. data/spec/dummy/db/migrate/{20140407144123_create_mechanize_store_payments.mechanize_store.rb → 20140424193639_create_mechanize_store_payments.mechanize_store.rb} +1 -2
  13. data/spec/dummy/db/migrate/{20140407144124_create_mechanize_store_flags.mechanize_store.rb → 20140424193640_create_mechanize_store_flags.mechanize_store.rb} +0 -0
  14. data/spec/dummy/db/migrate/{20140407144125_create_mechanize_store_products.mechanize_store.rb → 20140424193641_create_mechanize_store_products.mechanize_store.rb} +0 -0
  15. data/spec/dummy/db/migrate/{20140407144126_create_mechanize_store_product_photos.mechanize_store.rb → 20140424193642_create_mechanize_store_product_photos.mechanize_store.rb} +0 -0
  16. data/spec/dummy/db/migrate/{20140407144127_create_mechanize_store_orders.mechanize_store.rb → 20140424193643_create_mechanize_store_orders.mechanize_store.rb} +0 -0
  17. data/spec/dummy/db/migrate/{20140407144128_create_mechanize_store_product_categories.mechanize_store.rb → 20140424193644_create_mechanize_store_product_categories.mechanize_store.rb} +0 -0
  18. data/spec/dummy/db/migrate/{20140407193949_add_width_to_mechanize_store_product.mechanize_store.rb → 20140424193645_add_width_to_mechanize_store_product.mechanize_store.rb} +0 -0
  19. data/spec/dummy/db/migrate/{20140409191457_create_mechanize_store_order_items.mechanize_store.rb → 20140424193646_create_mechanize_store_order_items.mechanize_store.rb} +0 -0
  20. data/spec/dummy/db/migrate/20140424193647_add_payment_type_id_to_payment.mechanize_store.rb +7 -0
  21. data/spec/dummy/db/migrate/20140424193648_add_time_to_freight.mechanize_store.rb +6 -0
  22. data/spec/dummy/db/schema.rb +5 -3
  23. data/spec/dummy/db/test.sqlite3 +0 -0
  24. data/spec/dummy/log/test.log +5234 -0
  25. data/spec/dummy/public/photos/1/medium.png +0 -0
  26. data/spec/dummy/public/photos/1/original.png +0 -0
  27. data/spec/dummy/public/photos/1/thumb.png +0 -0
  28. data/spec/factories/{store_orders.rb → mechanize_store_orders.rb} +1 -2
  29. data/spec/factories/{store_payment_types.rb → mechanize_store_payment_types.rb} +1 -1
  30. data/spec/factories/store_freights.rb +1 -2
  31. data/spec/factories/store_order_statuses.rb +1 -1
  32. data/spec/factories/store_payments.rb +0 -2
  33. metadata +40 -30
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjEzYzRiNjFiMzY5N2QzN2EzNGNlMDZmZmJiYTRiOTMyNjM1NTliNg==
4
+ ODczNDdiMmIwZGU3MTAyNGIwODNkZmE3MjI3NDgwMjQ1ZjEyOWQ5MA==
5
5
  data.tar.gz: !binary |-
6
- YjM5MmNhNmFhMjMwNmI2M2NkYTMwYmU3YjdhZTI2MTM3NTljYzlkMA==
6
+ YjNlYzc5MDhlZDc5ZGRkYmY0OTY2MDRmMDFiMWVmM2E3MDhiOTA5Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDcyYjdmYzNhODk5YjliYjIxY2MxMTZiNjgzOGNlZmY3MmJjODNlYWQzMjJh
10
- MDc1MTQwNmUwYWFiYWQyYWY5OTYzYjdiYjA4NWUwYWZiZDNkMjQwM2M5OWM1
11
- OWMyZGIzZTljNmZmNjYwYzlhYjJjNGU3Y2NkZjhjNTdkODhkYzY=
9
+ YjgxODE4ZmE5M2FmZDdlM2IxMzZhZjRlMmQ0MjhmZGM1MDE0NWNiZGU5NTVj
10
+ YWY0YjJkMzBjMGI1MzJlNzRiOWM4OWM4NjQyOThlMjg0MDIxODIxY2E4ZmE1
11
+ YjczOTZmM2ZlNjQ5MDU5NjY2YWQ4MjI3NjEwOTBlNTFjYjAxNmU=
12
12
  data.tar.gz: !binary |-
13
- ZDJhOTEzY2RlZTc2ZjRjMGJkMWJkMmQ4OWUyNTAxODk3ZDAzMWZiZjdmODk4
14
- NmQ2NjMxOWZjMWY5ODE4YmUyZjEyNjdjYjg5OTM3ZGM5N2Y5ZGJhYmMzYmNh
15
- OWVhNzQxMmMwZDk3MWRhZmM3NTU5N2YxZjhmNDk3MTJkMDQzMjE=
13
+ YmU3MzBhNWM4YzUxYzc5YWEzOGZjMzBmNTI2ZjAxZTg1NTM1NzVkMzRlODQy
14
+ OWI3ZmM5NjM1NTQwNTBjMTk3YTk5NTFlMGEwN2QzYTlkNTM0ZTNkNzFmZjBi
15
+ ZjZmZGM5YzhjZGVhYmU3NjY5OTJhYzA3YzBiYjJhOTVkMmRiMjE=
@@ -15,6 +15,7 @@ module MechanizeStore
15
15
  params[:q] ||= {}
16
16
 
17
17
  @search = Order.search(params[:q])
18
+
18
19
  @orders = @search.result.paginate(page: params[:page])
19
20
 
20
21
  respond_with @orders
@@ -1,5 +1,7 @@
1
1
  module MechanizeStore
2
2
  class Freight < ActiveRecord::Base
3
3
  belongs_to :order
4
+
5
+ validates :service, :value, :zipcode, :delivery_time, presence: true
4
6
  end
5
7
  end
@@ -4,5 +4,7 @@ module MechanizeStore
4
4
  belongs_to :payment_status
5
5
  belongs_to :payment_type
6
6
  belongs_to :flag
7
+
8
+ validates_presence_of :payment_type_id
7
9
  end
8
10
  end
@@ -35,6 +35,7 @@ pt-BR:
35
35
  mechanize_store/order_status:
36
36
  name: Nome
37
37
  mechanize_store/payment:
38
+ payment_type_id: "Tipo de pagamento"
38
39
  payment_status_id: "Status do pagamento"
39
40
  mechanize_store/payment_status:
40
41
  name: "Nome"
@@ -59,7 +60,9 @@ pt-BR:
59
60
  flag: "Bandeira"
60
61
  order: "Compra"
61
62
  order_status: "Status de compra"
63
+ payment: "Pagamento"
62
64
  payment_status: "Status de pagamento"
65
+ payment/payment_type: "Tipo de pagamento"
63
66
  payment_type: "Tipo de pagamento"
64
67
  product: "Produtos"
65
68
  product_category: "Categoria de produto"
@@ -1,3 +1,3 @@
1
1
  module MechanizeStore
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -5,8 +5,10 @@ module MechanizeStore
5
5
  routes { MechanizeStore::Engine.routes }
6
6
 
7
7
  before do
8
- @payment = FactoryGirl.create(:mechanize_store_payment)
9
- @order = FactoryGirl.create(:mechanize_store_order, payment: @payment)
8
+ @payment_type = FactoryGirl.create(:mechanize_store_payment_type)
9
+ @payment = FactoryGirl.create(:mechanize_store_payment, payment_type: @payment_type)
10
+ @order_status = FactoryGirl.create(:mechanize_store_order_status)
11
+ @order = FactoryGirl.create(:mechanize_store_order, payment: @payment, order_status: @order_status)
10
12
  end
11
13
 
12
14
  let(:valid_session) { {} }
@@ -14,6 +16,7 @@ module MechanizeStore
14
16
  describe "GET index" do
15
17
  it "assigns all order_statuses as @order_statuses" do
16
18
  get :index, {}, valid_session
19
+
17
20
  assigns(:orders).should eq([@order])
18
21
  end
19
22
  end
@@ -2,8 +2,7 @@
2
2
  class CreateMechanizeStorePayments < ActiveRecord::Migration
3
3
  def change
4
4
  create_table :mechanize_store_payments do |t|
5
- t.integer :payable_id
6
- t.string :payable_type
5
+ t.integer :order_id, index: true
7
6
  t.references :payment_status, index: true
8
7
  t.float :value
9
8
  t.float :paid_value
@@ -0,0 +1,7 @@
1
+ # This migration comes from mechanize_store (originally 20140416123100)
2
+ class AddPaymentTypeIdToPayment < ActiveRecord::Migration
3
+ def change
4
+ add_column :mechanize_store_payments, :payment_type_id, :integer
5
+ add_index :mechanize_store_payments, :payment_type_id
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from mechanize_store (originally 20140417200520)
2
+ class AddTimeToFreight < ActiveRecord::Migration
3
+ def change
4
+ add_column :mechanize_store_freights, :delivery_time, :integer
5
+ end
6
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140409191457) do
14
+ ActiveRecord::Schema.define(version: 20140424193648) do
15
15
 
16
16
  create_table "mechanize_store_flags", force: true do |t|
17
17
  t.string "name"
@@ -26,6 +26,7 @@ ActiveRecord::Schema.define(version: 20140409191457) do
26
26
  t.string "zipcode"
27
27
  t.datetime "created_at"
28
28
  t.datetime "updated_at"
29
+ t.integer "delivery_time"
29
30
  end
30
31
 
31
32
  add_index "mechanize_store_freights", ["order_id"], name: "index_mechanize_store_freights_on_order_id"
@@ -72,8 +73,7 @@ ActiveRecord::Schema.define(version: 20140409191457) do
72
73
  end
73
74
 
74
75
  create_table "mechanize_store_payments", force: true do |t|
75
- t.integer "payable_id"
76
- t.string "payable_type"
76
+ t.integer "order_id"
77
77
  t.integer "payment_status_id"
78
78
  t.float "value"
79
79
  t.float "paid_value"
@@ -82,10 +82,12 @@ ActiveRecord::Schema.define(version: 20140409191457) do
82
82
  t.integer "flag_id"
83
83
  t.datetime "created_at"
84
84
  t.datetime "updated_at"
85
+ t.integer "payment_type_id"
85
86
  end
86
87
 
87
88
  add_index "mechanize_store_payments", ["flag_id"], name: "index_mechanize_store_payments_on_flag_id"
88
89
  add_index "mechanize_store_payments", ["payment_status_id"], name: "index_mechanize_store_payments_on_payment_status_id"
90
+ add_index "mechanize_store_payments", ["payment_type_id"], name: "index_mechanize_store_payments_on_payment_type_id"
89
91
 
90
92
  create_table "mechanize_store_product_categories", force: true do |t|
91
93
  t.string "name"
Binary file