Saturday, December 3, 2011

Re: [Rails] check hash content ?

On Sat, Dec 3, 2011 at 8:22 AM, Dani Dani <lists@ruby-forum.com> wrote:

> how can I make sure that 'customer_student' won't be pushed twice to the
> hash in the following example ?

What hash?

>    @potential_course_students = []
>    @selected_customers.each do |customer|
>      customer.customer_student.each do |customer_student|
>        if customer_student.display_name.include?(params[:term]) &&
>            ! @potential_course_students.include?(customer_student)

@potential_course_students is an empty array; how would it include
anything at that point?

>          @potential_course_attendees << customer_student

@potential_course_attendees isn't defined in your snippet -- ??

>        end
>      end
>    end unless params[:term].blank?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate