Story#105855968 - change registrar parameter from exclude_in_monthly_directo to test_registrar be used more widely

This commit is contained in:
Vladimir Krylov 2016-03-16 17:48:35 +02:00
parent a950e9e4a7
commit c957bce553
5 changed files with 9 additions and 9 deletions

View file

@ -57,7 +57,7 @@ class Admin::RegistrarsController < AdminController
def registrar_params
params.require(:registrar).permit(
:name, :reg_no, :vat_no, :street, :city, :state, :zip, :billing_address,
:country_code, :email, :phone, :billing_email, :code, :exclude_in_monthly_directo
:country_code, :email, :phone, :billing_email, :code, :test_registrar
)
end
end

View file

@ -75,7 +75,7 @@ class Directo < ActiveRecord::Base
end
directo_next = last_directo
Registrar.where.not(exclude_in_monthly_directo: true).find_each do |registrar|
Registrar.where.not(test_registrar: true).find_each do |registrar|
unless registrar.cash_account
Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account")
next

View file

@ -84,9 +84,9 @@
= f.text_field(:code, class: 'form-control', disabled: !f.object.new_record?)
.form-group
.col-md-4.control-label
= f.label :exclude_in_monthly_directo
= f.label :test_registrar
.col-md-7
= f.check_box :exclude_in_monthly_directo, class: 'form-control'
= f.check_box :test_registrar, class: 'form-control'
%hr
.row

View file

@ -1,5 +0,0 @@
class AddExcludeMonthlyDirectoToRegistrar < ActiveRecord::Migration
def change
add_column :registrars, :exclude_in_monthly_directo, :boolean, default: false
end
end

View file

@ -0,0 +1,5 @@
class AddTestRegistrarToRegistrar < ActiveRecord::Migration
def change
add_column :registrars, :test_registrar, :boolean, default: false
end
end