lib/ecm/cms/database_template.rb in ecm_cms-0.0.5.pre vs lib/ecm/cms/database_template.rb in ecm_cms-0.0.6.pre

- old
+ new

@@ -14,11 +14,13 @@ base.after_initialize :set_defaults base.before_validation :assert_trailing_slash_on_pathname base.after_save :clear_resolver_cache # validations + # base.validates :basename, :presence => true, + # :uniqueness => { :scope => [:ecm_cms_folder_id , :locale] } base.validates :basename, :presence => true, - :uniqueness => { :scope => [:ecm_cms_folder_id , :locale] } + :uniqueness => { :scope => [ :pathname, :locale, :format, :handler ] } base.validates :handler, :inclusion => ActionView::Template::Handlers.extensions.map(&:to_s) base.validates :locale, :inclusion => I18n.available_locales.map(&:to_s), :allow_nil => true, :allow_blank => true base.validates :format, :inclusion => Mime::SET.symbols.map(&:to_s),