Module: DelegateBelongsTo

Extended by:
ActiveSupport::Concern
Defined in:
lib/spree/core/delegate_belongs_to.rb

Overview

Creates methods on object which delegate to an association proxy. see delegate_belongs_to for two uses

Todo - integrate with ActiveRecord::Dirty to make sure changes to delegate object are noticed Should do class User < ActiveRecord::Base; delegate_belongs_to :contact, :firstname; end class Contact < ActiveRecord::Base; end u = User.first u.changed? # => false u.firstname = ‘Bobby’ u.changed? # => true

Right now the second call to changed? would return false

Todo - add has_one support. fairly straightforward addition

Defined Under Namespace

Modules: ClassMethods, InstanceMethods