Defect #4563

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

Added by yves dufour almost 8 years ago. Updated almost 8 years ago.

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

0%

Category:-
Target version:-
Resolution:Wont fix Affected version:

Description

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 ...

History

#1 Updated by Jean-Philippe Lang almost 8 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 almost 8 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