Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support SimpleUUID::UUID instances as well.

Since CassandraCQL::UUID just inherits from it, we might as well
support the whole family. I've already had a few times where I tried to
insert SimpleUUID::UUID's and it didn't work, which confused me.
  • Loading branch information...
commit 06d2a2a8b286570bcf7f8beff68a80de888d0a83 1 parent 3393c97
@jnunemaker jnunemaker authored
Showing with 9 additions and 1 deletion.
  1. +1 −1  lib/cassandra-cql/statement.rb
  2. +8 −0 spec/statement_spec.rb
2  lib/cassandra-cql/statement.rb
@@ -90,7 +90,7 @@ def self.cast_to_cql(obj)
elsif obj.kind_of?(Time)
(obj.to_f * 1000).to_i
- elsif obj.kind_of?(UUID)
+ elsif obj.kind_of?(SimpleUUID::UUID)
# There are corner cases where this is an invalid assumption but they are extremely rare.
# The alternative is to make the user pack the data on their own .. let's not do that until we have to
8 spec/statement_spec.rb
@@ -130,6 +130,14 @@
+ context "with a SimpleUUID::UUID object" do
+ it "should return the guid" do
+ uuid =
+ guid = Statement.cast_to_cql(uuid)
+ guid.should eq(uuid.to_guid)
+ end
+ end
context "with a String without quotes" do
it "should return a copy of itself" do
str = "This is a string"
Please sign in to comment.
Something went wrong with that request. Please try again.