Allow strategy to be called on arbitrary classes#48
Open
jcoyne wants to merge 1 commit intopda:masterfrom
Open
Allow strategy to be called on arbitrary classes#48jcoyne wants to merge 1 commit intopda:masterfrom
jcoyne wants to merge 1 commit intopda:masterfrom
Conversation
Prior to this change, it attempt to use the hardcoded `Feature` class, whether or not it exists. So, when I attempted to namespace my Feature class I got the following error: ``` NameError: uninitialized constant Flip::DatabaseStrategy::Feature /Users/jcoyne/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/flip-1.1.0/lib/flip/database_strategy.rb:5:in `initialize' /Users/jcoyne/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/flip-1.1.0/lib/flip/feature_set.rb:36:in `new' /Users/jcoyne/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/flip-1.1.0/lib/flip/feature_set.rb:36:in `add_strategy' /Users/jcoyne/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/flip-1.1.0/lib/flip/declarable.rb:15:in `strategy' /Users/jcoyne/workspace/curation_concerns/app/models/curation_concerns/feature.rb:6:in `<class:Feature>' ```
Contributor
Author
|
@pda Do you have any feedback about this PR? |
Owner
|
Ideally I think features should be declared in an initializer, not in a model class, as per #1 (comment), and then the model class should be customizable. However that would be a breaking change. Perhaps this PR is a decent backwards-compatible way to at least escape the hard-coded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this change, it attempt to use the hardcoded
Featureclass,whether or not it exists.
So, when I attempted to namespace my Feature class I got the following
error: