Skip to content

Instantly share code, notes, and snippets.

View stacey-impossible's full-sized avatar

Simona stacey-impossible

View GitHub Profile
@stacey-impossible
stacey-impossible / update_dates.rb
Last active December 6, 2018 23:15
Update users' access dates for 2winglobal store
STORE_ID = 4004
DATE_CREATED = DateTime.new(2018, 12, 03).to_date
DATE_PERFORM = DateTime.new(2019, 12, 04).to_date
EMAIL_PATTERN = '%@adobe.com'
users = Store.find(STORE_ID).users.where('email ILIKE ? AND created_at::date = ?', EMAIL_PATTERN, DATE_CREATED)
users.each do |u|
o = u.ownerships.where(product_id: 18345, product_type: 'Offer').or(u.ownerships.where(product_type: 'Content', product_id: 47956)).where.not(perform_action_at: nil).order(created_at: :desc).first
o.update(perform_action_at: DATE_PERFORM) if o.present?
end
@stacey-impossible
stacey-impossible / rails http status codes
Created December 2, 2017 18:14 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing