Skip to content

Commit 9e70757

Browse files
committed
Remove payer_is_team_admin
1 parent 2c8ba62 commit 9e70757

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

app/models/plan.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ def unregister_from_stripe
114114

115115
#TODO CHANGE with default in rails 4
116116
def generate_public_id
117-
self.public_id = public_id || SecureRandom.urlsafe_base64(4).downcase
117+
self.public_id ||= SecureRandom.urlsafe_base64(4).downcase
118118
end
119119
end

app/models/teams/account.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@ class Teams::Account < ActiveRecord::Base
2121
validates_presence_of :stripe_card_token
2222
validates_presence_of :stripe_customer_token
2323
validates :team_id, presence: true, uniqueness: true
24-
validate :admin_id, :payer_is_team_admin
2524

2625
attr_protected :stripe_customer_token, :admin_id
2726

28-
def payer_is_team_admin
29-
if admin_id.nil? #or !team.admin?(admin)
30-
errors.add(:admin_id, "must be team admin to create an account")
31-
end
32-
end
33-
3427
def subscribe_to!(plan, force=false)
3528
self.plan_ids = [plan.id]
3629
if force || update_on_stripe(plan)

0 commit comments

Comments
 (0)