Skip to content

Commit e340e7f

Browse files
pimpinclaude
andcommitted
Refactor: factorize IgnoredProperties extension in Document class
Move `extend IgnoredProperties` from NestedDocument and Base classes to their parent Document class to eliminate code duplication. Since both NestedDocument and Base inherit from Document, they automatically gain access to the ignored_properties functionality without redundant extend statements. This refactoring improves code maintainability and ensures any future Document subclasses will also have access to ignored_properties. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ef83daa commit e340e7f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/couchbase-orm/base.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Document
4646
include Encrypt
4747

4848
extend Enum
49+
extend IgnoredProperties
4950

5051
define_model_callbacks :initialize, :only => :after
5152

@@ -110,8 +111,6 @@ def serialized_attributes
110111
end
111112

112113
class NestedDocument < Document
113-
extend IgnoredProperties
114-
115114
def initialize(*args, **kwargs)
116115
super
117116
if respond_to?(:id) && id.nil?
@@ -136,7 +135,6 @@ class Base < Document
136135
extend EnsureUnique
137136
extend HasMany
138137
extend Index
139-
extend IgnoredProperties
140138
extend JsonSchema::Validation
141139
extend PropertiesAlwaysExistsInDocument
142140

0 commit comments

Comments
 (0)