mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +02:00
Remove dead code
This commit is contained in:
parent
c86bd96588
commit
e8232258d8
3 changed files with 0 additions and 12 deletions
|
@ -3,10 +3,6 @@ module Admin
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
before_action :set_registrar, only: [:show, :edit, :update, :destroy]
|
before_action :set_registrar, only: [:show, :edit, :update, :destroy]
|
||||||
|
|
||||||
def search
|
|
||||||
render json: Registrar.search_by_query(params[:q])
|
|
||||||
end
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@q = Registrar.joins(:accounts).ordered.search(params[:q])
|
@q = Registrar.joins(:accounts).ordered.search(params[:q])
|
||||||
@registrars = @q.result.page(params[:page])
|
@registrars = @q.result.page(params[:page])
|
||||||
|
|
|
@ -44,11 +44,6 @@ class Registrar < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def search_by_query(query)
|
|
||||||
res = search(name_or_reg_no_cont: query).result
|
|
||||||
res.reduce([]) { |o, v| o << { id: v[:id], display_key: "#{v[:name]} (#{v[:reg_no]})" } }
|
|
||||||
end
|
|
||||||
|
|
||||||
def ordered
|
def ordered
|
||||||
order(name: :asc)
|
order(name: :asc)
|
||||||
end
|
end
|
||||||
|
|
|
@ -236,9 +236,6 @@ Rails.application.routes.draw do
|
||||||
resources :registrars do
|
resources :registrars do
|
||||||
resources :api_users
|
resources :api_users
|
||||||
resources :white_ips
|
resources :white_ips
|
||||||
collection do
|
|
||||||
get :search
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :registrants, controller: 'contacts'
|
resources :registrants, controller: 'contacts'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue