find_or_create_on_scopes 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -1
- data/find_or_create_on_scopes.gemspec +10 -10
- data/lib/find_or_create_on_scopes.rb +10 -0
- metadata +15 -15
data/README.textile
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "1.
|
7
|
+
s.name = "find_or_create_on_scopes"
|
8
|
+
s.version = "1.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
11
|
+
s.authors = ["Tim Morgan"]
|
12
|
+
s.date = "2011-09-13"
|
13
|
+
s.description = "Adds methods to ActiveRecord for conditionally finding, creating, or updating records."
|
14
|
+
s.email = "git@timothymorgan.info"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.textile"
|
@@ -22,11 +22,11 @@ Gem::Specification.new do |s|
|
|
22
22
|
"find_or_create_on_scopes.gemspec",
|
23
23
|
"lib/find_or_create_on_scopes.rb"
|
24
24
|
]
|
25
|
-
s.homepage =
|
26
|
-
s.require_paths = [
|
25
|
+
s.homepage = "http://github.com/riscfuture/find_or_create_on_scopes"
|
26
|
+
s.require_paths = ["lib"]
|
27
27
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9")
|
28
|
-
s.rubygems_version =
|
29
|
-
s.summary =
|
28
|
+
s.rubygems_version = "1.8.10"
|
29
|
+
s.summary = "find_or_create-type methods on ActiveRecord scopes"
|
30
30
|
|
31
31
|
if s.respond_to? :specification_version then
|
32
32
|
s.specification_version = 3
|
@@ -56,6 +56,16 @@ module FindOrCreateOnScopes
|
|
56
56
|
def create_or_update!(*args, &block)
|
57
57
|
create_or_update_and_do :save!, *args, &block
|
58
58
|
end
|
59
|
+
|
60
|
+
# Same as {#create_or_update} but does not save the record. Please note that
|
61
|
+
# unless this method is called in a transaction, you might have a race
|
62
|
+
# condition when trying to save the record.
|
63
|
+
#
|
64
|
+
# @see #create_or_update
|
65
|
+
|
66
|
+
def initialize_or_update(*args, &block)
|
67
|
+
create_or_update_and_do nil, *args, &block
|
68
|
+
end
|
59
69
|
|
60
70
|
private
|
61
71
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_or_create_on_scopes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-
|
12
|
+
date: 2011-09-13 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &2158190380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2158190380
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jeweler
|
27
|
-
requirement: &
|
27
|
+
requirement: &2158189820 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2158189820
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: yard
|
38
|
-
requirement: &
|
38
|
+
requirement: &2158189220 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2158189220
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: RedCloth
|
49
|
-
requirement: &
|
49
|
+
requirement: &2158188660 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2158188660
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: sqlite3
|
60
|
-
requirement: &
|
60
|
+
requirement: &2158188080 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2158188080
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &2158187480 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2158187480
|
80
80
|
description: Adds methods to ActiveRecord for conditionally finding, creating, or
|
81
81
|
updating records.
|
82
82
|
email: git@timothymorgan.info
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 1.8.
|
113
|
+
rubygems_version: 1.8.10
|
114
114
|
signing_key:
|
115
115
|
specification_version: 3
|
116
116
|
summary: find_or_create-type methods on ActiveRecord scopes
|