Created
May 13, 2017 19:06
-
-
Save kopylovvlad/3703a5587a5732ed9b54fafd34585068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| subscribers.each do |row| | |
| subscriber_row = SubscriberRow.new(row) | |
| user = User.find_by_or_create_by_subscribe(subscriber_row.user_hash) | |
| subscriptions = Subscription.find(subscriber_row.subsc_ids) | |
| if subscriber_row.subscribe? | |
| user.subscribe(subscriptions) | |
| user.send_greeting_email(subscriptions) | |
| end | |
| if subscriber_row.unsubscribe? | |
| user.unsubscribe(subscriptions) | |
| user.send_unsubscribe_email(subscriptions) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment