Skip to content

Instantly share code, notes, and snippets.

View Luiyit's full-sized avatar
🏠
Working from home

Luiyit Hernandez Luiyit

🏠
Working from home
View GitHub Profile
@Luiyit
Luiyit / remove_pass_customer_products.rb
Last active April 2, 2021 21:12
Remove pass customer and products
# TODO: include sessions
def remove_customer_pass(client_user_id, pass_customer_id, delete_pass_customer = false, expire_pass_customer = false)
user_client = User.find(client_user_id)
if user_client
pass_customer_classes = []
customer_collection = nil
pass_customer = PassCustomer.find(pass_customer_id)
pass_applies_to = pass_customer.pass.pass_products.pluck(:applies_to)
talent = pass_customer.pass.user.talent
def create_backend_admin(admin_email, admin_pass)
admin_exist = Admin.find_by(email: admin_email)
if not admin_exist
admin = Admin.create({
email: admin_email,
password: admin_pass,
password_confirmation: admin_pass,
})
pp admin
# https://talent-hack.atlassian.net/browse/TAL-908
client_email = 'brittanebates@gmail.com'
talent_email = 'hello@emimoves.com'
pass_title = 'Monthly Unlimited Virtual Classes - Reoccurring'
# References involved
client_user = User.find_by(email: client_email)
talent_user = User.find_by(email: talent_email)
pass = Pass.find_by(user_id: talent_user.id, title: pass_title)