mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +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
|
||||
|
||||
before_validation :manage_permissions
|
||||
before_update :write_update_values
|
||||
|
||||
def manage_permissions
|
||||
return unless update_prohibited? || delete_prohibited?
|
||||
|
@ -15,11 +14,6 @@ class Epp::Contact < Contact
|
|||
false
|
||||
end
|
||||
|
||||
def write_update_values
|
||||
self.upid = current_user.identity_code if current_user
|
||||
self.updated_at = Time.zone.now
|
||||
end
|
||||
|
||||
class << self
|
||||
# support legacy search
|
||||
def find_by_epp_code(code)
|
||||
|
@ -186,7 +180,8 @@ class Epp::Contact < Contact
|
|||
end
|
||||
end
|
||||
|
||||
@current_user = current_user
|
||||
self.upid = current_user.id if current_user
|
||||
self.update = Time.zone.now
|
||||
|
||||
super(at)
|
||||
end
|
||||
|
|
|
@ -6,7 +6,6 @@ class Epp::Domain < Domain
|
|||
attr_accessor :is_renewal, :is_transfer, :current_user
|
||||
|
||||
before_validation :manage_permissions
|
||||
before_update :write_update_values
|
||||
|
||||
def manage_permissions
|
||||
return if is_admin # this bad hack for 109086524, refactor later
|
||||
|
@ -16,11 +15,6 @@ class Epp::Domain < Domain
|
|||
false
|
||||
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
|
||||
def validate_contacts
|
||||
return true if is_renewal || is_transfer
|
||||
|
@ -495,7 +489,8 @@ class Epp::Domain < Domain
|
|||
|
||||
# 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 &&
|
||||
Setting.request_confrimation_on_registrant_change_enabled &&
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class AddUpIdValueToDomain < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :domains, :upid, :string
|
||||
add_column :domains, :upid, :integer
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class AddUpIdValueToContact < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :contacts, :upid, :string
|
||||
add_column :contacts, :upid, :integer
|
||||
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