updates from Production
This commit is contained in:
@ -40,6 +40,7 @@ class User < ActiveRecord::Base
|
||||
has_many :reacts, :dependent => :destroy
|
||||
has_many :scheduled_thinghttps, :dependent => :destroy
|
||||
has_many :talkbacks, :dependent => :destroy
|
||||
has_many :timecontrols, :dependent => :destroy
|
||||
has_many :plugins, :dependent => :destroy
|
||||
has_many :devices, :dependent => :destroy
|
||||
has_many :api_keys, :dependent => :destroy
|
||||
@ -56,6 +57,11 @@ class User < ActiveRecord::Base
|
||||
cattr_reader :per_page
|
||||
@@per_page = 50
|
||||
|
||||
# true if the user has used the maximum number of available timecontrols
|
||||
def max_timecontrols?
|
||||
self.timecontrols.roots.count >= Timecontrol::MAX_PER_USER
|
||||
end
|
||||
|
||||
# allow login by login name also
|
||||
def self.find_first_by_auth_conditions(warden_conditions)
|
||||
conditions = warden_conditions.dup
|
||||
|
@ -46,13 +46,13 @@
|
||||
</div>
|
||||
|
||||
<% if current_admin_user.present? %>
|
||||
<div class="apps">
|
||||
<%= link_to scheduled_thinghttps_path do %>
|
||||
<%= image_tag 'scheduled_thinghttp.png', :size => '104x104' %>
|
||||
<br>
|
||||
<%= t(:scheduled_thinghttp) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="apps">
|
||||
<%= link_to timecontrols_path do %>
|
||||
<%= image_tag 'scheduled_thinghttp.png', :size => '104x104' %>
|
||||
<br>
|
||||
<%= t(:timecontrol) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user