Remove unused code

#569
This commit is contained in:
Artur Beljajev 2017-08-21 02:03:49 +03:00
parent d8118878b1
commit d4176b6979
5 changed files with 0 additions and 41 deletions

View file

@ -215,10 +215,6 @@ class Contact < ActiveRecord::Base
STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{counter} orphaned contacts\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{counter} orphaned contacts\n" unless Rails.env.test?
end end
def privs
where("ident_type = '#{PRIV}'")
end
def admin_statuses def admin_statuses
[ [
SERVER_UPDATE_PROHIBITED, SERVER_UPDATE_PROHIBITED,

View file

@ -9,7 +9,6 @@ class Registrar < ActiveRecord::Base
has_many :accounts has_many :accounts
has_many :nameservers, through: :domains has_many :nameservers, through: :domains
has_many :whois_records has_many :whois_records
has_many :priv_contacts, -> { privs }, class_name: 'Contact'
has_many :white_ips, dependent: :destroy has_many :white_ips, dependent: :destroy
delegate :balance, to: :cash_account, allow_nil: true delegate :balance, to: :cash_account, allow_nil: true

View file

@ -1042,25 +1042,11 @@
<polygon fill="#0374bc" stroke="#0374bc" points="2896.54,-311.549 2886.9,-306.334 2891.56,-311.185 2886.57,-310.822 2886.57,-310.822 2886.57,-310.822 2891.56,-311.185 2886.24,-315.31 2896.54,-311.549 2896.54,-311.549"/> <polygon fill="#0374bc" stroke="#0374bc" points="2896.54,-311.549 2886.9,-306.334 2891.56,-311.185 2886.57,-310.822 2886.57,-310.822 2886.57,-310.822 2891.56,-311.185 2886.24,-315.31 2896.54,-311.549 2896.54,-311.549"/>
</g> </g>
<!-- Registrar&#45;&gt;Contact --> <!-- Registrar&#45;&gt;Contact -->
<g id="edge68" class="edge"><title>Registrar&#45;&gt;Contact</title>
<path fill="none" stroke="#08d288" d="M1289.24,-522.039C1610.25,-522.115 3337.74,-519.996 3565.99,-466 3599.47,-458.082 3606.71,-451.045 3635.99,-433 3658.1,-419.38 3659.77,-410.424 3681.99,-397 3698.68,-386.919 3711.41,-395.371 3721.99,-379 3772.14,-301.446 3754.66,-355.133 3112.99,-325 3037.3,-321.445 2949.51,-315.411 2896.66,-311.57"/>
<ellipse fill="none" stroke="#08d288" cx="1285.04" cy="-522.038" rx="4" ry="4"/>
<polygon fill="#08d288" stroke="#08d288" points="2896.54,-311.561 2886.9,-306.344 2891.56,-311.197 2886.57,-310.832 2886.57,-310.832 2886.57,-310.832 2891.56,-311.197 2886.24,-315.32 2896.54,-311.561 2896.54,-311.561"/>
<text text-anchor="middle" x="3718.49" y="-411.3" font-family="Times,serif" font-size="14.00">priv_contacts</text>
</g>
<!-- Registrar&#45;&gt;Contact -->
<g id="edge105" class="edge"><title>Registrar&#45;&gt;Contact</title> <g id="edge105" class="edge"><title>Registrar&#45;&gt;Contact</title>
<path fill="none" stroke="#983d43" d="M1289.27,-522.186C1639.37,-523.21 3666.41,-525.142 3754.99,-433 3768.3,-419.16 3746.5,-345.108 3743.99,-343 3717.15,-320.429 3148.03,-326.627 3112.99,-325 3037.29,-321.484 2949.51,-315.438 2896.66,-311.584"/> <path fill="none" stroke="#983d43" d="M1289.27,-522.186C1639.37,-523.21 3666.41,-525.142 3754.99,-433 3768.3,-419.16 3746.5,-345.108 3743.99,-343 3717.15,-320.429 3148.03,-326.627 3112.99,-325 3037.29,-321.484 2949.51,-315.438 2896.66,-311.584"/>
<ellipse fill="none" stroke="#983d43" cx="1285.07" cy="-522.173" rx="4" ry="4"/> <ellipse fill="none" stroke="#983d43" cx="1285.07" cy="-522.173" rx="4" ry="4"/>
<polygon fill="#983d43" stroke="#983d43" points="2896.54,-311.576 2886.9,-306.356 2891.56,-311.21 2886.57,-310.844 2886.57,-310.844 2886.57,-310.844 2891.56,-311.21 2886.24,-315.332 2896.54,-311.576 2896.54,-311.576"/> <polygon fill="#983d43" stroke="#983d43" points="2896.54,-311.576 2886.9,-306.356 2891.56,-311.21 2886.57,-310.844 2886.57,-310.844 2886.57,-310.844 2891.56,-311.21 2886.24,-315.332 2896.54,-311.576 2896.54,-311.576"/>
</g> </g>
<!-- Registrar&#45;&gt;Contact -->
<g id="edge112" class="edge"><title>Registrar&#45;&gt;Contact</title>
<path fill="none" stroke="#aa3e5f" d="M1289.02,-521.999C1518.6,-521.522 2478.68,-514.494 3260.99,-433 3260.99,-433 3649.99,-379 3649.99,-379 3710.03,-310.049 3826.1,-359.903 3112.99,-325 3037.3,-321.295 2949.51,-315.304 2896.66,-311.513"/>
<ellipse fill="none" stroke="#aa3e5f" cx="1284.84" cy="-522.006" rx="4" ry="4"/>
<polygon fill="#aa3e5f" stroke="#aa3e5f" points="2896.55,-311.504 2886.89,-306.297 2891.56,-311.145 2886.57,-310.785 2886.57,-310.785 2886.57,-310.785 2891.56,-311.145 2886.25,-315.273 2896.55,-311.504 2896.55,-311.504"/>
<text text-anchor="middle" x="3555.49" y="-411.3" font-family="Times,serif" font-size="14.00">priv_contacts</text>
</g>
<!-- Registrar&#45;&gt;Domain --> <!-- Registrar&#45;&gt;Domain -->
<g id="edge60" class="edge"><title>Registrar&#45;&gt;Domain</title> <g id="edge60" class="edge"><title>Registrar&#45;&gt;Domain</title>
<path fill="none" stroke="#a7f439" d="M1285.22,-514.145C1410.96,-494.146 1752.36,-441.557 1878.45,-422.782"/> <path fill="none" stroke="#a7f439" d="M1285.22,-514.145C1410.96,-494.146 1752.36,-441.557 1878.45,-422.782"/>

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Before After
Before After

View file

@ -1665,25 +1665,11 @@
<polygon fill="#257f99" stroke="#257f99" points="3166.6,-1436.81 3164.86,-1425.98 3163.85,-1432.63 3161.1,-1428.45 3161.1,-1428.45 3161.1,-1428.45 3163.85,-1432.63 3157.34,-1430.93 3166.6,-1436.81 3166.6,-1436.81"/> <polygon fill="#257f99" stroke="#257f99" points="3166.6,-1436.81 3164.86,-1425.98 3163.85,-1432.63 3161.1,-1428.45 3161.1,-1428.45 3161.1,-1428.45 3163.85,-1432.63 3157.34,-1430.93 3166.6,-1436.81 3166.6,-1436.81"/>
</g> </g>
<!-- Registrar&#45;&gt;Contact --> <!-- Registrar&#45;&gt;Contact -->
<g id="edge68" class="edge"><title>Registrar&#45;&gt;Contact</title>
<path fill="none" stroke="#625a51" d="M1737.79,-2486.74C2105.37,-2477.42 3671.93,-2427.41 3783,-2250 3886.64,-2084.47 3711.19,-1968.76 3829,-1813 3841.99,-1795.82 3861.92,-1812.84 3874,-1795 3894.81,-1764.27 3899.79,-1654.68 3874,-1628 3833.13,-1585.71 3397.45,-1636.61 3345,-1610 3270.62,-1572.26 3210.61,-1502.97 3166.63,-1436.95"/>
<ellipse fill="none" stroke="#625a51" cx="1733.59" cy="-2486.84" rx="4" ry="4"/>
<polygon fill="#625a51" stroke="#625a51" points="3166.57,-1436.86 3164.84,-1426.03 3163.82,-1432.68 3161.08,-1428.5 3161.08,-1428.5 3161.08,-1428.5 3163.82,-1432.68 3157.32,-1430.98 3166.57,-1436.86 3166.57,-1436.86"/>
<text text-anchor="middle" x="3865.5" y="-2027.8" font-family="Times,serif" font-size="14.00">priv_contacts</text>
</g>
<!-- Registrar&#45;&gt;Contact -->
<g id="edge105" class="edge"><title>Registrar&#45;&gt;Contact</title> <g id="edge105" class="edge"><title>Registrar&#45;&gt;Contact</title>
<path fill="none" stroke="#84dd57" d="M1737.74,-2486.28C2114.24,-2474.64 3753.89,-2414.71 3902,-2250 3948.21,-2198.61 3944.87,-1676.88 3896,-1628 3852.69,-1584.68 3399.64,-1637.68 3345,-1610 3270.59,-1572.31 3210.58,-1503.03 3166.61,-1437"/> <path fill="none" stroke="#84dd57" d="M1737.74,-2486.28C2114.24,-2474.64 3753.89,-2414.71 3902,-2250 3948.21,-2198.61 3944.87,-1676.88 3896,-1628 3852.69,-1584.68 3399.64,-1637.68 3345,-1610 3270.59,-1572.31 3210.58,-1503.03 3166.61,-1437"/>
<ellipse fill="none" stroke="#84dd57" cx="1733.61" cy="-2486.41" rx="4" ry="4"/> <ellipse fill="none" stroke="#84dd57" cx="1733.61" cy="-2486.41" rx="4" ry="4"/>
<polygon fill="#84dd57" stroke="#84dd57" points="3166.55,-1436.91 3164.81,-1426.08 3163.8,-1432.73 3161.05,-1428.55 3161.05,-1428.55 3161.05,-1428.55 3163.8,-1432.73 3157.29,-1431.02 3166.55,-1436.91 3166.55,-1436.91"/> <polygon fill="#84dd57" stroke="#84dd57" points="3166.55,-1436.91 3164.81,-1426.08 3163.8,-1432.73 3161.05,-1428.55 3161.05,-1428.55 3161.05,-1428.55 3163.8,-1432.73 3157.29,-1431.02 3166.55,-1436.91 3166.55,-1436.91"/>
</g> </g>
<!-- Registrar&#45;&gt;Contact -->
<g id="edge112" class="edge"><title>Registrar&#45;&gt;Contact</title>
<path fill="none" stroke="#eb888a" d="M1738.05,-2484.46C2024.22,-2468.39 3023.5,-2402.27 3298,-2250 3520.54,-2126.55 3443.92,-1933.63 3668,-1813 3697.56,-1797.09 3795.72,-1820.11 3818,-1795 3842.63,-1767.24 3843.74,-1654.74 3818,-1628 3781.52,-1590.11 3391.85,-1633.89 3345,-1610 3270.7,-1572.11 3210.7,-1502.8 3166.7,-1436.81"/>
<ellipse fill="none" stroke="#eb888a" cx="1733.79" cy="-2484.7" rx="4" ry="4"/>
<polygon fill="#eb888a" stroke="#eb888a" points="3166.64,-1436.72 3164.91,-1425.89 3163.9,-1432.54 3161.15,-1428.37 3161.15,-1428.37 3161.15,-1428.37 3163.9,-1432.54 3157.39,-1430.84 3166.64,-1436.72 3166.64,-1436.72"/>
<text text-anchor="middle" x="3704.5" y="-2027.8" font-family="Times,serif" font-size="14.00">priv_contacts</text>
</g>
<!-- Registrar&#45;&gt;Domain --> <!-- Registrar&#45;&gt;Domain -->
<g id="edge60" class="edge"><title>Registrar&#45;&gt;Domain</title> <g id="edge60" class="edge"><title>Registrar&#45;&gt;Domain</title>
<path fill="none" stroke="#6a2f42" d="M1734.92,-2400.64C1792.79,-2335.05 1874.64,-2244.16 1943.33,-2169.11"/> <path fill="none" stroke="#6a2f42" d="M1734.92,-2400.64C1792.79,-2335.05 1874.64,-2244.16 1943.33,-2169.11"/>

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 234 KiB

Before After
Before After

View file

@ -35,10 +35,6 @@ describe Registrar do
@registrar.reference_no.should_not be_blank @registrar.reference_no.should_not be_blank
@registrar.reference_no.last(10).to_i.should_not == 0 @registrar.reference_no.last(10).to_i.should_not == 0
end end
it 'should not have priv contacts' do
@registrar.priv_contacts.size.should == 0
end
end end
context 'with valid attributes' do context 'with valid attributes' do
@ -120,9 +116,5 @@ describe Registrar do
registrar.valid? registrar.valid?
registrar.errors.full_messages.should == ['Code is forbidden to use'] registrar.errors.full_messages.should == ['Code is forbidden to use']
end end
it 'should not have priv contacts' do
@registrar.priv_contacts.size.should == 0
end
end end
end end