2019-10-25 20:31:19 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DiscoursePatrons
|
|
|
|
class Customer < ActiveRecord::Base
|
2019-10-25 22:01:49 -04:00
|
|
|
scope :find_user, ->(user) { find_by_user_id(user.id) }
|
|
|
|
|
|
|
|
class << self
|
|
|
|
table_name = "discourse_patrons_customers"
|
|
|
|
|
|
|
|
def create_customer(user, customer)
|
|
|
|
create(customer_id: customer[:id], user_id: user.id)
|
|
|
|
end
|
|
|
|
end
|
2019-10-25 20:31:19 -04:00
|
|
|
end
|
|
|
|
end
|