arrange method incorrect work if using joins models #96

ermolaev opened this Issue Jul 24, 2012 · 0 comments

1 participant

class Property < ActiveRecord::Base
  has_ancestry :cache_depth => true

  has_many :product_properties, :dependent => :delete_all
  has_many :products, :through => :product_properties

  default_scope order('ordinal')

# incorrect work
@properies = Property
      .select('properties.*, product_properties.value')
      .where(product_properties: {product_id:})

# correct work
@properies = Property
@ermolaev ermolaev closed this Jul 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment