From 10ee52c22cade6755da40674511c40c2ba24f61f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 4 Apr 2019 16:48:04 +0800 Subject: [PATCH] 1 --- app/models/customer.rb | 1 + app/views/managements/_partner_customer_list.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index bbfe45c6..cfff4b21 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -1,4 +1,5 @@ class Customer < ActiveRecord::Base + default_scope :order => 'created_at desc' belongs_to :partner has_one :school has_many :users diff --git a/app/views/managements/_partner_customer_list.html.erb b/app/views/managements/_partner_customer_list.html.erb index 4720fc96..e8f643fd 100644 --- a/app/views/managements/_partner_customer_list.html.erb +++ b/app/views/managements/_partner_customer_list.html.erb @@ -5,9 +5,9 @@ data-remote="true" class="color-blue">+添加 添加时间 -<% @current_partner.try(:customers).try(:each) do |customer| %> +<% @current_partner.try(:customers).try(:each_with_index) do |customer, index| %>