Skip to content
New issue

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

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

Already on GitHub? # to your account

[Model] Fix naming with inheritance when using Proxy #887

Merged

Conversation

tmandke
Copy link
Contributor

@tmandke tmandke commented Jul 3, 2019

Closes #717 & Closes #585

before(:all) do
class ::TestBase
extend ActiveModel::Naming
context 'without using proxy' do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have just move d the tests into a context and changed the way the classes are defined so that they can be redefined with a different superclass in the other context.

TestBase = Class.new do
extend ActiveModel::Naming

include Elasticsearch::Model
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could just copy the required code from Elasticsearch::Model in here but that would result in tests passing even if the Elasticsearch::Model changed.

@tmandke tmandke changed the title Fix naming with inheritance when using Proxy [Model] Fix naming with inheritance when using Proxy Jul 3, 2019
@estolfo
Copy link
Contributor

estolfo commented Jul 4, 2019

thanks @tmandke !

@estolfo estolfo merged commit 2adb8dd into elastic:master Jul 4, 2019
@tmandke tmandke deleted the fix-model-proxy-naming-with-inheritance branch July 8, 2019 16:29
estolfo pushed a commit to estolfo/elasticsearch-rails that referenced this pull request Aug 8, 2019
* Add naming inheritance tests when using a proxy

* Skip circular call to index_name/document_type when Proxy is used and inheritance is enabled
estolfo added a commit that referenced this pull request Aug 8, 2019
…ted (#898)

* [MODEL] Add warning and documentation about STI support being deprecated (#895)

* [MODEL] Add warning and documentation about STI support being deprecated

* [MODEL] Minor change to STI deprecation warning

* [MODEL] Freeze string constant depreaction warning

* [MODEL] Update Readme text about STI deprecation

* [Model] Fix naming with inheritance when using Proxy (#887)

* Add naming inheritance tests when using a proxy

* Skip circular call to index_name/document_type when Proxy is used and inheritance is enabled

* [MODEL] Adjust previous cherry-picked commit for 6.x branch

* [MODEL] Only warn if inheritance_enabled is set to true
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants