Skip to content
Snippets Groups Projects
Commit cb0e3a4f authored by Adam Cooke's avatar Adam Cooke
Browse files

support for a null send limit for unlimited

part of #144
parent 8b7bcd9a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -66,7 +66,6 @@ class Server < ApplicationRecord
 
random_string :token, :type => :chars, :length => 6, :unique => true, :upper_letters_only => true
default_value :permalink, -> { name ? name.parameterize : nil}
default_value :send_limit, -> { 100 }
default_value :raw_message_retention_days, -> { 30 }
default_value :raw_message_retention_size, -> { 2048 }
default_value :message_retention_days, -> { 60 }
Loading
Loading
@@ -196,11 +195,11 @@ class Server < ApplicationRecord
end
 
def send_limit_approaching?
send_volume >= self.send_limit * 0.90
self.send_limit && (send_volume >= self.send_limit * 0.90)
end
 
def send_limit_exceeded?
send_volume >= self.send_limit
self.send_limit && send_volume >= self.send_limit
end
 
def send_limit_warning(type)
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@
%fieldset.fieldSet.fieldSet--wide
.fieldSet__field
= f.label :send_limit, :class => 'fieldSet__label'
.fieldSet__input= f.text_field :send_limit, :autofocus => true, :class => 'input input--text'
.fieldSet__input= f.text_field :send_limit, :class => 'input input--text', :placeholder => "No limit"
.fieldSet__field
= f.label :allow_sender, "Allow sender header", :class => 'fieldSet__label'
.fieldSet__input= f.select :allow_sender, [["No", false], ["Yes - can use Sender header", true]], {}, :class => 'input input--select'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment