do not run bushido subdomain validation if the value does not get changed + prevent to change the subdomain in Heroku (non multi-sites mode)

This commit is contained in:
did 2011-04-07 02:18:07 +02:00
parent e03d7b5dcc
commit f16201f6cd
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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)