Created
August 16, 2012 12:31
-
-
Save jmoren/3369826 to your computer and use it in GitHub Desktop.
has many condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has_many :tz_qcall_lists, :conditions => ["qcall_contacts_count > 0"], :dependent => :destroy | |
#qcalls_controller.rb | |
format.fxml { render :fxml => @qcall.to_fxml( | |
:only => [ | |
:id,:name,:desc,:user_group_id, | |
:callerid_name,:callerid_phone,:msgset_abandon, | |
:duration_abandon,:total_calls,:abandon_calls, | |
:stats_call,:vmd,:poverride,:max_retry, | |
:start_calltime,:end_calltime,:wait_for,:ring_for | |
], | |
:include => {:qcall_contact_lists => {:only => [:id, :name], :include => { | |
:tz_qcall_lists => { | |
## :conditions => ['qcall_contacts_count > 0 '], => esto no anda | |
:only => [:qcall_contact_list_id, :id, :timezone, :active, :weight], | |
:methods => [:total_contacts, :connected_contacts, :left_to_call, :ratio, :calls_made] | |
} | |
}}}, | |
:except => [:created_at,:updated_at], | |
:methods=> [ | |
:total_contacts,:connected_contacts, | |
:calls_made,:stats_q,:stats_lead, | |
:stats_scheduled,:stats_dead, | |
:stats_graveyard,:stats_call, | |
:contacts_maxed,:contacts_tried, | |
:contacts_timeout,:stats_all | |
] | |
)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tambien probe tener:
has_many :tz_qcall_lists, :dependent => :destroy
has_many :tz_qcall_lists_with_contacts, :conditions => ['qcall_contacts_count > 0']
Esto me funciono, pero hay que toquetear mucho en flex