21
1
Fork 0
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:
Colin Darie 2018-06-02 17:45:50 +02:00
parent 9acb74f610
commit cc84d873d3
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
8 changed files with 16 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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>

View file

@ -0,0 +1,5 @@
class RenameChecksDomainExpireAtToDomainExpiresAt < ActiveRecord::Migration[5.2]
def change
rename_column :checks, :domain_expire_at, :domain_expires_at
end
end

View file

@ -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"

View file

@ -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

View file

@ -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?

View file

@ -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