ooor
ooor copied to clipboard
rename @loaded_associations to @association_cache ?
see lib/active_record/associations.rb it seems they use @association_cache the same way we use @loaded_associations in Ooor
may be more complex than what I said, for instance with p project having o2m tasks, with ActiveRecord we have:
p.association_cache[:tasks].reflection => #<ActiveRecord::Reflection::AssociationReflection:0x00000005dec6a0 @macro=:has_many, @name=:tasks, @options={:extend=>[], :autosave=>true}, @active_record=Project(id: integer, name: string, created_at: datetime, updated_at: datetime, description: string, owner_id: integer), @plural_name="tasks", @collection=true, @class_name="Task", @klass=Task(id: integer, name: string, description: string, project_id: integer, created_at: datetime, updated_at: datetime, done: boolean), @foreign_key="project_id", @active_record_primary_key="id", @type=nil>