Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
proton committed Aug 22, 2022
1 parent 870a6b0 commit ee534f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/moribus/extensions/has_current_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/moribus/extensions/has_current_extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee534f3

Please sign in to comment.