SchemaPlus / schema_associations

ActiveRecord extension that automatically (DRY) creates associations based on the schema
Other
46 stars 8 forks source link

Modernize implementation: use schema_monkey and schema_plus_core #16

Open ronen opened 8 years ago

ronen commented 8 years ago

schema_associations currently monkey-patches ActiveRecord::Base, using a bunch of alias_method_chain calls.

Instead, ideally schema_plus_core would provide a middleware stack for the relevant methods (reflect_on_association and friends), and schema_associations would then be middleware.

ronen commented 8 years ago

I've partly done this. Schema_associations now uses schema_monkey rather than manually patching, and the alias_method_chain calls are now replaced with method overrides and super.

Still WBN to add the appropriate middleware stacks to schema_plus_core and replace the method overrides with middleware. So keeping this issue open for now.