Skip to content

Conversation

@luislavena
Copy link
Owner

This aims to clarify the confusion about using embed_as within modules and classes, particularly around when to use the self. prefix.

The previous documentation briefly mentioned self. but did not explain the underlying behavior: the macro generates instance methods by default, and prepending self. creates class methods instead.

Added three progressive examples covering top-level usage, module/class usage with self., and an abstract interface pattern for applications needing multiple database classes with shared migration logic (from my example in the reported issue)

Closes #15

This aims to clarify the confusion about using embed_as within modules
and classes, particularly around when to use the `self.` prefix.

The previous documentation briefly mentioned `self.` but did not explain
the underlying behavior: the macro generates instance methods by default,
and prepending self. creates class methods instead.

Added three progressive examples covering top-level usage, module/class
usage with self., and an abstract interface pattern for applications
needing multiple database classes with shared migration logic (from my
example in the reported issue)

Closes #15
@luislavena luislavena merged commit 420e4a6 into main Jan 20, 2026
1 check passed
@luislavena luislavena deleted the improve-embed-as-description branch January 20, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential .embed_as change

2 participants