Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

arrange method incorrect work if using joins models #96

Closed
ermolaev opened this Issue · 0 comments

1 participant

@ermolaev
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')
end


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

# correct work
@properies = Property
      .select('properties.*')
      .arrange
@ermolaev ermolaev closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.