Quickfix private_users password generation. Refs #2162
This commit is contained in:
parent
7e523913c5
commit
6f7f42b4a9
|
@ -12,8 +12,8 @@ class PrivateUser < ActiveRecord::Base
|
|||
end
|
||||
|
||||
class << self
|
||||
def can_generate_more?(user_id)
|
||||
!PrivateUser.exists?(:user_id => user_id)
|
||||
def can_generate_more?(user_id, platform_id)
|
||||
!PrivateUser.exists?(:user_id => user_id, :platform_id => platform_id)
|
||||
end
|
||||
|
||||
def generate_pair(platform_id, user_id)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
.secondary-navigation
|
||||
%ul.wat-cf
|
||||
%li.first.active= link_to t("layout.private_users.list"), platform_private_users_path(@platform)
|
||||
%li= link_to t("layout.private_users.new"), platform_private_users_path(@platform), :method => :post if PrivateUser.can_generate_more?(current_user.id)
|
||||
%li= link_to t("layout.private_users.new"), platform_private_users_path(@platform), :method => :post if PrivateUser.can_generate_more?(current_user.id, @platform.id)
|
||||
.content
|
||||
%h2.title
|
||||
= t("layout.private_users.list_header")
|
||||
|
|
Loading…
Reference in New Issue