Refactor Devise integration

- Use scoped users
- Use the named route helpers instead of hardcoded paths
This commit is contained in:
Artur Beljajev 2018-06-20 12:21:22 +03:00
parent c31f507c25
commit 9684c8e59f
52 changed files with 313 additions and 280 deletions

View file

@ -6,7 +6,7 @@ class Registrar
def index
params[:q] ||= {}
invoices = current_user.registrar.invoices.includes(:invoice_items, :account_activity)
invoices = current_registrar_user.registrar.invoices.includes(:invoice_items, :account_activity)
normalize_search_parameters do
@q = invoices.search(params[:q])