mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
110687814-migrations_code_change
This commit is contained in:
parent
577762a2bc
commit
7784a44f8d
6 changed files with 16 additions and 16 deletions
|
@ -7,7 +7,6 @@ class Epp::Contact < Contact
|
||||||
self.inheritance_column = :sti_disabled
|
self.inheritance_column = :sti_disabled
|
||||||
|
|
||||||
before_validation :manage_permissions
|
before_validation :manage_permissions
|
||||||
before_update :write_update_values
|
|
||||||
|
|
||||||
def manage_permissions
|
def manage_permissions
|
||||||
return unless update_prohibited? || delete_prohibited?
|
return unless update_prohibited? || delete_prohibited?
|
||||||
|
@ -15,11 +14,6 @@ class Epp::Contact < Contact
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_update_values
|
|
||||||
self.upid = current_user.identity_code if current_user
|
|
||||||
self.updated_at = Time.zone.now
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
# support legacy search
|
# support legacy search
|
||||||
def find_by_epp_code(code)
|
def find_by_epp_code(code)
|
||||||
|
@ -186,7 +180,8 @@ class Epp::Contact < Contact
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@current_user = current_user
|
self.upid = current_user.id if current_user
|
||||||
|
self.update = Time.zone.now
|
||||||
|
|
||||||
super(at)
|
super(at)
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,6 @@ class Epp::Domain < Domain
|
||||||
attr_accessor :is_renewal, :is_transfer, :current_user
|
attr_accessor :is_renewal, :is_transfer, :current_user
|
||||||
|
|
||||||
before_validation :manage_permissions
|
before_validation :manage_permissions
|
||||||
before_update :write_update_values
|
|
||||||
|
|
||||||
def manage_permissions
|
def manage_permissions
|
||||||
return if is_admin # this bad hack for 109086524, refactor later
|
return if is_admin # this bad hack for 109086524, refactor later
|
||||||
|
@ -16,11 +15,6 @@ class Epp::Domain < Domain
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_update_values
|
|
||||||
self.upid = current_user.identity_code if current_user
|
|
||||||
self.updated_at = Time.zone.now
|
|
||||||
end
|
|
||||||
|
|
||||||
after_validation :validate_contacts
|
after_validation :validate_contacts
|
||||||
def validate_contacts
|
def validate_contacts
|
||||||
return true if is_renewal || is_transfer
|
return true if is_renewal || is_transfer
|
||||||
|
@ -495,7 +489,8 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
# at[:statuses] += at_add[:domain_statuses_attributes]
|
# at[:statuses] += at_add[:domain_statuses_attributes]
|
||||||
|
|
||||||
@current_user = current_user
|
self.upid = current_user.id if current_user
|
||||||
|
self.update = Time.zone.now
|
||||||
|
|
||||||
if errors.empty? && verify &&
|
if errors.empty? && verify &&
|
||||||
Setting.request_confrimation_on_registrant_change_enabled &&
|
Setting.request_confrimation_on_registrant_change_enabled &&
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class AddUpIdValueToDomain < ActiveRecord::Migration
|
class AddUpIdValueToDomain < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_column :domains, :upid, :string
|
add_column :domains, :upid, :integer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class AddUpIdValueToContact < ActiveRecord::Migration
|
class AddUpIdValueToContact < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_column :contacts, :upid, :string
|
add_column :contacts, :upid, :integer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
5
db/migrate/20160226132045_add_up_date_value_to_domain.rb
Normal file
5
db/migrate/20160226132045_add_up_date_value_to_domain.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUpDateValueToDomain < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :domains, :update, :timestamp
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUpDateValueToContact < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :contacts, :update, :timestamp
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue