Skip to content

Its now working with STI as item_for search for Parent class #44

@imsinu9

Description

@imsinu9
def item_for(object)
  shopping_cart_items.where(:item => object).first
end

This returns parent object and if child object is passed as object it returns nil which makes remove call not to execute.

To work with STI

I have to override this method in my model which act like Shopping Cart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions