diff --git a/Gemfile b/Gemfile index 4ee1c84b..1792d212 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,8 @@ gem 'slim-rails' #gem 'active_model_serializers', github: 'rails-api/active_model_serializers' # explicitly outside assets #gem 'active_model_serializers', '0.9.3' # explicitly outside assets #gem 'jsonapi-serializers', github: 'bterkuile/jsonapi-serializers' -gem 'jsonapi-serializers', path: '/home/benjamin/development/rails/components/jsonapi-serializers' +#gem 'jsonapi-serializers', path: '/home/benjamin/development/rails/components/jsonapi-serializers' +gem 'jsonapi-serializers', github: 'bterkuile/jsonapi-serializers' group :assets do gem 'jquery-rails' gem 'jquery-ui-rails' @@ -37,7 +38,8 @@ group :assets do gem 'uglifier', '>= 1.0.3' #gem 'ember-rails' - gem 'ember-rails', path: '/home/benjamin/development/rails/components/ember-rails' + #gem 'ember-rails', path: '/home/benjamin/development/rails/components/ember-rails' + gem 'ember-rails', github: 'bterkuile/ember-rails' #gem 'ember-source', '~> 1.13.9' #gem 'emblem-rails' @@ -80,7 +82,7 @@ gem 'mini_magick' gem 'active_attr' gem 'naught' gem 'cancancan' -gem 'sucker_punch' +gem 'sucker_punch' # Really needed? #gem 'geokit' gem 'iso_country_codes' diff --git a/Gemfile.lock b/Gemfile.lock index 6dad5bee..3b452a34 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,16 +30,8 @@ GIT sprockets (>= 3.3, < 3.4) GIT - remote: git://github.com/bterkuile/simply_stored.git - revision: 323c11efe7f86b3e156acfa7e53d8f06d8fb73c4 - specs: - simply_stored (1.0.0) - activesupport - couch_potato (>= 0.2.15) - rest-client (>= 1.4.2) - -PATH - remote: /home/benjamin/development/rails/components/ember-rails + remote: git://github.com/bterkuile/ember-rails.git + revision: fd2008b3aed644892e5529267410a5875460405a specs: ember-rails (0.19.2) active-model-adapter-source (>= 1.13.0) @@ -49,12 +41,22 @@ PATH jquery-rails (>= 1.0.17) railties (>= 3.1) -PATH - remote: /home/benjamin/development/rails/components/jsonapi-serializers +GIT + remote: git://github.com/bterkuile/jsonapi-serializers.git + revision: 55516761bec40a4f492003dffd3e18d575075b07 specs: jsonapi-serializers (0.2.6) activesupport +GIT + remote: git://github.com/bterkuile/simply_stored.git + revision: 323c11efe7f86b3e156acfa7e53d8f06d8fb73c4 + specs: + simply_stored (1.0.0) + activesupport + couch_potato (>= 0.2.15) + rest-client (>= 1.4.2) + GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ @@ -193,7 +195,7 @@ GEM eventmachine (>= 1.0.0.beta.4) email_validator (1.6.0) activemodel - ember-data-source (2.0.0) + ember-data-source (2.0.1) ember-source (>= 1.8, < 3.0) ember-handlebars-template (0.4.1) barber (>= 0.9.0) diff --git a/app/controllers/users/suppliers_controller.rb b/app/controllers/users/suppliers_controller.rb new file mode 100644 index 00000000..47cd8261 --- /dev/null +++ b/app/controllers/users/suppliers_controller.rb @@ -0,0 +1,14 @@ +module Users + class SuppliersController < Users::ApplicationController + + def show + @supplier = Supplier.find(params[:id]) + render json: {}, status: :not_found and return unless @supplier.present? + render json: @supplier, include: %w[ + product_categories + product_categories.products + product_categories.products.product_variants + ] + end + end +end diff --git a/config/routes.rb b/config/routes.rb index c7f421df..a320c85e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,7 @@ Qwaiter::Application.routes.draw do get '/close_window' => 'dashboard#close_window' namespace :users, path: '/user/api/v1' do resources :product_categories, only: [:index] + resources :suppliers, only: [:show] resources :lists, only: [:index, :show] do collection do get :current