gotime-cassandra_object 2.11.5 → 2.11.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -56,7 +56,7 @@ module CassandraObject
|
|
56
56
|
self.attributes = attributes
|
57
57
|
attribute_definitions.each do |attr, attribute_definition|
|
58
58
|
unless attribute_exists?(attr)
|
59
|
-
|
59
|
+
@attributes[attr.to_s] = self.class.typecast_attribute(self, attr, nil)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -1,18 +1,18 @@
|
|
1
1
|
namespace :ks do
|
2
2
|
desc 'Create the keyspace in cassandra_config/cassandra.yml for the current environment'
|
3
|
-
task :
|
3
|
+
task create: :environment do
|
4
4
|
CassandraObject::Tasks::Keyspace.new.create cassandra_config['keyspace'], cassandra_config
|
5
5
|
puts "Created keyspace: #{cassandra_config['keyspace']}"
|
6
6
|
end
|
7
7
|
|
8
8
|
desc 'Drop keyspace in cassandra_config/cassandra.yml for the current environment'
|
9
|
-
task :
|
9
|
+
task drop: :environment do
|
10
10
|
CassandraObject::Tasks::Keyspace.new.drop cassandra_config['keyspace']
|
11
11
|
puts "Dropped keyspace: #{cassandra_config['keyspace']}"
|
12
12
|
end
|
13
13
|
|
14
14
|
desc 'Migrate the keyspace (options: VERSION=x)'
|
15
|
-
task :
|
15
|
+
task migrate: :environment do
|
16
16
|
version = ( ENV['VERSION'] ? ENV['VERSION'].to_i : nil )
|
17
17
|
CassandraObject::Schema::Migrator.migrate CassandraObject::Schema::Migrator.migrations_path, version
|
18
18
|
schema_dump
|
@@ -30,7 +30,7 @@ namespace :ks do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
desc 'Pushes the schema to the next version (specify steps w/ STEP=n)'
|
33
|
-
task :
|
33
|
+
task forward: :environment do
|
34
34
|
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
35
35
|
CassandraObject::Schema::Migrator.forward CassandraObject::Schema::Migrator.migrations_path, step
|
36
36
|
schema_dump
|
@@ -50,7 +50,7 @@ namespace :ks do
|
|
50
50
|
|
51
51
|
namespace :test do
|
52
52
|
desc 'Load the development schema in to the test keyspace'
|
53
|
-
task :
|
53
|
+
task prepare: :environment do
|
54
54
|
schema_dump :development
|
55
55
|
schema_load :test
|
56
56
|
end
|
@@ -20,6 +20,10 @@ class CassandraObject::Types::ArrayTypeTest < CassandraObject::Types::TestCase
|
|
20
20
|
array :favorite_colors, unique: true
|
21
21
|
end
|
22
22
|
|
23
|
+
test 'default' do
|
24
|
+
assert_equal [], TestIssue.new.favorite_colors
|
25
|
+
end
|
26
|
+
|
23
27
|
test 'append marks dirty' do
|
24
28
|
issue = TestIssue.create favorite_colors: []
|
25
29
|
assert !issue.changed?
|