Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming Box to Factory #614

Merged
merged 1 commit into from
Jan 18, 2021
Merged

Renaming Box to Factory #614

merged 1 commit into from
Jan 18, 2021

Conversation

jwoertink
Copy link
Member

Fixes #498

This change renames Avram::Box to Avram::Factory. The main reasons are that the term "Factory" seems to be more common use for this type of object, as well as Crystal already has a built-in Box class.

@jwoertink jwoertink added the BREAKING CHANGE This will cause a breaking change label Jan 17, 2021
getter operation

SEQUENCES = {} of String => Int32

macro inherited
{% unless @type.abstract? %}
{% operation = @type.name.gsub(/Box/, "::SaveOperation").id %}
{% operation = @type.name.gsub(/Factory$/, "::SaveOperation").id %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the $ here to ensure it's replacing the ending Factory word in case someone has a model called something like FactorySetting

Comment on lines -34 to -36
def self.save
{% raise "'Box.save' has been renamed to 'Box.create' to match 'SaveOperation.create'" %}
end
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been removed for quite a few versions now, so just getting rid of it instead of fixing the error message.

@jwoertink jwoertink merged commit e338022 into master Jan 18, 2021
@jwoertink jwoertink deleted the issues/498 branch January 18, 2021 03:00
jwoertink added a commit that referenced this pull request Jan 18, 2021
jwoertink added a commit that referenced this pull request Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE This will cause a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change Box -> Factory
2 participants