From 11d82e07f3cee024e74b1360189d91f464f80012 Mon Sep 17 00:00:00 2001 From: Ori Marash Date: Thu, 15 Feb 2024 11:03:19 +0000 Subject: [PATCH] Same fix --- lib/active_cortex/generator/boolean.rb | 2 +- spec/active_cortex/generator/boolean_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/active_cortex/generator/boolean.rb b/lib/active_cortex/generator/boolean.rb index dbdca1f..0905caa 100644 --- a/lib/active_cortex/generator/boolean.rb +++ b/lib/active_cortex/generator/boolean.rb @@ -3,7 +3,7 @@ def self.accepts?(record:, field_name:) record.class.attribute_types[field_name.to_s].type == :boolean end - def save_generation(record:, field_name:) + def save_generation record.send("#{field_name}=", generation) end diff --git a/spec/active_cortex/generator/boolean_spec.rb b/spec/active_cortex/generator/boolean_spec.rb index d591e1c..ab9a5df 100644 --- a/spec/active_cortex/generator/boolean_spec.rb +++ b/spec/active_cortex/generator/boolean_spec.rb @@ -20,7 +20,7 @@ context "when saving the generation" do it "saves the generation to the record", :vcr do - generator.save_generation(record: book, field_name: :completed) + generator.save_generation expect(book.completed).to be_a(TrueClass).or be_a(FalseClass) end end