Skip to content

Instantly share code, notes, and snippets.

@juque
Created July 5, 2021 10:29
Show Gist options
  • Save juque/69e6cb85e5cb49afa9bddab4cabdaf1c to your computer and use it in GitHub Desktop.
Save juque/69e6cb85e5cb49afa9bddab4cabdaf1c to your computer and use it in GitHub Desktop.
class DashboardController < ApplicationController
before_action :login_required
def index
@orders = if current_shop.has?(:orders)
current_shop.orders(sort: 'updated_on.desc')
else
[]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment