jhawthorn / discard

🃏🗑 Soft deletes for ActiveRecord done right

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discard method is not working inside transactions

SalmaNegm opened this issue · comments

discard method is not working inside transactions

ActiveRecord::Base.transaction do
            begin
                @product.assign_attributes(product_params)
                new_produc = @product.dup
                new_produc.save
                @product.discard
                 # redirect to page
            rescue
                # redirect to page
            end
end

Sorry, It's an error in my code