From 895a7dcb6547ac181e87af5c40fdb46693b94711 Mon Sep 17 00:00:00 2001 From: Chris Welham <71787007+apexatoll@users.noreply.github.com> Date: Wed, 15 Nov 2023 01:45:06 +0000 Subject: [PATCH] Rename AttributesConcern to Attributable --- .../concerns/{attributes_concern.rb => attributable.rb} | 2 +- lib/kangaru/configurator.rb | 2 +- lib/kangaru/database.rb | 2 +- .../concerns/{attributes_concern.rbs => attributable.rbs} | 2 +- sig/kangaru/configurator.rbs | 4 ++-- sig/kangaru/database.rbs | 4 ++-- .../{attributes_concern_spec.rb => attributable_spec.rb} | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) rename lib/kangaru/concerns/{attributes_concern.rb => attributable.rb} (96%) rename sig/kangaru/concerns/{attributes_concern.rbs => attributable.rbs} (94%) rename spec/kangaru/concerns/{attributes_concern_spec.rb => attributable_spec.rb} (98%) diff --git a/lib/kangaru/concerns/attributes_concern.rb b/lib/kangaru/concerns/attributable.rb similarity index 96% rename from lib/kangaru/concerns/attributes_concern.rb rename to lib/kangaru/concerns/attributable.rb index 2171beb..18cedb4 100644 --- a/lib/kangaru/concerns/attributes_concern.rb +++ b/lib/kangaru/concerns/attributable.rb @@ -1,5 +1,5 @@ module Kangaru - module AttributesConcern + module Attributable extend Concern class_methods do diff --git a/lib/kangaru/configurator.rb b/lib/kangaru/configurator.rb index 236d163..b31bd8d 100644 --- a/lib/kangaru/configurator.rb +++ b/lib/kangaru/configurator.rb @@ -1,6 +1,6 @@ module Kangaru class Configurator - include AttributesConcern + include Attributable include Validatable using Patches::Inflections diff --git a/lib/kangaru/database.rb b/lib/kangaru/database.rb index 440a979..d6e5e38 100644 --- a/lib/kangaru/database.rb +++ b/lib/kangaru/database.rb @@ -2,7 +2,7 @@ module Kangaru class Database extend Forwardable - include AttributesConcern + include Attributable PLUGINS = %i[ enum diff --git a/sig/kangaru/concerns/attributes_concern.rbs b/sig/kangaru/concerns/attributable.rbs similarity index 94% rename from sig/kangaru/concerns/attributes_concern.rbs rename to sig/kangaru/concerns/attributable.rbs index 9677610..32c1137 100644 --- a/sig/kangaru/concerns/attributes_concern.rbs +++ b/sig/kangaru/concerns/attributable.rbs @@ -1,5 +1,5 @@ module Kangaru - module AttributesConcern + module Attributable extend Concern module ClassMethods diff --git a/sig/kangaru/configurator.rbs b/sig/kangaru/configurator.rbs index e5e07a9..51f243b 100644 --- a/sig/kangaru/configurator.rbs +++ b/sig/kangaru/configurator.rbs @@ -1,7 +1,7 @@ module Kangaru class Configurator - include AttributesConcern - extend AttributesConcern::ClassMethods + include Attributable + extend Attributable::ClassMethods include Validatable extend Validatable::ClassMethods diff --git a/sig/kangaru/database.rbs b/sig/kangaru/database.rbs index 620f554..5eda28f 100644 --- a/sig/kangaru/database.rbs +++ b/sig/kangaru/database.rbs @@ -2,8 +2,8 @@ module Kangaru class Database extend Forwardable - include AttributesConcern - extend AttributesConcern::ClassMethods + include Attributable + extend Attributable::ClassMethods PLUGINS: Array[Symbol] diff --git a/spec/kangaru/concerns/attributes_concern_spec.rb b/spec/kangaru/concerns/attributable_spec.rb similarity index 98% rename from spec/kangaru/concerns/attributes_concern_spec.rb rename to spec/kangaru/concerns/attributable_spec.rb index 32d9d69..7ac936a 100644 --- a/spec/kangaru/concerns/attributes_concern_spec.rb +++ b/spec/kangaru/concerns/attributable_spec.rb @@ -1,16 +1,16 @@ -RSpec.describe Kangaru::AttributesConcern do +RSpec.describe Kangaru::Attributable do subject(:model) { model_class.new(**attributes) } shared_context :no_attributes_defined do let(:model_class) do - Class.new { include Kangaru::AttributesConcern } + Class.new { include Kangaru::Attributable } end end shared_context :attributes_defined do let(:model_class) do Class.new do - include Kangaru::AttributesConcern + include Kangaru::Attributable attr_accessor :foo, :bar, :baz end