Skip to content

Commit

Permalink
prepend shipping association so association resolve properly on save
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Kerin committed Oct 18, 2013
1 parent 340b87e commit c2fec88
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions classes/Kohana/Jam/Behavior/Shippable/Store/Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ public function initialize(Jam_Meta $meta, $name)
parent::initialize($meta, $name);

$meta
->associations(array(
'shipping' => Jam::association('hasone', array(
'foreign_model' => 'store_purchase_shipping',
'inverse_of' => 'store_purchase',
'dependent' => Jam_Association::DELETE,
))
))
->association('shipping', Jam::association('hasone', array(
'foreign_model' => 'store_purchase_shipping',
'inverse_of' => 'store_purchase',
'dependent' => Jam_Association::DELETE,
)), TRUE)
->events()
->bind('model.update_items', array($this, 'update_shipping_items'))
->bind('model.filter_items', array($this, 'filter_shipping_items'));
Expand Down

0 comments on commit c2fec88

Please sign in to comment.