add validation for payment method,print_setting,tax_profile

This commit is contained in:
phyusin
2017-10-27 13:28:25 +06:30
parent 0d2952c35f
commit 19b9b5c557
4 changed files with 7 additions and 2 deletions

View File

@@ -1,2 +1,4 @@
class PaymentMethodSetting < ApplicationRecord
# validations
validates_presence_of :payment_method, :gateway_communication_type, :gateway_url, :auth_token, :merchant_account_id
end

View File

@@ -1,2 +1,4 @@
class PrintSetting < ApplicationRecord
# validations
validates_presence_of :name, :unique_code, :font, :api_settings, :printer_name, :page_width, :page_height, :print_copies, :heading_space
end

View File

@@ -1,4 +1,5 @@
class TaxProfile < ApplicationRecord
default_scope { order('order_by asc') }
# validations
validates_presence_of :name, :rate
end

View File

@@ -4,7 +4,7 @@
<li class="breadcrumb-item"><a href="<%= print_settings_path %>">Print Setting</a></li>
<li class="breadcrumb-item active">Edit</li>
<span class="float-right">
<%= link_to t('.new', :default => t("views.btn.new")), print_settings_path %>
<%= link_to t('.back', :default => t("views.btn.back")), print_settings_path %>
</span>
</ol>
</div>