app/models/disco_app/concerns/user.rb in disco_app-0.16.1 vs app/models/disco_app/concerns/user.rb in disco_app-0.17.0
- old
+ new
@@ -1,20 +1,21 @@
module DiscoApp::Concerns::User
+
extend ActiveSupport::Concern
included do
belongs_to :shop
def self.create_user(shopify_user, shop)
- user = self.find_or_create_by!(id: shopify_user.id, shop: shop)
+ user = find_or_create_by!(id: shopify_user.id, shop: shop)
user.update(
first_name: shopify_user.first_name || '',
last_name: shopify_user.last_name || '',
email: shopify_user.email
)
user
rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
retry
end
-
end
+
end