Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: umanni/cassilds-model
base: c18a03e41e
...
head fork: umanni/cassilds-model
compare: 9ded04cb56
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 14 additions and 14 deletions.
  1. +14 −14 lib/cassandra-model/types.rb
View
28 lib/cassandra-model/types.rb
@@ -54,18 +54,18 @@ def self.dump(v)
ret = nil
if !v.blank?
case v
- when String
- if v.size == 8
- ret = Cassandra::Long.new(v)
- else
- ret = Cassandra::Long.new(::Time.strptime(v, '%FT%T%z').utc.to_i)
- end
- when Cassandra::Long
- ret =v
- when Time
- ret = Cassandra::Long.new(v.utc.to_i)
- when DateTime
- ret = Cassandra::Long.new(v.to_time.utc.to_i)
+ when String
+ if v.size == 8
+ ret = Cassandra::Long.new(v)
+ else
+ ret = Cassandra::Long.new(::Time.strptime(v, '%FT%T%z').utc.to_i)
+ end
+ when Cassandra::Long
+ ret =v
+ when Time
+ ret = Cassandra::Long.new(v.utc.to_i)
+ when DateTime
+ ret = Cassandra::Long.new(v.to_time.utc.to_i)
end
end
ret
@@ -94,12 +94,12 @@ def self.dump(v)
def self.load(v)
v == '1'
end
-
+
def self.object_to_boolean value
return [true, "true", 1, "1", "T", "t", "Y", "y", "yes"].include?(value.class == String ? value.downcase : value)
end
end
-
+
class TimeuuidType
def self.dump(v)
v && SimpleUUID::UUID.new(v).to_s

No commit comments for this range

Something went wrong with that request. Please try again.