def self.find_applications(params)
composed_cond = Caboose::EZ::Condition.new
cond_three_letter_code = Caboose::EZ::Condition.new :programs do
three_letter_code === params[:find_only_program_codes]
end
cond_status = Caboose::EZ::Condition.new :study_abroad_applications do
status === params[:find_only_statuses].
to_s.downcase.gsub(" ", "").gsub(",", ";").split(";")
end
cond_terms = Caboose::EZ::Condition.new :deadlines do
term_year === params[:find_only_terms].
to_s.downcase.gsub(" ", "").gsub(",", ";").split(";")
end
composed_cond << cond_three_letter_code
composed_cond << cond_terms
composed_cond << cond_status
@applications = StudyAbroadApplication.find(:all,
:include=>[{:deadline => :program}, :user],
:conditions => composed_cond.to_sql, :order => "deadlines.id")
unless @applications == 0
puts "Size: #{@applications.size}"
else
flash[:notice] = "There was an error retrieving your application records"
redirect_to :action => "index"
end
end
With me being a noob to RoR I completely forgot about my background in procedure based programing and thought nothing of the last statement. Hell if it puts out the size of the array thats what I wanted right? Well that was what I got, but what I didn't get was the @applications array that I wanted to display in my view. So there you have it just make sure that the last thing in your method is what you want to return. Learn from my mistakes and save your self some tail chasing. :)
-CH