lib/cassandra_object/scope.rb in gotime-cassandra_object-4.11.6 vs lib/cassandra_object/scope.rb in gotime-cassandra_object-4.12.0

- old
+ new

@@ -5,18 +5,19 @@ module CassandraObject class Scope include Batches, FinderMethods, QueryMethods attr_accessor :klass - attr_accessor :limit_value, :select_values, :where_values + attr_accessor :limit_value, :select_values, :where_values, :id_values def initialize(klass) @klass = klass - @limit_value = nil - @select_values = [] - @where_values = [] + @limit_value = nil + @select_values = [] + @where_values = [] + @id_values = [] end private def scoping @@ -34,12 +35,12 @@ else super end end - def instantiate_from_cql(cql_string) + def select_records results = [] - klass.adapter.select(cql_string) do |key, attributes| + klass.adapter.select(self) do |key, attributes| results << klass.instantiate(key, attributes) end results.compact! results end