From e8ef430733b43290e0fe85d6972d7daa8581e67f Mon Sep 17 00:00:00 2001 From: Will Bradley Date: Sun, 2 Mar 2014 19:39:04 -0700 Subject: [PATCH] Working around temporary lack of last names in users --- app/models/contract.rb | 2 +- app/views/contracts/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/contract.rb b/app/models/contract.rb index 3e5b357..52a4c21 100644 --- a/app/models/contract.rb +++ b/app/models/contract.rb @@ -2,7 +2,7 @@ class Contract < ActiveRecord::Base belongs_to :user attr_accessible :user_id, :first_name, :last_name, :signed_at, :document, :document_file_name, :document_content_type, :document_file_size, :document_updated_at - validates_presence_of :first_name, :last_name, :signed_at + validates_presence_of :first_name, :signed_at #, :last_name has_attached_file :document, { :styles => { :medium => "300x300>"}, :storage => :s3, diff --git a/app/views/contracts/index.html.erb b/app/views/contracts/index.html.erb index f0a99f1..133df86 100644 --- a/app/views/contracts/index.html.erb +++ b/app/views/contracts/index.html.erb @@ -12,7 +12,7 @@ - <% @contracts.sort_by{|r| [r.last_name] }.each do |contract| %> + <% @contracts.sort_by{|r| (r.last_name) || "" }.each do |contract| %> <%= contract.last_name %>,