This commit is contained in:
Nicolas Bally 2019-07-22 17:50:21 +02:00
parent afd65d67af
commit e5d4400fc9
3 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ class Admin::IWebsitesController < ApplicationController
def index def index
@i_websites = IWebsite.order("p_customer_id ASC").all @i_websites = IWebsite.joins(:p_customer).order("p_customers.name ASC, p_customers.id ASC, i_websites.name ASC").all
end end

View File

@ -14,6 +14,10 @@ class PCustomer < ActiveRecord::Base
generate_mlm_token generate_mlm_token
end end
before_save do
self.name = self.show_name
end
def self.for_search(search) def self.for_search(search)
PCustomer.joins(:particular).where("code LIKE ? or particulars.organisation LIKE ? or particulars.name LIKE ? or particulars.firstname LIKE ?","%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%") PCustomer.joins(:particular).where("code LIKE ? or particulars.organisation LIKE ? or particulars.name LIKE ? or particulars.firstname LIKE ?","%#{search}%", "%#{search}%", "%#{search}%", "%#{search}%")
end end

View File

@ -1,2 +1,3 @@
%li= link_to "Sites", admin_i_websites_path %li= link_to "Projets", admin_i_websites_path
%li= link_to "Hébergements", admin_i_hebergements_path %li= link_to "Hébergements", admin_i_hebergements_path
%li= link_to "To do", admin_i_tasks_path