Update customer.rb

This commit is contained in:
2016-05-17 11:31:01 -04:00
parent dfbf5ab1af
commit 76778ece82

View File

@@ -25,10 +25,10 @@ class Customer < ActiveRecord::Base
self.primary_key = :id self.primary_key = :id
def all def all
Customer.skip_callback(:initialize, :after, :pull) without_callback(:initialize, :after, :pull) do
customers = Customer.all @@customers = Customer.all
Customer.set_callback(:initialize, :after, :pull) end
return customers return @@customers
end end
# returns a human readable string # returns a human readable string
@@ -125,9 +125,9 @@ class Customer < ActiveRecord::Base
end end
def self.without_callback(*args, &block) def self.without_callback(*args, &block)
skip_callback(*args) Customer.skip_callback(*args)
yield yield
set_callback(*args) Customer.set_callback(*args)
end end
private private