user upgrades: send dmail to purchaser for gifted upgrades.

* Refactor to move upgrade logic from UserPromotion to UserUpgrade.
* Send the recipient and the purchaser of a gifted upgrade separate
  dmail notifications.
This commit is contained in:
evazion
2020-12-24 20:32:20 -06:00
parent 74ed2a8b96
commit 058d71aa30
3 changed files with 46 additions and 21 deletions

View File

@@ -68,14 +68,14 @@ if User.count == 0
:password => "password1",
:password_confirmation => "password1"
)
newuser.promote_to!(User::Levels::BUILDER, :can_upload_free => true, :is_upgrade => true, :skip_dmail => true)
newuser.promote_to!(User::Levels::BUILDER, :can_upload_free => true, :skip_dmail => true)
newuser = User.create(
:name => "approver",
:password => "password1",
:password_confirmation => "password1"
)
newuser.promote_to!(User::Levels::BUILDER, :can_approve_posts => true, :is_upgrade => true, :skip_dmail => true)
newuser.promote_to!(User::Levels::BUILDER, :can_approve_posts => true, :skip_dmail => true)
end
0.upto(10) do |i|