Defect #5219 » project.rb.diff
| app/models/project.rb (working copy) | ||
|---|---|---|
|
# reserved words
|
||
|
validates_exclusion_of :identifier, :in => %w( new )
|
||
|
before_destroy :delete_all_members, :destroy_children
|
||
|
before_destroy :delete_all_members
|
||
|
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] } }
|
||
|
named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"}
|
||
| ... | ... | |
|
return nil
|
||
|
end
|
||
|
end
|
||
|
# Override ActiveRecord::Base#destroy
|
||
|
def destroy
|
||
|
destroy_children
|
||
|
super
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
- « Previous
- 1
- 2
- Next »