You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/models/relative_memo_to_open_sourc...

15 lines
501 B

class RelativeMemoToOpenSourceProject < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :open_source_project, :foreign_key => "osp_id"
belongs_to :topic, :class_name => 'RelativeMemo', :foreign_key => 'relative_memo_id'
has_many :no_uses, :as => :no_use, :dependent => :delete_all
validates_presence_of :osp_id, :relative_memo_id
scope :no_use_for, lambda { |user_id|
{:include => :no_uses,
:conditions => ["#{NoUse.table_name}.user_id = ?", user_id] }
}
end