project.rb.diff

Yuki Kita, 2010-04-05 14:26

Download (818 Bytes)

View differences:

app/models/project.rb (working copy)
74 74
  # reserved words
75 75
  validates_exclusion_of :identifier, :in => %w( new )
76 76

  
77
  before_destroy :delete_all_members, :destroy_children
77
  before_destroy :delete_all_members
78 78

  
79 79
  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] } }
80 80
  named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"}
......
496 496
      return nil
497 497
    end
498 498
  end
499

  
500
  # Override ActiveRecord::Base#destroy
501
  def destroy
502
    destroy_children
503
    super
504
  end
499 505
  
500 506
  private
501 507