lib/cassandra_object/scope.rb in gotime-cassandra_object-4.11.5 vs lib/cassandra_object/scope.rb in gotime-cassandra_object-4.11.6
- old
+ new
@@ -34,23 +34,15 @@
else
super
end
end
- def instantiate_from_cql(cql_string, *args)
+ def instantiate_from_cql(cql_string)
results = []
- klass.execute_cql(cql_string, *args).fetch do |cql_row|
- results << instantiate_cql_row(cql_row)
+ klass.adapter.select(cql_string) do |key, attributes|
+ results << klass.instantiate(key, attributes)
end
results.compact!
results
- end
-
- def instantiate_cql_row(cql_row)
- attributes = cql_row.to_hash
- key = attributes.delete('KEY')
- if attributes.any?
- klass.instantiate(key, attributes)
- end
end
end
end