提交 b2e7d1e4 编写于 作者: A Aaron Patterson

surrounding scope_for_create behavior

上级 7ff98003
......@@ -98,5 +98,19 @@ def test_scope_for_create
relation = Relation.new :a, :b
assert_equal({}, relation.scope_for_create)
end
def test_create_with_value
relation = Relation.new Post, Post.arel_table
hash = { :hello => 'world' }
relation.create_with_value = hash
assert_equal hash, relation.scope_for_create
end
def test_create_with_value_with_wheres
relation = Relation.new Post, Post.arel_table
relation.where_values << relation.table[:id].eq(10)
relation.create_with_value = {:hello => 'world'}
assert_equal({:hello => 'world', :id => 10}, relation.scope_for_create)
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册