ishapi 0.1.8.70 → 0.1.8.71

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60a5d993e107b12d47480b884b7a77031e35a8c8
4
- data.tar.gz: 82650adbc7f1cc677edcad7c86073e811ba62700
3
+ metadata.gz: 01d5fc9c9e7dccfb684663a63aafd4f5ed480ee6
4
+ data.tar.gz: a7e1c8137d2f8b9c37a9b998b3d5cde7f39b9991
5
5
  SHA512:
6
- metadata.gz: c80d17b2fccfcc9037009bf85d9c84f9f9be5723d661e176df0a352f3b1b08b98a46bafd37161fe36d34301c50b44070bd4d45ba79200f8543c0cdf2ef4dbb07
7
- data.tar.gz: 539fb1597817625b4644653b78caeb8c438196e7bb6ccd2b375b1e282ff2f574d0fcc5ef1b2a0b18ae4adf7a93979194fbc95073c434a0cc1b0cbbee9754371b
6
+ metadata.gz: 3b9548c04328722de2e84e4bc996d605b02d8030f50373053af41e6ec2c4eb2b1c1e5cd6a8b297148210c89b06239c874b9078c77b39527425fe2fc937c5444e
7
+ data.tar.gz: 8602eb97d7a37c86b6d945fac6ff6641b1411e98f706a7317d44a12302097bb7f9bfb2a6af3061b4baf7e2fe7df45404149d21fe783743c7a92d2692ead587b7
@@ -11,11 +11,11 @@ module Ishapi
11
11
  @order_item.measurement = @measurement
12
12
  @order_item.cost = case params[:order_item][:kind]
13
13
  when CoTailors::OrderItem::KIND_SHIRT
14
- CoTailors::Shirt.cost
14
+ CoTailors::Product.where( :kind => 'shirt' ).first.cost
15
15
  when CoTailors::OrderItem::KIND_PANTS
16
- CoTaiilors::Pant.cost
16
+ CoTailors::Product.where( :kind => 'pants' ).first.cost
17
17
  when CoTailors::OrderItem::KIND_SUIT
18
- CoTailors::Suit.cost
18
+ CoTailors::Product.where( :kind => 'suit' ).first.cost
19
19
  end
20
20
  @order_item.measurement = CoTailors::ProfileMeasurement.create params['order_item'].permit( CoTailors::Order::MEASUREMENT_PARAMS )
21
21
 
@@ -0,0 +1,12 @@
1
+ require_dependency "ishapi/application_controller"
2
+ module Ishapi
3
+ class ProductsController < ApplicationController
4
+
5
+ def show
6
+ @product = ::CoTailors::Product.where( :kind => params[:kind] ).first
7
+ authorize! :show, @product
8
+ end
9
+
10
+ end
11
+ end
12
+
@@ -33,6 +33,7 @@ class Ishapi::Ability
33
33
  can [ :update ], ::CoTailors::Address
34
34
  can [ :add ], ::CoTailors::OrderItem
35
35
  can [ :create, :update_measurements ], ::CoTailors::Order
36
+ can [ :show ], ::CoTailors::Product
36
37
 
37
38
  can [ :index, :show ], Event
38
39
 
@@ -0,0 +1,9 @@
1
+
2
+ params.permit!
3
+ json.cache! [ params, @product ] do
4
+ json.cost @product.cost
5
+ json.title @product.title
6
+ json.description @product.description
7
+ json.kind @product.kind
8
+ end
9
+
@@ -8,9 +8,10 @@ Ishapi::Engine.routes.draw do
8
8
  get 'cities/view/:cityname', :to => 'cities#show'
9
9
  get 'cities/features', :to => 'cities#features'
10
10
 
11
- post 'co_tailors/orders', :to => 'orders#create'
12
- post 'co_tailors/order_items', :to => 'order_items#create'
13
- post 'co_tailors/measurements', :to => 'measurements#update'
11
+ post 'co_tailors/orders', :to => 'orders#create'
12
+ post 'co_tailors/order_items', :to => 'order_items#create'
13
+ post 'co_tailors/measurements', :to => 'measurements#update'
14
+ get 'co_tailors/products/by-kind/:kind', :to => 'products#show'
14
15
  namespace :co_tailors do
15
16
  end
16
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.70
4
+ version: 0.1.8.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -201,6 +201,7 @@ files:
201
201
  - app/controllers/ishapi/order_items_controller.rb
202
202
  - app/controllers/ishapi/orders_controller.rb
203
203
  - app/controllers/ishapi/payments_controller.rb
204
+ - app/controllers/ishapi/products_controller.rb
204
205
  - app/controllers/ishapi/reports_controller.rb
205
206
  - app/controllers/ishapi/reports_controller.rb~
206
207
  - app/controllers/ishapi/sites_controller.rb
@@ -256,6 +257,7 @@ files:
256
257
  - app/views/ishapi/photos/_index.jbuilder~
257
258
  - app/views/ishapi/photos/_show.jbuilder
258
259
  - app/views/ishapi/photos/_show.jbuilder~
260
+ - app/views/ishapi/products/show.jbuilder
259
261
  - app/views/ishapi/reports/_index.jbuilder
260
262
  - app/views/ishapi/reports/_index.jbuilder~
261
263
  - app/views/ishapi/reports/index.jbuilder