Place class methods above instance methods

This commit is contained in:
Maikel Linke
2023-06-15 10:17:35 +10:00
parent 298ae8ffc3
commit 22a6861f6f

View File

@@ -45,10 +45,6 @@ class Customer < ApplicationRecord
attr_accessor :gateway_recurring_payment_client_secret, :gateway_shop_id
def full_name
"#{first_name} #{last_name}".strip
end
def self.find_or_new(email, enterprise_id)
Customer.new(email: email, enterprise_id: enterprise_id) unless email.present? && enterprise_id.present?
@@ -56,6 +52,10 @@ class Customer < ApplicationRecord
Customer.new(email: email, enterprise_id: enterprise_id)
end
def full_name
"#{first_name} #{last_name}".strip
end
def set_created_manually_flag
self.created_manually = true
return unless persisted?