Refactor zonefile_setting's origin list

#186
This commit is contained in:
Artur Beljajev 2016-10-28 00:29:47 +03:00
parent 469312d7ee
commit 39d7c6ad1d
4 changed files with 24 additions and 3 deletions

View file

@ -3,7 +3,7 @@ class Admin::ZonefilesController < ApplicationController
# TODO: Refactor this
def create
if ZonefileSetting.pluck(:origin).include?(params[:origin])
if ZonefileSetting.origins.include?(params[:origin])
@zonefile = ActiveRecord::Base.connection.execute(
"select generate_zonefile('#{params[:origin]}')"