From c5296e7c5f2914e859e99aaa294d222f9b787e45 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Tue, 24 May 2016 12:04:33 -0400 Subject: [PATCH] Update customer.rb --- app/models/customer.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/customer.rb b/app/models/customer.rb index b1aa09c..a1ec2d6 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -20,8 +20,7 @@ class Customer < ActiveRecord::Base validates_presence_of :id, :name after_initialize :pull - alias_method :save_without_push, :save - alias_method :save, :save_with_push + self.primary_key = :id @@ -129,7 +128,7 @@ class Customer < ActiveRecord::Base end # Push the updates - def self.save_with_push + def save_with_push save_without_push begin #tries ||= 3 @@ -142,6 +141,9 @@ class Customer < ActiveRecord::Base end end + alias_method :save_without_push, :save + alias_method :save, :save_with_push + private # pull the details