Browse Source

refactor, clean

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
cb5fee0742
  1. 8
      app/controllers/records_controller.rb
  2. 2
      app/models/domain.rb
  3. 1
      app/models/tld.rb

8
app/controllers/records_controller.rb

@ -37,15 +37,11 @@ class RecordsController < ApplicationController
# TODO: externalize # TODO: externalize
def modify def modify
@record = Record.where(:authentication_token => params[:authentication_token]).first! @record = Record.where(:authentication_token => params[:authentication_token]).first!
if @record.type != 'A' return render(:text => MODIFY_ERROR) if @record.type != 'A'
return render :text => MODIFY_ERROR
end
@record.content = params[:ip] || client_remote_ip @record.content = params[:ip] || client_remote_ip
@record.save! @record.save!
respond_with(@record) do |format| respond_with(@record) do |format|
format.html { format.html {render(:text => MODIFY_OK)}
render :text => MODIFY_OK
}
end end
end end

2
app/models/domain.rb

@ -1,5 +1,3 @@
require 'resolv'
class Domain < ActiveRecord::Base class Domain < ActiveRecord::Base
set_inheritance_column "sti_disabled" set_inheritance_column "sti_disabled"
nilify_blanks nilify_blanks

1
app/models/tld.rb

@ -23,4 +23,3 @@ class Tld
end end
end end

Loading…
Cancel
Save