0

順序のオーバーライドによく似ています

Entity.associations.order("field ASC").reorder("other_field DESC") 
# => result: GET ... order by other_filed DESC

スコープ オプションをオーバーライドすることは可能ですか?

Entity.associations.where("field = 1").where("field = 2")
# => GET ... where "field" = 1 and "field" = 2

# Desirable:
Entity.associations.where("field = 1").rescope(where("field = 2"))
# => GET ... where "field" = 2

PS
レール3

PSS Accepted の回答は Rails4 で有効です

4

1 に答える 1