sessionm-cassandra_object 2.2.35 → 2.2.36

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/testtask'
5
5
 
6
6
  # require File.expand_path('../lib/cassandra_object', __FILE__)
7
7
 
8
- task default: :test
8
+ task :default => :test
9
9
 
10
10
  Rake::TestTask.new(:test) do |t|
11
11
  t.libs << 'lib'
@@ -6,9 +6,11 @@ module CassandraObject
6
6
  # TODO: is this the convention?
7
7
  include ActiveRecord::Reflection
8
8
  include ActiveRecord::Associations
9
+ include ActiveRecord::AutosaveAssociation
9
10
 
10
11
  autoload :OneToMany
11
12
  autoload :OneToOne
13
+ autoload :AutosaveAssociation
12
14
 
13
15
  included do
14
16
  class_inheritable_hash :associations
@@ -96,5 +96,8 @@ module CassandraObject
96
96
  def []=(attr_name, value)
97
97
  write_attribute(attr_name, value)
98
98
  end
99
+
100
+ class_attribute :pluralize_table_names, :instance_writer => false
101
+ self.pluralize_table_names = true
99
102
  end
100
103
  end
@@ -24,9 +24,10 @@ module CassandraObject
24
24
  end
25
25
  end
26
26
 
27
- def valid?
27
+ def valid?(context=nil)
28
+ context ||= (new_record? ? :create : :update)
28
29
  run_callbacks :validation do
29
- super
30
+ super context
30
31
  end
31
32
  end
32
33
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sessionm-cassandra_object'
5
- s.version = '2.2.35'
5
+ s.version = '2.2.36'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
18
18
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
19
  s.require_paths = ['lib']
20
20
 
21
- s.add_runtime_dependency('rails', "~> 3.0")
22
- s.add_runtime_dependency('cassandra', ">= 0.11.3")
21
+ s.add_runtime_dependency('rails', ">= 3.1")
22
+ s.add_runtime_dependency('cassandra', ">= 0.12.1")
23
23
 
24
24
  s.add_development_dependency('bundler', "~> 1.0.0")
25
25
  end
@@ -12,4 +12,15 @@ class CassandraObject::ValidationsTest < CassandraObject::TestCase
12
12
  Issue.reset_callbacks(:validate)
13
13
  end
14
14
  end
15
+
16
+ test 'validates :on' do
17
+ begin
18
+ Issue.validates(:description, :presence => true, :on => :create)
19
+ issue = Issue.create!(:description => 'lol')
20
+ issue.update_attributes! :description => nil
21
+ assert_raise(CassandraObject::RecordInvalid) { Issue.create!(:description => '') }
22
+ ensure
23
+ Issue.reset_callbacks(:validate)
24
+ end
25
+ end
15
26
  end
metadata CHANGED
@@ -1,58 +1,74 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sessionm-cassandra_object
3
- version: !ruby/object:Gem::Version
4
- version: 2.2.35
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 2
8
+ - 36
9
+ version: 2.2.36
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Michael Koziarski
9
13
  - gotime
10
14
  - sessionm
11
15
  autorequire:
12
16
  bindir: bin
13
17
  cert_chain: []
14
- date: 2011-12-16 00:00:00.000000000Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2012-03-02 00:00:00 -05:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
17
23
  name: rails
18
- requirement: &70262730474840 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ~>
22
- - !ruby/object:Gem::Version
23
- version: '3.0'
24
- type: :runtime
25
24
  prerelease: false
26
- version_requirements: *70262730474840
27
- - !ruby/object:Gem::Dependency
28
- name: cassandra
29
- requirement: &70262730474380 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ! '>='
33
- - !ruby/object:Gem::Version
34
- version: 0.11.3
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 3
31
+ - 1
32
+ version: "3.1"
35
33
  type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: cassandra
36
37
  prerelease: false
37
- version_requirements: *70262730474380
38
- - !ruby/object:Gem::Dependency
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ - 12
45
+ - 1
46
+ version: 0.12.1
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
39
50
  name: bundler
40
- requirement: &70262730473920 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ requirements:
43
54
  - - ~>
44
- - !ruby/object:Gem::Version
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 1
58
+ - 0
59
+ - 0
45
60
  version: 1.0.0
46
61
  type: :development
47
- prerelease: false
48
- version_requirements: *70262730473920
62
+ version_requirements: *id003
49
63
  description: Cassandra ActiveModel
50
64
  email: klange@sessionm.com
51
65
  executables: []
66
+
52
67
  extensions: []
53
- extra_rdoc_files:
68
+
69
+ extra_rdoc_files:
54
70
  - README.markdown
55
- files:
71
+ files:
56
72
  - .gitignore
57
73
  - CHANGELOG
58
74
  - Gemfile
@@ -139,31 +155,41 @@ files:
139
155
  - test/types/time_type_test.rb
140
156
  - test/types/utf8_string_type_test.rb
141
157
  - test/validations_test.rb
158
+ has_rdoc: true
142
159
  homepage: http://github.com/sessionm/cassandra_object
143
160
  licenses: []
161
+
144
162
  post_install_message:
145
163
  rdoc_options: []
146
- require_paths:
164
+
165
+ require_paths:
147
166
  - lib
148
- required_ruby_version: !ruby/object:Gem::Requirement
149
- none: false
150
- requirements:
151
- - - ! '>='
152
- - !ruby/object:Gem::Version
167
+ required_ruby_version: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ segments:
172
+ - 1
173
+ - 9
174
+ - 2
153
175
  version: 1.9.2
154
- required_rubygems_version: !ruby/object:Gem::Requirement
155
- none: false
156
- requirements:
157
- - - ! '>='
158
- - !ruby/object:Gem::Version
176
+ required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ segments:
181
+ - 1
182
+ - 3
183
+ - 5
159
184
  version: 1.3.5
160
185
  requirements: []
186
+
161
187
  rubyforge_project:
162
- rubygems_version: 1.8.6
188
+ rubygems_version: 1.3.6
163
189
  signing_key:
164
190
  specification_version: 3
165
191
  summary: Cassandra ActiveModel
166
- test_files:
192
+ test_files:
167
193
  - test/active_model_test.rb
168
194
  - test/base_test.rb
169
195
  - test/batches_test.rb