@@ -63,7 +63,9 class Project < ActiveRecord::Base | |||
|
63 | 63 | validates_length_of :identifier, :in => 1..20 |
|
64 | 64 | # donwcase letters, digits, dashes but not digits only |
|
65 | 65 | validates_format_of :identifier, :with => /^(?!\d+$)[a-z0-9\-]*$/, :if => Proc.new { |p| p.identifier_changed? } |
|
66 | ||
|
66 | # reserved words | |
|
67 | validates_exclusion_of :identifier, :in => %w( new ) | |
|
68 | ||
|
67 | 69 | before_destroy :delete_all_members |
|
68 | 70 | |
|
69 | 71 | named_scope :has_module, lambda { |mod| { :conditions => ["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s] } } |
General Comments 0
You need to be logged in to leave comments.
Login now