From ee534f334b59b006558e1e634f6cd01b4106ed94 Mon Sep 17 00:00:00 2001 From: "Petr Savichev (proton)" Date: Mon, 22 Aug 2022 15:41:26 -0500 Subject: [PATCH] code review fixes --- lib/moribus/extensions/has_current_extension.rb | 3 +++ spec/moribus/extensions/has_current_extension_spec.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/moribus/extensions/has_current_extension.rb b/lib/moribus/extensions/has_current_extension.rb index 1f9c0ca..de860ef 100644 --- a/lib/moribus/extensions/has_current_extension.rb +++ b/lib/moribus/extensions/has_current_extension.rb @@ -26,6 +26,9 @@ def remove_target!(*) end end + # Is the record has a column with name `updated_at` + # + # @return [Boolean] private def has_updated_at_column? target.class.column_names.include?("updated_at") end diff --git a/spec/moribus/extensions/has_current_extension_spec.rb b/spec/moribus/extensions/has_current_extension_spec.rb index de0f375..a7a096e 100644 --- a/spec/moribus/extensions/has_current_extension_spec.rb +++ b/spec/moribus/extensions/has_current_extension_spec.rb @@ -38,7 +38,7 @@ class SpecCustomer < MoribusSpecModel(spec_status_id: :integer) it "sets 'is_current' flag of overridden record to false for new record" do old_info = customer.spec_customer_info customer.spec_customer_info = SpecCustomerInfo.new - expect(old_info.is_current).to be_falsey + expect(old_info.is_current).to be false end it "sets 'is_current' flag updates updated_at column" do