Navigation Menu

Skip to content

Commit

Permalink
schema: Make flags methods to return an array
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Feb 19, 2014
1 parent 2ebc53e commit e09fcbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/droonga/catalog/schema.rb
Expand Up @@ -70,7 +70,7 @@ def type_flag
end

def flags
type_flag # TODO merge flags from ColumnIndexOptions
[type_flag] # TODO merge flags from ColumnIndexOptions
end

def value_type
Expand Down Expand Up @@ -132,14 +132,14 @@ def type_flag
end

def flags
type_flag
[type_flag]
end

def to_table_create_body
body = {
"name" => name,
"key_type" => key_type,
"flags" => flags
"flags" => flags.join("|")
}

if tokenizer
Expand Down
4 changes: 2 additions & 2 deletions test/unit/catalog/test_schema.rb
Expand Up @@ -92,7 +92,7 @@ def test_type
end

def test_flags
assert_equal("TABLE_HASH_KEY",
assert_equal(["TABLE_HASH_KEY"],
create_table("table_name",
{
"type" => "Hash"
Expand Down Expand Up @@ -144,7 +144,7 @@ def test_type
end

def test_flags
assert_equal("COLUMN_SCALAR",
assert_equal(["COLUMN_SCALAR"],
create_column("column_name",
{
"type" => "Scalar"
Expand Down

0 comments on commit e09fcbe

Please sign in to comment.