find_or_create_on_scopes 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "find_or_create_on_scopes"
8
- s.version = "1.2.1"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tim Morgan"]
12
- s.date = "2013-01-18"
12
+ s.date = "2013-02-19"
13
13
  s.description = "Adds methods to ActiveRecord for conditionally finding, creating, or updating records."
14
14
  s.email = "git@timothymorgan.info"
15
15
  s.extra_rdoc_files = [
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.homepage = "http://github.com/riscfuture/find_or_create_on_scopes"
26
26
  s.require_paths = ["lib"]
27
27
  s.required_ruby_version = Gem::Requirement.new(">= 1.9")
28
- s.rubygems_version = "1.8.24"
28
+ s.rubygems_version = "1.8.25"
29
29
  s.summary = "find_or_create-type methods on ActiveRecord scopes"
30
30
 
31
31
  if s.respond_to? :specification_version then
@@ -73,7 +73,7 @@ module FindOrCreateOnScopes
73
73
  record = nil
74
74
  transaction do
75
75
  record = first || new(*args)
76
- yield record if block_given?
76
+ yield record if block_given? && record.new_record?
77
77
  record.send(meth) if meth
78
78
  end
79
79
  return record
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.2.1
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-18 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 1.8.24
143
+ rubygems_version: 1.8.25
144
144
  signing_key:
145
145
  specification_version: 3
146
146
  summary: find_or_create-type methods on ActiveRecord scopes