returning 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ before_script:
2
+ - "psql -c 'create database returning_test;' -U postgres >/dev/null"
3
+ rvm:
4
+ - 1.8.7
5
+ - 1.9.2
6
+ - rbx
7
+ - rbx-2.0
8
+ - ree
9
+ - jruby
10
+ - ruby-head
11
+ gemfile:
12
+ - Gemfile
13
+ - Gemfile3.1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.0.3 - 2011-08-22
2
+ -----
3
+ * Pass parameters down on save. This makes update_attribute work.
4
+
1
5
  0.0.2 - 2011-08-22
2
6
  -----
3
7
  * Add support for ActiveRecord::ConnectionAdapters::QueryCache
@@ -18,10 +18,10 @@ module Returning
18
18
  def save(options = {})
19
19
  if r = options[:returning]
20
20
  connection.returning(r, self.class) do
21
- super()
21
+ super
22
22
  end
23
23
  else
24
- super()
24
+ super
25
25
  end
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  module Returning
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -28,6 +28,15 @@ describe Returning do
28
28
  PostQueryCache.first.update_attributes :name => 'cached'
29
29
  end
30
30
  end
31
+
32
+ context 'when validate => false specified' do
33
+ it 'passes it further' do
34
+ post = PostWithValidation.first
35
+ post.name = 'validated name'
36
+ post.author = nil
37
+ post.save(:returning => "name", :validate => false).should be_true
38
+ end
39
+ end
31
40
  end
32
41
 
33
42
  describe '#destroy' do
data/spec/support/ar.rb CHANGED
@@ -39,3 +39,8 @@ class PostQueryCache < ActiveRecord::Base
39
39
  set_table_name :posts
40
40
  include ActiveRecord::ConnectionAdapters::QueryCache
41
41
  end
42
+
43
+ class PostWithValidation < ActiveRecord::Base
44
+ set_table_name :posts
45
+ validates_presence_of :author
46
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: returning
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eugene Pimenov
@@ -58,6 +58,7 @@ extra_rdoc_files: []
58
58
 
59
59
  files:
60
60
  - .gitignore
61
+ - .travis.yml
61
62
  - CHANGELOG.md
62
63
  - Gemfile
63
64
  - Gemfile3.1