2008年8月21日 星期四

scope_out, extend


[model : x_alerts.rb]
scope_out :active , :conditions => '(x_alerts.status = "new" Or x_alerts.status = "ebe") AND x_alerts.x_daily_alert_id = 0'
scope_out :history, :conditions => 'x_alerts.status = "ale"'

[model : alert_target.rb]
has_many :x_alert_relationships
has_many :x_alerts, :extend => XAlert::AssociationMethods, :through => :x_alert_relationships


沒有留言: