cequel/cequel — pull request #43 by outoftime (2013-10-05 03:34:21+00:00)
Title: Clearing a pre-existing value in a Set

To repro:

1. Create a table with one of its columns being a set.
2. Through the plugin, create a new instance and assign the set some value, then save.
3. Now, try to set the set value to something completely new (e.g., don't just append) and re-save it.

You should get an error like "CassandraCQL::Error::InvalidRequestException: Invalid list literal for labels of type set

". It looks like the problem is that the UPDATE command is issued with square brackets instead of curly. For example, it tries
```
UPDATE google_mail_message_label_history_data SET labels = [] WHERE service_id = 234 AND gm_msg_id = 'abc'
```
when CQL wants
```
UPDATE google_mail_message_label_history_data SET labels = {} WHERE service_id = 234 AND gm_msg_id = 'abc'
```

A bit of a sample repro:
---------
```
datum = GoogleMailMessageLabelHistoryDatum.new(:service_id => service.id, :gm_msg_id => gm_msgid)
datum.labels = ["label1"]
datum.save!

datum.labels = ["clearit"]
datum.save!
```

As a sidenote, this does work if on the second declaration you declare the new label as a Set,
```
datum.labels = Set['clearit']
```