Defect #4563

sort method not accepted.... in app/views/projects/settings/_members.rhtml:3

Added by yves dufour over 12 years ago. Updated over 12 years ago.

Status:ClosedStart date:2010-01-13
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:Wont fix Affected version:


ActionView::TemplateError (undefined method `<=>' for nil:NilClass) on line #3 of app/views/project...

app/models/member.rb:53:in `<=>'
app/views/projects/settings/_members.rhtml:3:in `sort'

giving up of the 'sort' , runs without any problem...

<% members = @project.member_principals.find(:all, :include => [:roles, :principal]) %>

as I mixed up some records in my DB after an upgrade, is it an error coming from bad records in DB or from some requirements ...


#1 Updated by Jean-Philippe Lang over 12 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

This error is raised because you have a Member without a valid Roles or Principal association in the database. Fixing #<=> is not the solution, you have to fix your data.

#2 Updated by Jean-Philippe Lang over 12 years ago

You can use this to find your invalid entries in the members table:

Member.find(:all, :include => [:roles, :principal]).select {|m| m.roles.empty? || m.principal.nil?}

Also available in: Atom PDF