public
Created — forked from mickeyren/gist:1542652

weirdness on setting commissions

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4
# set commission only for non artists or artists whose not buying their own art
Rails.logger.debug '*' * 100
Rails.logger.debug "artist id: #{User.current.artist.id} product id: #{li.product.id} (#{!User.current.artist}) || (#{User.current.artist && !User.current.artist.products.include?(li.product)})"
li.set_commissions if !User.current.artist || (User.current.artist && !User.current.artist.products.include?(li.product))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.