Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. :start_date
  2. :end_date
  3. :number_of_collaborators
  4. :sector
  5.  
  6. :leader_id
  7. :maximum_no_of_collaborators
  8. :name
  9.  
  10. :name
  11. :contact_number
  12. :email
  13. :region
  14.  
  15. belongs_to :group
  16.  
  17. belongs_to :leader
  18. has_many :projects
  19.  
  20. has_many :groups
  21.  
  22. :available_from
  23. :available_until
  24. :number_of_collaborators
  25.  
  26. @projects = Project.where("start_date >= ? AND end_date >= ?",
  27. Date.parse(params[:available_from]).strftime("%Y-%m-%d"),
  28. Date.parse(params[:available_until]).strftime("%Y-%m-%d"))
  29.  
  30. <% @projects.each do |project| %>
  31. <% if ((project.group.capacity - project.number_of_collaborators) >0) %>
  32. ...code to display results...
  33. <% end %>
  34. <% end %>
  35.  
  36. @available_groups = []
  37. @leaders = []
  38.  
  39. @projects.each do |project|
  40. if ((project.group.capacity - params[:number_of_collaborators]) >0)
  41. @available_groups << project
  42. end
  43. end
  44.  
  45. @available_groups.each do |grou|
  46. @leaders << group.leader
  47. end
  48.  
  49. Array can't be coerced into Fixnum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement