This project is archived and is in readonly mode.
Namespaced models and STI
-
Pratik
- State changed from new to incomplete
Why the need to add new tables for tests ? It should be possible to use existing tables.
Rest looks good.
Thanks!
-
Rick
- Milestone set to 2.1.1
- Assigned user set to Rick
I really want this in 2.1. Though, the default should be off to keep the existing behavior, and on for Rails 3.0 and forward.
I also agree that the new tables for tests aren't necessary.
-
Rick
Also, I'm going to remove the choice since it shouldn't break for anyone. Anyone using STI without namespaced models will be unaffected, and this bug is basically preventing anyone from using STI with namespaced models.
-
Rick
- State changed from incomplete to open
-
Repository
(from [bca8751e40a5594c4de2ca58e089b8d98e44632b]) Add ActiveRecord option to store the full class name on STI's type column, allowing one to have STI subclasses in different namespaces [#114]
Signed-off-by: rick
-
Jonathan Viney
HasManyThroughAssociation#build_sti_condition needs to be addressed as well.
-
Rodrigo Kochenburger
That's great. Thanks Rick.
About having extra table, sorry about that. I did that to avoid breaking other things, my bad.
-
Rick
No worries.
Just FYI there are three issues remaining:
- HasManyThroughAssociation#build_sti_condition, as Jonathan mentioned above.
- ActiveRecord::Base#type_name_with_module adds the parent name, resulting in an annoying ruby warning.
- You can't create migration-specific STI models because the migration name will be saved to the #type value too. (see the rails core ML post.
-
Repository
- State changed from open to resolved
(from [72483c0d4c1e4ea794919974100acc2f255f6fd2]) Add ActiveRecord::Base.sti_name that checks ActiveRecord::Base#store_full_sti_class? and returns either the full or demodulized name. [rick] [#114 state:resolved]
