activerecord 3.1.0.rc2 → 3.1.0.rc3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

@@ -141,7 +141,7 @@ module ActiveRecord
141
141
  @target ||= find_target
142
142
  end
143
143
  end
144
- loaded!
144
+ loaded! unless loaded?
145
145
  target
146
146
  rescue ActiveRecord::RecordNotFound
147
147
  reset
@@ -177,9 +177,7 @@ module ActiveRecord
177
177
 
178
178
  # Sets the owner attributes on the given record
179
179
  def set_owner_attributes(record)
180
- if owner.persisted?
181
- creation_attributes.each { |key, value| record[key] = value }
182
- end
180
+ creation_attributes.each { |key, value| record[key] = value }
183
181
  end
184
182
 
185
183
  # Should be true if there is a foreign key present on the owner which
@@ -60,7 +60,7 @@ module ActiveRecord
60
60
 
61
61
  scope = scope.joins(join(
62
62
  join_table,
63
- table[reflection.active_record_primary_key].
63
+ table[reflection.association_primary_key].
64
64
  eq(join_table[reflection.association_foreign_key])
65
65
  ))
66
66
 
@@ -14,8 +14,8 @@ module ActiveRecord
14
14
  end
15
15
 
16
16
  if record
17
- set_inverse_instance(record)
18
17
  set_owner_attributes(record)
18
+ set_inverse_instance(record)
19
19
 
20
20
  if owner.persisted? && save && !record.save
21
21
  nullify_owner_attributes(record)
@@ -338,6 +338,7 @@ db_namespace = namespace :db do
338
338
  task :dump => :load_config do
339
339
  require 'active_record/schema_dumper'
340
340
  File.open(ENV['SCHEMA'] || "#{Rails.root}/db/schema.rb", "w") do |file|
341
+ ActiveRecord::Base.establish_connection(Rails.env)
341
342
  ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, file)
342
343
  end
343
344
  db_namespace['schema:dump'].reenable
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
5
  TINY = 0
6
- PRE = "rc2"
6
+ PRE = "rc3"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424097
4
+ hash: 15424099
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 0
10
10
  - rc
11
- - 2
12
- version: 3.1.0.rc2
11
+ - 3
12
+ version: 3.1.0.rc3
13
13
  platform: ruby
14
14
  authors:
15
15
  - David Heinemeier Hansson
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-06-07 00:00:00 Z
20
+ date: 2011-06-08 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: activesupport
@@ -27,14 +27,14 @@ dependencies:
27
27
  requirements:
28
28
  - - "="
29
29
  - !ruby/object:Gem::Version
30
- hash: 15424097
30
+ hash: 15424099
31
31
  segments:
32
32
  - 3
33
33
  - 1
34
34
  - 0
35
35
  - rc
36
- - 2
37
- version: 3.1.0.rc2
36
+ - 3
37
+ version: 3.1.0.rc3
38
38
  type: :runtime
39
39
  version_requirements: *id001
40
40
  - !ruby/object:Gem::Dependency
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "="
47
47
  - !ruby/object:Gem::Version
48
- hash: 15424097
48
+ hash: 15424099
49
49
  segments:
50
50
  - 3
51
51
  - 1
52
52
  - 0
53
53
  - rc
54
- - 2
55
- version: 3.1.0.rc2
54
+ - 3
55
+ version: 3.1.0.rc3
56
56
  type: :runtime
57
57
  version_requirements: *id002
58
58
  - !ruby/object:Gem::Dependency