I want to use find_or_create_by, but this statement does NOT work. It does not \"find\" or \"create\" with the other attributes.
productproperty = ProductPro
You could also use where(...).first_or_create - ActiveRecord::Relation#first_or_create.
where(...).first_or_create
product_property_attrs = { product_id: product.id, property_id: property.id, value: d[descname] } product_property = ProductProperty.where(product_property_attrs).first_or_create