diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/sip_accounts_controller.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index 32d1210..cd34953 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -9,10 +9,17 @@ class SipAccountsController < ApplicationController helper_method :sort_column, :sort_descending def index - @sip_accounts = @parent.sip_accounts.order(sort_column + ' ' + (sort_descending ? 'DESC' : 'ASC')).paginate( - :page => params[:page], - :per_page => GsParameter.get('DEFAULT_PAGINATION_ENTRIES_PER_PAGE') - ) + if @parent.class == Tenant + @sip_accounts = @parent.tenant_user_sip_accounts.order(sort_column + ' ' + (sort_descending ? 'DESC' : 'ASC')).paginate( + :page => params[:page], + :per_page => GsParameter.get('DEFAULT_PAGINATION_ENTRIES_PER_PAGE') + ) + else + @sip_accounts = @parent.sip_accounts.order(sort_column + ' ' + (sort_descending ? 'DESC' : 'ASC')).paginate( + :page => params[:page], + :per_page => GsParameter.get('DEFAULT_PAGINATION_ENTRIES_PER_PAGE') + ) + end end def show |