Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add ActiveRecord option to store the full class name on STI's type co…
…lumn, allowing one to have STI subclasses in different namespaces [#114] Signed-off-by: rick <technoweenie@gmail.com>
- Loading branch information
1 parent
2d372d7
commit bca8751
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
bca8751
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the common technique of future-proofing migrations by defining the class being migrated within the namespace of the migration itself?
The solution could be as simple as adding a sti_class_name method on ActiveRecord::Base, cleaning up the repetition of all the store_full_sti_class ? self.class.name :
bca8751
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duncanbeevers
I’m planning to address this issue and some others asap.
I’ll try to solve every issue listed in the ticket1, so if there is anything else please post there.
1 http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/114-namespaced-models-and-sti