Refactor for mobile deployment

This commit is contained in:
2014-08-19 12:44:15 +02:00
parent 268c5aabb9
commit 0e46633c73
27 changed files with 848 additions and 41 deletions
@@ -1,5 +1,6 @@
module Users
class ApplicationController < ::ApplicationController
before_action :allow_all_origins
before_action :user_authentication, :unless => ->(c){ %w(obtain_token).include?(c.action_name) || c.request.format.symbol == :html } # , except: [:obtain_token, :index]
private
+2 -2
View File
@@ -3,9 +3,9 @@ module Users
def index
#lists = current_user.lists.include_relation(:supplier, :table)
lists = List.for_user(current_user, page: params[:page], per_page: params[:per_page].presence || 25).include_relation(:supplier, :table)
lists = List.for_user(current_user, page: params[:page], per_page: params[:per_page].presence || 25)
#lists.include_relation(:supplier)
lists.include_relation(:users, :orders)
lists.include_relation(:users, :orders, :supplier, :table)
render json: lists, each_serializer: UserListSerializer, meta: {total_pages: lists.total_pages, page: lists.current_page} #, root: :lists
end