mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-04 17:55:11 +02:00
Rename Check#domain_expire_at in domain_expires_at
This commit is contained in:
parent
9acb74f610
commit
cc84d873d3
|
@ -25,7 +25,7 @@ class WhoisSyncJob < ApplicationJob
|
|||
def update_from_response(response)
|
||||
check.domain_created_at = response.created_at
|
||||
check.domain_updated_at = response.updated_at
|
||||
check.domain_expire_at = response.expire_at
|
||||
check.domain_expires_at = response.expire_at
|
||||
check.last_success_at = Time.now
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# comment :string(255)
|
||||
# domain :string(255) not null
|
||||
# domain_created_at :datetime
|
||||
# domain_expire_at :datetime
|
||||
# domain_expires_at :datetime
|
||||
# domain_updated_at :datetime
|
||||
# kind :integer not null
|
||||
# last_run_at :datetime
|
||||
|
@ -36,7 +36,7 @@ class Check < ApplicationRecord
|
|||
self.skip_time_zone_conversion_for_attributes = [
|
||||
:domain_created_at,
|
||||
:domain_updated_at,
|
||||
:domain_expire_at,
|
||||
:domain_expires_at,
|
||||
]
|
||||
|
||||
validates :kind, presence: true
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div>Kind: <%= check.kind %></div>
|
||||
<div>Created date: <%= l(check.domain_created_at.to_date) if check.domain_created_at.present? %></div>
|
||||
<div>Update date: <%= l(check.domain_updated_at.to_date) if check.domain_updated_at.present? %></div>
|
||||
<div>Expire date: <%= l(check.domain_expire_at.to_date) if check.domain_expire_at.present? %></div>
|
||||
<div>Expire date: <%= l(check.domain_expires_at.to_date) if check.domain_expires_at.present? %></div>
|
||||
|
||||
<% if check.comment? %>
|
||||
<div>Comment: <%= check.comment %></div>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class RenameChecksDomainExpireAtToDomainExpiresAt < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
rename_column :checks, :domain_expire_at, :domain_expires_at
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2018_05_31_101412) do
|
||||
ActiveRecord::Schema.define(version: 2018_06_02_154319) do
|
||||
|
||||
create_table "check_logs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
|
||||
t.bigint "check_id"
|
||||
|
@ -30,7 +30,7 @@ ActiveRecord::Schema.define(version: 2018_05_31_101412) do
|
|||
t.string "domain", null: false
|
||||
t.datetime "domain_created_at"
|
||||
t.datetime "domain_updated_at"
|
||||
t.datetime "domain_expire_at"
|
||||
t.datetime "domain_expires_at"
|
||||
t.datetime "last_run_at"
|
||||
t.datetime "last_success_at"
|
||||
t.string "vendor"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# comment :string(255)
|
||||
# domain :string(255) not null
|
||||
# domain_created_at :datetime
|
||||
# domain_expire_at :datetime
|
||||
# domain_expires_at :datetime
|
||||
# domain_updated_at :datetime
|
||||
# kind :integer not null
|
||||
# last_run_at :datetime
|
||||
|
@ -33,7 +33,7 @@ FactoryBot.define do
|
|||
domain "domain.fr"
|
||||
domain_created_at Time.new(2016, 4, 1, 12, 0, 0, "+02:00")
|
||||
domain_updated_at Time.new(2017, 3, 1, 12, 0, 0, "+02:00")
|
||||
domain_expire_at Time.new(2019, 4, 1, 12, 0, 0, "+02:00")
|
||||
domain_expires_at Time.new(2019, 4, 1, 12, 0, 0, "+02:00")
|
||||
active true
|
||||
vendor nil
|
||||
comment nil
|
||||
|
@ -47,7 +47,7 @@ FactoryBot.define do
|
|||
trait :nil_dates do
|
||||
domain_created_at nil
|
||||
domain_updated_at nil
|
||||
domain_expire_at nil
|
||||
domain_expires_at nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ class WhoisSyncJobTest < ActiveJob::TestCase
|
|||
|
||||
assert_just_now check.last_run_at
|
||||
assert_just_now check.last_success_at
|
||||
assert_equal Time.new(2019, 2, 17, 0, 0, 0, 0), check.domain_expire_at
|
||||
assert_equal Time.new(2019, 2, 17, 0, 0, 0, 0), check.domain_expires_at
|
||||
assert_equal Time.new(2017, 1, 28, 0, 0, 0, 0), check.domain_updated_at
|
||||
assert_equal Time.new(2004, 2, 18, 0, 0, 0, 0), check.domain_created_at
|
||||
assert check.active?
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# comment :string(255)
|
||||
# domain :string(255) not null
|
||||
# domain_created_at :datetime
|
||||
# domain_expire_at :datetime
|
||||
# domain_expires_at :datetime
|
||||
# domain_updated_at :datetime
|
||||
# kind :integer not null
|
||||
# last_run_at :datetime
|
||||
|
|
Loading…
Reference in a new issue