activerecord 3.0.0.beta3 → 3.0.0.beta4

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.

Files changed (51) hide show
  1. data/CHANGELOG +27 -0
  2. data/lib/active_record.rb +5 -1
  3. data/lib/active_record/aggregations.rb +1 -0
  4. data/lib/active_record/association_preload.rb +1 -1
  5. data/lib/active_record/associations.rb +88 -33
  6. data/lib/active_record/associations/association_collection.rb +12 -11
  7. data/lib/active_record/associations/association_proxy.rb +1 -1
  8. data/lib/active_record/attribute_methods.rb +10 -1
  9. data/lib/active_record/attribute_methods/dirty.rb +50 -50
  10. data/lib/active_record/attribute_methods/primary_key.rb +1 -1
  11. data/lib/active_record/autosave_association.rb +20 -5
  12. data/lib/active_record/base.rb +28 -343
  13. data/lib/active_record/callbacks.rb +23 -34
  14. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +1 -1
  15. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +3 -3
  16. data/lib/active_record/connection_adapters/abstract/database_limits.rb +57 -0
  17. data/lib/active_record/connection_adapters/abstract/database_statements.rb +56 -0
  18. data/lib/active_record/connection_adapters/abstract/query_cache.rb +11 -18
  19. data/lib/active_record/connection_adapters/abstract/quoting.rb +3 -7
  20. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +3 -3
  21. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +61 -7
  22. data/lib/active_record/connection_adapters/abstract_adapter.rb +3 -1
  23. data/lib/active_record/connection_adapters/mysql_adapter.rb +22 -50
  24. data/lib/active_record/connection_adapters/postgresql_adapter.rb +31 -143
  25. data/lib/active_record/connection_adapters/sqlite_adapter.rb +6 -2
  26. data/lib/active_record/counter_cache.rb +105 -0
  27. data/lib/active_record/fixtures.rb +16 -15
  28. data/lib/active_record/locale/en.yml +2 -2
  29. data/lib/active_record/locking/optimistic.rb +37 -16
  30. data/lib/active_record/migration.rb +7 -3
  31. data/lib/active_record/named_scope.rb +1 -5
  32. data/lib/active_record/nested_attributes.rb +13 -2
  33. data/lib/active_record/observer.rb +19 -7
  34. data/lib/active_record/persistence.rb +230 -0
  35. data/lib/active_record/railtie.rb +17 -23
  36. data/lib/active_record/railties/databases.rake +3 -2
  37. data/lib/active_record/relation.rb +5 -2
  38. data/lib/active_record/relation/batches.rb +6 -1
  39. data/lib/active_record/relation/calculations.rb +12 -9
  40. data/lib/active_record/relation/finder_methods.rb +14 -10
  41. data/lib/active_record/relation/query_methods.rb +62 -44
  42. data/lib/active_record/relation/spawn_methods.rb +6 -1
  43. data/lib/active_record/schema_dumper.rb +3 -0
  44. data/lib/active_record/serializers/xml_serializer.rb +30 -56
  45. data/lib/active_record/session_store.rb +1 -1
  46. data/lib/active_record/timestamp.rb +22 -26
  47. data/lib/active_record/transactions.rb +168 -50
  48. data/lib/active_record/validations.rb +33 -49
  49. data/lib/active_record/version.rb +1 -1
  50. data/lib/rails/generators/active_record.rb +6 -9
  51. metadata +27 -10
@@ -3,7 +3,7 @@ module ActiveRecord
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
5
  TINY = 0
6
- BUILD = "beta3"
6
+ BUILD = "beta4"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
9
9
  end
@@ -8,21 +8,18 @@ module ActiveRecord
8
8
  class Base < Rails::Generators::NamedBase #:nodoc:
9
9
  include Rails::Generators::Migration
10
10
 
11
- def self.source_root
12
- @_ar_source_root ||= begin
13
- if base_name && generator_name
14
- File.expand_path(File.join(base_name, generator_name, 'templates'), File.dirname(__FILE__))
15
- end
16
- end
11
+ # Set the current directory as base for the inherited generators.
12
+ def self.base_root
13
+ File.dirname(__FILE__)
17
14
  end
18
15
 
19
16
  # Implement the required interface for Rails::Generators::Migration.
20
- #
21
17
  def self.next_migration_number(dirname) #:nodoc:
18
+ next_migration_number = current_migration_number(dirname) + 1
22
19
  if ActiveRecord::Base.timestamped_migrations
23
- Time.now.utc.strftime("%Y%m%d%H%M%S")
20
+ [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
24
21
  else
25
- "%.3d" % (current_migration_number(dirname) + 1)
22
+ "%.3d" % next_migration_number
26
23
  end
27
24
  end
28
25
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 3
7
7
  - 0
8
8
  - 0
9
- - beta3
10
- version: 3.0.0.beta3
9
+ - beta4
10
+ version: 3.0.0.beta4
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Heinemeier Hansson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-13 00:00:00 -07:00
18
+ date: 2010-06-08 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -29,8 +29,8 @@ dependencies:
29
29
  - 3
30
30
  - 0
31
31
  - 0
32
- - beta3
33
- version: 3.0.0.beta3
32
+ - beta4
33
+ version: 3.0.0.beta4
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -44,8 +44,8 @@ dependencies:
44
44
  - 3
45
45
  - 0
46
46
  - 0
47
- - beta3
48
- version: 3.0.0.beta3
47
+ - beta4
48
+ version: 3.0.0.beta4
49
49
  type: :runtime
50
50
  version_requirements: *id002
51
51
  - !ruby/object:Gem::Dependency
@@ -57,11 +57,25 @@ dependencies:
57
57
  - !ruby/object:Gem::Version
58
58
  segments:
59
59
  - 0
60
- - 3
61
- - 3
62
- version: 0.3.3
60
+ - 4
61
+ - 0
62
+ version: 0.4.0
63
63
  type: :runtime
64
64
  version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: tzinfo
67
+ prerelease: false
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 0
74
+ - 3
75
+ - 16
76
+ version: 0.3.16
77
+ type: :runtime
78
+ version_requirements: *id004
65
79
  description: Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.
66
80
  email: david@loudthinking.com
67
81
  executables: []
@@ -102,6 +116,7 @@ files:
102
116
  - lib/active_record/callbacks.rb
103
117
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
104
118
  - lib/active_record/connection_adapters/abstract/connection_specification.rb
119
+ - lib/active_record/connection_adapters/abstract/database_limits.rb
105
120
  - lib/active_record/connection_adapters/abstract/database_statements.rb
106
121
  - lib/active_record/connection_adapters/abstract/query_cache.rb
107
122
  - lib/active_record/connection_adapters/abstract/quoting.rb
@@ -112,6 +127,7 @@ files:
112
127
  - lib/active_record/connection_adapters/postgresql_adapter.rb
113
128
  - lib/active_record/connection_adapters/sqlite3_adapter.rb
114
129
  - lib/active_record/connection_adapters/sqlite_adapter.rb
130
+ - lib/active_record/counter_cache.rb
115
131
  - lib/active_record/dynamic_finder_match.rb
116
132
  - lib/active_record/dynamic_scope_match.rb
117
133
  - lib/active_record/errors.rb
@@ -123,6 +139,7 @@ files:
123
139
  - lib/active_record/named_scope.rb
124
140
  - lib/active_record/nested_attributes.rb
125
141
  - lib/active_record/observer.rb
142
+ - lib/active_record/persistence.rb
126
143
  - lib/active_record/query_cache.rb
127
144
  - lib/active_record/railtie.rb
128
145
  - lib/active_record/railties/controller_runtime.rb