From f16201f6cddc1ea8b07219feda238f2a05986547 Mon Sep 17 00:00:00 2001 From: did Date: Thu, 7 Apr 2011 02:18:07 +0200 Subject: [PATCH] do not run bushido subdomain validation if the value does not get changed + prevent to change the subdomain in Heroku (non multi-sites mode) --- app/views/admin/current_sites/_form.html.haml | 2 +- lib/locomotive/hosting/bushido/custom_domain.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/current_sites/_form.html.haml b/app/views/admin/current_sites/_form.html.haml index 0b70161c..58d4e5e9 100644 --- a/app/views/admin/current_sites/_form.html.haml +++ b/app/views/admin/current_sites/_form.html.haml @@ -15,7 +15,7 @@ = f.custom_input :subdomain, :css => 'path' do %em http:// - = f.text_field :subdomain + = f.text_field :subdomain, :disabled => (manage_subdomain? ? '' : 'disabled') \. %em = application_domain diff --git a/lib/locomotive/hosting/bushido/custom_domain.rb b/lib/locomotive/hosting/bushido/custom_domain.rb index c55edfd2..dfa3508d 100644 --- a/lib/locomotive/hosting/bushido/custom_domain.rb +++ b/lib/locomotive/hosting/bushido/custom_domain.rb @@ -22,7 +22,7 @@ module Locomotive protected def subdomain_availability - return true if self.new_record? + return true if self.new_record? || !self.subdomain_changed? unless ::Bushido::App.subdomain_available?(self.subdomain) self.errors.add(:subdomain, :exclusion)