activerecord 3.0.0 → 4.0.0

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 (181) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +2102 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.rdoc +35 -44
  5. data/examples/performance.rb +110 -100
  6. data/lib/active_record/aggregations.rb +59 -75
  7. data/lib/active_record/associations/alias_tracker.rb +76 -0
  8. data/lib/active_record/associations/association.rb +248 -0
  9. data/lib/active_record/associations/association_scope.rb +135 -0
  10. data/lib/active_record/associations/belongs_to_association.rb +60 -59
  11. data/lib/active_record/associations/belongs_to_polymorphic_association.rb +16 -59
  12. data/lib/active_record/associations/builder/association.rb +108 -0
  13. data/lib/active_record/associations/builder/belongs_to.rb +98 -0
  14. data/lib/active_record/associations/builder/collection_association.rb +89 -0
  15. data/lib/active_record/associations/builder/has_and_belongs_to_many.rb +39 -0
  16. data/lib/active_record/associations/builder/has_many.rb +15 -0
  17. data/lib/active_record/associations/builder/has_one.rb +25 -0
  18. data/lib/active_record/associations/builder/singular_association.rb +32 -0
  19. data/lib/active_record/associations/collection_association.rb +608 -0
  20. data/lib/active_record/associations/collection_proxy.rb +986 -0
  21. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +40 -112
  22. data/lib/active_record/associations/has_many_association.rb +83 -76
  23. data/lib/active_record/associations/has_many_through_association.rb +147 -66
  24. data/lib/active_record/associations/has_one_association.rb +67 -108
  25. data/lib/active_record/associations/has_one_through_association.rb +21 -25
  26. data/lib/active_record/associations/join_dependency/join_association.rb +174 -0
  27. data/lib/active_record/associations/join_dependency/join_base.rb +24 -0
  28. data/lib/active_record/associations/join_dependency/join_part.rb +78 -0
  29. data/lib/active_record/associations/join_dependency.rb +235 -0
  30. data/lib/active_record/associations/join_helper.rb +45 -0
  31. data/lib/active_record/associations/preloader/association.rb +121 -0
  32. data/lib/active_record/associations/preloader/belongs_to.rb +17 -0
  33. data/lib/active_record/associations/preloader/collection_association.rb +24 -0
  34. data/lib/active_record/associations/preloader/has_and_belongs_to_many.rb +60 -0
  35. data/lib/active_record/associations/preloader/has_many.rb +17 -0
  36. data/lib/active_record/associations/preloader/has_many_through.rb +19 -0
  37. data/lib/active_record/associations/preloader/has_one.rb +23 -0
  38. data/lib/active_record/associations/preloader/has_one_through.rb +9 -0
  39. data/lib/active_record/associations/preloader/singular_association.rb +21 -0
  40. data/lib/active_record/associations/preloader/through_association.rb +63 -0
  41. data/lib/active_record/associations/preloader.rb +178 -0
  42. data/lib/active_record/associations/singular_association.rb +64 -0
  43. data/lib/active_record/associations/through_association.rb +87 -0
  44. data/lib/active_record/associations.rb +512 -1224
  45. data/lib/active_record/attribute_assignment.rb +201 -0
  46. data/lib/active_record/attribute_methods/before_type_cast.rb +49 -12
  47. data/lib/active_record/attribute_methods/dirty.rb +51 -28
  48. data/lib/active_record/attribute_methods/primary_key.rb +94 -22
  49. data/lib/active_record/attribute_methods/query.rb +5 -4
  50. data/lib/active_record/attribute_methods/read.rb +63 -72
  51. data/lib/active_record/attribute_methods/serialization.rb +162 -0
  52. data/lib/active_record/attribute_methods/time_zone_conversion.rb +39 -41
  53. data/lib/active_record/attribute_methods/write.rb +39 -13
  54. data/lib/active_record/attribute_methods.rb +362 -29
  55. data/lib/active_record/autosave_association.rb +132 -75
  56. data/lib/active_record/base.rb +83 -1627
  57. data/lib/active_record/callbacks.rb +69 -47
  58. data/lib/active_record/coders/yaml_column.rb +38 -0
  59. data/lib/active_record/connection_adapters/abstract/connection_pool.rb +411 -138
  60. data/lib/active_record/connection_adapters/abstract/database_limits.rb +21 -11
  61. data/lib/active_record/connection_adapters/abstract/database_statements.rb +234 -173
  62. data/lib/active_record/connection_adapters/abstract/query_cache.rb +36 -22
  63. data/lib/active_record/connection_adapters/abstract/quoting.rb +82 -25
  64. data/lib/active_record/connection_adapters/abstract/schema_definitions.rb +176 -414
  65. data/lib/active_record/connection_adapters/abstract/schema_dumper.rb +70 -0
  66. data/lib/active_record/connection_adapters/abstract/schema_statements.rb +562 -232
  67. data/lib/active_record/connection_adapters/abstract/transaction.rb +203 -0
  68. data/lib/active_record/connection_adapters/abstract_adapter.rb +281 -53
  69. data/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +782 -0
  70. data/lib/active_record/connection_adapters/column.rb +318 -0
  71. data/lib/active_record/connection_adapters/connection_specification.rb +96 -0
  72. data/lib/active_record/connection_adapters/mysql2_adapter.rb +273 -0
  73. data/lib/active_record/connection_adapters/mysql_adapter.rb +365 -450
  74. data/lib/active_record/connection_adapters/postgresql/array_parser.rb +97 -0
  75. data/lib/active_record/connection_adapters/postgresql/cast.rb +152 -0
  76. data/lib/active_record/connection_adapters/postgresql/database_statements.rb +242 -0
  77. data/lib/active_record/connection_adapters/postgresql/oid.rb +366 -0
  78. data/lib/active_record/connection_adapters/postgresql/quoting.rb +171 -0
  79. data/lib/active_record/connection_adapters/postgresql/referential_integrity.rb +30 -0
  80. data/lib/active_record/connection_adapters/postgresql/schema_statements.rb +489 -0
  81. data/lib/active_record/connection_adapters/postgresql_adapter.rb +672 -752
  82. data/lib/active_record/connection_adapters/schema_cache.rb +129 -0
  83. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +588 -17
  84. data/lib/active_record/connection_adapters/statement_pool.rb +40 -0
  85. data/lib/active_record/connection_handling.rb +98 -0
  86. data/lib/active_record/core.rb +463 -0
  87. data/lib/active_record/counter_cache.rb +108 -101
  88. data/lib/active_record/dynamic_matchers.rb +131 -0
  89. data/lib/active_record/errors.rb +54 -13
  90. data/lib/active_record/explain.rb +38 -0
  91. data/lib/active_record/explain_registry.rb +30 -0
  92. data/lib/active_record/explain_subscriber.rb +29 -0
  93. data/lib/active_record/fixture_set/file.rb +55 -0
  94. data/lib/active_record/fixtures.rb +703 -785
  95. data/lib/active_record/inheritance.rb +200 -0
  96. data/lib/active_record/integration.rb +60 -0
  97. data/lib/active_record/locale/en.yml +8 -1
  98. data/lib/active_record/locking/optimistic.rb +69 -60
  99. data/lib/active_record/locking/pessimistic.rb +34 -12
  100. data/lib/active_record/log_subscriber.rb +40 -6
  101. data/lib/active_record/migration/command_recorder.rb +164 -0
  102. data/lib/active_record/migration/join_table.rb +15 -0
  103. data/lib/active_record/migration.rb +614 -216
  104. data/lib/active_record/model_schema.rb +345 -0
  105. data/lib/active_record/nested_attributes.rb +248 -119
  106. data/lib/active_record/null_relation.rb +65 -0
  107. data/lib/active_record/persistence.rb +275 -57
  108. data/lib/active_record/query_cache.rb +29 -9
  109. data/lib/active_record/querying.rb +62 -0
  110. data/lib/active_record/railtie.rb +135 -21
  111. data/lib/active_record/railties/console_sandbox.rb +5 -0
  112. data/lib/active_record/railties/controller_runtime.rb +17 -5
  113. data/lib/active_record/railties/databases.rake +249 -359
  114. data/lib/active_record/railties/jdbcmysql_error.rb +16 -0
  115. data/lib/active_record/readonly_attributes.rb +30 -0
  116. data/lib/active_record/reflection.rb +283 -103
  117. data/lib/active_record/relation/batches.rb +38 -34
  118. data/lib/active_record/relation/calculations.rb +252 -139
  119. data/lib/active_record/relation/delegation.rb +125 -0
  120. data/lib/active_record/relation/finder_methods.rb +182 -188
  121. data/lib/active_record/relation/merger.rb +161 -0
  122. data/lib/active_record/relation/predicate_builder.rb +86 -21
  123. data/lib/active_record/relation/query_methods.rb +917 -134
  124. data/lib/active_record/relation/spawn_methods.rb +53 -92
  125. data/lib/active_record/relation.rb +405 -143
  126. data/lib/active_record/result.rb +67 -0
  127. data/lib/active_record/runtime_registry.rb +17 -0
  128. data/lib/active_record/sanitization.rb +168 -0
  129. data/lib/active_record/schema.rb +20 -14
  130. data/lib/active_record/schema_dumper.rb +55 -46
  131. data/lib/active_record/schema_migration.rb +39 -0
  132. data/lib/active_record/scoping/default.rb +146 -0
  133. data/lib/active_record/scoping/named.rb +175 -0
  134. data/lib/active_record/scoping.rb +82 -0
  135. data/lib/active_record/serialization.rb +8 -46
  136. data/lib/active_record/serializers/xml_serializer.rb +21 -68
  137. data/lib/active_record/statement_cache.rb +26 -0
  138. data/lib/active_record/store.rb +156 -0
  139. data/lib/active_record/tasks/database_tasks.rb +203 -0
  140. data/lib/active_record/tasks/firebird_database_tasks.rb +56 -0
  141. data/lib/active_record/tasks/mysql_database_tasks.rb +143 -0
  142. data/lib/active_record/tasks/oracle_database_tasks.rb +45 -0
  143. data/lib/active_record/tasks/postgresql_database_tasks.rb +90 -0
  144. data/lib/active_record/tasks/sqlite_database_tasks.rb +51 -0
  145. data/lib/active_record/tasks/sqlserver_database_tasks.rb +48 -0
  146. data/lib/active_record/test_case.rb +57 -28
  147. data/lib/active_record/timestamp.rb +49 -18
  148. data/lib/active_record/transactions.rb +106 -63
  149. data/lib/active_record/translation.rb +22 -0
  150. data/lib/active_record/validations/associated.rb +25 -24
  151. data/lib/active_record/validations/presence.rb +65 -0
  152. data/lib/active_record/validations/uniqueness.rb +123 -83
  153. data/lib/active_record/validations.rb +29 -29
  154. data/lib/active_record/version.rb +7 -5
  155. data/lib/active_record.rb +83 -34
  156. data/lib/rails/generators/active_record/migration/migration_generator.rb +46 -9
  157. data/lib/rails/generators/active_record/migration/templates/create_table_migration.rb +19 -0
  158. data/lib/rails/generators/active_record/migration/templates/migration.rb +30 -8
  159. data/lib/rails/generators/active_record/model/model_generator.rb +15 -5
  160. data/lib/rails/generators/active_record/model/templates/model.rb +7 -2
  161. data/lib/rails/generators/active_record/model/templates/module.rb +3 -1
  162. data/lib/rails/generators/active_record.rb +4 -8
  163. metadata +163 -121
  164. data/CHANGELOG +0 -6023
  165. data/examples/associations.png +0 -0
  166. data/lib/active_record/association_preload.rb +0 -403
  167. data/lib/active_record/associations/association_collection.rb +0 -562
  168. data/lib/active_record/associations/association_proxy.rb +0 -295
  169. data/lib/active_record/associations/through_association_scope.rb +0 -154
  170. data/lib/active_record/connection_adapters/abstract/connection_specification.rb +0 -113
  171. data/lib/active_record/connection_adapters/sqlite_adapter.rb +0 -401
  172. data/lib/active_record/dynamic_finder_match.rb +0 -53
  173. data/lib/active_record/dynamic_scope_match.rb +0 -32
  174. data/lib/active_record/named_scope.rb +0 -138
  175. data/lib/active_record/observer.rb +0 -140
  176. data/lib/active_record/session_store.rb +0 -340
  177. data/lib/rails/generators/active_record/model/templates/migration.rb +0 -16
  178. data/lib/rails/generators/active_record/observer/observer_generator.rb +0 -15
  179. data/lib/rails/generators/active_record/observer/templates/observer.rb +0 -2
  180. data/lib/rails/generators/active_record/session_migration/session_migration_generator.rb +0 -24
  181. data/lib/rails/generators/active_record/session_migration/templates/migration.rb +0 -16
@@ -1,25 +1,62 @@
1
1
  require 'rails/generators/active_record'
2
2
 
3
3
  module ActiveRecord
4
- module Generators
5
- class MigrationGenerator < Base
6
- argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
4
+ module Generators # :nodoc:
5
+ class MigrationGenerator < Base # :nodoc:
6
+ argument :attributes, :type => :array, :default => [], :banner => "field[:type][:index] field[:type][:index]"
7
7
 
8
8
  def create_migration_file
9
9
  set_local_assigns!
10
- migration_template "migration.rb", "db/migrate/#{file_name}.rb"
10
+ validate_file_name!
11
+ migration_template @migration_template, "db/migrate/#{file_name}.rb"
11
12
  end
12
13
 
13
14
  protected
14
- attr_reader :migration_action
15
+ attr_reader :migration_action, :join_tables
15
16
 
16
- def set_local_assigns!
17
- if file_name =~ /^(add|remove)_.*_(?:to|from)_(.*)/
18
- @migration_action = $1
19
- @table_name = $2.pluralize
17
+ def set_local_assigns!
18
+ @migration_template = "migration.rb"
19
+ case file_name
20
+ when /^(add|remove)_.*_(?:to|from)_(.*)/
21
+ @migration_action = $1
22
+ @table_name = $2.pluralize
23
+ when /join_table/
24
+ if attributes.length == 2
25
+ @migration_action = 'join'
26
+ @join_tables = attributes.map(&:plural_name)
27
+
28
+ set_index_names
20
29
  end
30
+ when /^create_(.+)/
31
+ @table_name = $1.pluralize
32
+ @migration_template = "create_table_migration.rb"
21
33
  end
34
+ end
35
+
36
+ def set_index_names
37
+ attributes.each_with_index do |attr, i|
38
+ attr.index_name = [attr, attributes[i - 1]].map{ |a| index_name_for(a) }
39
+ end
40
+ end
22
41
 
42
+ def index_name_for(attribute)
43
+ if attribute.foreign_key?
44
+ attribute.name
45
+ else
46
+ attribute.name.singularize.foreign_key
47
+ end.to_sym
48
+ end
49
+
50
+ private
51
+ def attributes_with_index
52
+ attributes.select { |a| !a.reference? && a.has_index? }
53
+ end
54
+
55
+ def validate_file_name!
56
+ unless file_name =~ /^[_a-z0-9]+$/
57
+ raise IllegalMigrationNameError.new(file_name)
58
+ end
59
+ end
23
60
  end
24
61
  end
25
62
  end
@@ -0,0 +1,19 @@
1
+ class <%= migration_class_name %> < ActiveRecord::Migration
2
+ def change
3
+ create_table :<%= table_name %> do |t|
4
+ <% attributes.each do |attribute| -%>
5
+ <% if attribute.password_digest? -%>
6
+ t.string :password_digest<%= attribute.inject_options %>
7
+ <% else -%>
8
+ t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
9
+ <% end -%>
10
+ <% end -%>
11
+ <% if options[:timestamps] %>
12
+ t.timestamps
13
+ <% end -%>
14
+ end
15
+ <% attributes_with_index.each do |attribute| -%>
16
+ add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
17
+ <% end -%>
18
+ end
19
+ end
@@ -1,17 +1,39 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration
2
- def self.up
2
+ <%- if migration_action == 'add' -%>
3
+ def change
3
4
  <% attributes.each do |attribute| -%>
4
- <%- if migration_action -%>
5
- <%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end %>
5
+ <%- if attribute.reference? -%>
6
+ add_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %>
7
+ <%- else -%>
8
+ add_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
9
+ <%- if attribute.has_index? -%>
10
+ add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
11
+ <%- end -%>
6
12
  <%- end -%>
7
13
  <%- end -%>
8
14
  end
9
-
10
- def self.down
11
- <% attributes.reverse.each do |attribute| -%>
12
- <%- if migration_action -%>
13
- <%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><% end %>
15
+ <%- elsif migration_action == 'join' -%>
16
+ def change
17
+ create_join_table :<%= join_tables.first %>, :<%= join_tables.second %> do |t|
18
+ <%- attributes.each do |attribute| -%>
19
+ <%= '# ' unless attribute.has_index? -%>t.index <%= attribute.index_name %><%= attribute.inject_index_options %>
20
+ <%- end -%>
21
+ end
22
+ end
23
+ <%- else -%>
24
+ def change
25
+ <% attributes.each do |attribute| -%>
26
+ <%- if migration_action -%>
27
+ <%- if attribute.reference? -%>
28
+ remove_reference :<%= table_name %>, :<%= attribute.name %><%= attribute.inject_options %>
29
+ <%- else -%>
30
+ <%- if attribute.has_index? -%>
31
+ remove_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
32
+ <%- end -%>
33
+ remove_column :<%= table_name %>, :<%= attribute.name %>, :<%= attribute.type %><%= attribute.inject_options %>
14
34
  <%- end -%>
35
+ <%- end -%>
15
36
  <%- end -%>
16
37
  end
38
+ <%- end -%>
17
39
  end
@@ -1,19 +1,21 @@
1
1
  require 'rails/generators/active_record'
2
2
 
3
3
  module ActiveRecord
4
- module Generators
5
- class ModelGenerator < Base
6
- argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
4
+ module Generators # :nodoc:
5
+ class ModelGenerator < Base # :nodoc:
6
+ argument :attributes, :type => :array, :default => [], :banner => "field[:type][:index] field[:type][:index]"
7
7
 
8
8
  check_class_collision
9
9
 
10
10
  class_option :migration, :type => :boolean
11
11
  class_option :timestamps, :type => :boolean
12
12
  class_option :parent, :type => :string, :desc => "The parent class for the generated model"
13
+ class_option :indexes, :type => :boolean, :default => true, :desc => "Add indexes for references and belongs_to columns"
13
14
 
14
15
  def create_migration_file
15
16
  return unless options[:migration] && options[:parent].nil?
16
- migration_template "migration.rb", "db/migrate/create_#{table_name}.rb"
17
+ attributes.each { |a| a.attr_options.delete(:index) if a.reference? && !a.has_index? } if options[:indexes] == false
18
+ migration_template "../../migration/templates/create_table_migration.rb", "db/migrate/create_#{table_name}.rb"
17
19
  end
18
20
 
19
21
  def create_model_file
@@ -21,10 +23,18 @@ module ActiveRecord
21
23
  end
22
24
 
23
25
  def create_module_file
24
- return if class_path.empty?
26
+ return if regular_class_path.empty?
25
27
  template 'module.rb', File.join('app/models', "#{class_path.join('/')}.rb") if behavior == :invoke
26
28
  end
27
29
 
30
+ def attributes_with_index
31
+ attributes.select { |a| !a.reference? && a.has_index? }
32
+ end
33
+
34
+ def accessible_attributes
35
+ attributes.reject(&:reference?)
36
+ end
37
+
28
38
  hook_for :test_framework
29
39
 
30
40
  protected
@@ -1,5 +1,10 @@
1
+ <% module_namespacing do -%>
1
2
  class <%= class_name %> < <%= parent_class_name.classify %>
2
- <% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
3
- belongs_to :<%= attribute.name %>
3
+ <% attributes.select(&:reference?).each do |attribute| -%>
4
+ belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %>
5
+ <% end -%>
6
+ <% if attributes.any?(&:password_digest?) -%>
7
+ has_secure_password
4
8
  <% end -%>
5
9
  end
10
+ <% end -%>
@@ -1,5 +1,7 @@
1
+ <% module_namespacing do -%>
1
2
  module <%= class_path.map(&:camelize).join('::') %>
2
3
  def self.table_name_prefix
3
- '<%= class_path.join('_') %>_'
4
+ '<%= namespaced? ? namespaced_class_path.join('_') : class_path.join('_') %>_'
4
5
  end
5
6
  end
7
+ <% end -%>
@@ -4,8 +4,8 @@ require 'rails/generators/active_model'
4
4
  require 'active_record'
5
5
 
6
6
  module ActiveRecord
7
- module Generators
8
- class Base < Rails::Generators::NamedBase #:nodoc:
7
+ module Generators # :nodoc:
8
+ class Base < Rails::Generators::NamedBase # :nodoc:
9
9
  include Rails::Generators::Migration
10
10
 
11
11
  # Set the current directory as base for the inherited generators.
@@ -14,13 +14,9 @@ module ActiveRecord
14
14
  end
15
15
 
16
16
  # Implement the required interface for Rails::Generators::Migration.
17
- def self.next_migration_number(dirname) #:nodoc:
17
+ def self.next_migration_number(dirname)
18
18
  next_migration_number = current_migration_number(dirname) + 1
19
- if ActiveRecord::Base.timestamped_migrations
20
- [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
21
- else
22
- "%.3d" % next_migration_number
23
- end
19
+ ActiveRecord::Migration.next_migration_number(next_migration_number)
24
20
  end
25
21
  end
26
22
  end
metadata CHANGED
@@ -1,224 +1,266 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
- version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease: false
6
- segments:
7
- - 3
8
- - 0
9
- - 0
10
- version: 3.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - David Heinemeier Hansson
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2010-08-29 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2013-06-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: activesupport
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - "="
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 3
32
- - 0
33
- - 0
34
- version: 3.0.0
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.0
35
20
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: activemodel
39
21
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - "="
44
- - !ruby/object:Gem::Version
45
- hash: 7
46
- segments:
47
- - 3
48
- - 0
49
- - 0
50
- version: 3.0.0
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: activemodel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 4.0.0
51
34
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: arel
55
35
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 4.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: arel
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
59
45
  - - ~>
60
- - !ruby/object:Gem::Version
61
- hash: 23
62
- segments:
63
- - 1
64
- - 0
65
- - 0
66
- version: 1.0.0
46
+ - !ruby/object:Gem::Version
47
+ version: 4.0.0
67
48
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: tzinfo
71
49
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 4.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: activerecord-deprecated_finders
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
75
59
  - - ~>
76
- - !ruby/object:Gem::Version
77
- hash: 61
78
- segments:
79
- - 0
80
- - 3
81
- - 23
82
- version: 0.3.23
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.2
83
62
  type: :runtime
84
- version_requirements: *id004
85
- 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.
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.2
69
+ description: Databases on Rails. Build a persistent domain model by mapping database
70
+ tables to Ruby classes. Strong conventions for associations, validations, aggregations,
71
+ migrations, and testing come baked-in.
86
72
  email: david@loudthinking.com
87
73
  executables: []
88
-
89
74
  extensions: []
90
-
91
- extra_rdoc_files:
75
+ extra_rdoc_files:
92
76
  - README.rdoc
93
- files:
94
- - CHANGELOG
77
+ files:
78
+ - CHANGELOG.md
79
+ - MIT-LICENSE
95
80
  - README.rdoc
96
- - examples/associations.png
97
81
  - examples/performance.rb
98
82
  - examples/simple.rb
99
83
  - lib/active_record/aggregations.rb
100
- - lib/active_record/association_preload.rb
101
- - lib/active_record/associations/association_collection.rb
102
- - lib/active_record/associations/association_proxy.rb
84
+ - lib/active_record/associations/alias_tracker.rb
85
+ - lib/active_record/associations/association.rb
86
+ - lib/active_record/associations/association_scope.rb
103
87
  - lib/active_record/associations/belongs_to_association.rb
104
88
  - lib/active_record/associations/belongs_to_polymorphic_association.rb
89
+ - lib/active_record/associations/builder/association.rb
90
+ - lib/active_record/associations/builder/belongs_to.rb
91
+ - lib/active_record/associations/builder/collection_association.rb
92
+ - lib/active_record/associations/builder/has_and_belongs_to_many.rb
93
+ - lib/active_record/associations/builder/has_many.rb
94
+ - lib/active_record/associations/builder/has_one.rb
95
+ - lib/active_record/associations/builder/singular_association.rb
96
+ - lib/active_record/associations/collection_association.rb
97
+ - lib/active_record/associations/collection_proxy.rb
105
98
  - lib/active_record/associations/has_and_belongs_to_many_association.rb
106
99
  - lib/active_record/associations/has_many_association.rb
107
100
  - lib/active_record/associations/has_many_through_association.rb
108
101
  - lib/active_record/associations/has_one_association.rb
109
102
  - lib/active_record/associations/has_one_through_association.rb
110
- - lib/active_record/associations/through_association_scope.rb
103
+ - lib/active_record/associations/join_dependency/join_association.rb
104
+ - lib/active_record/associations/join_dependency/join_base.rb
105
+ - lib/active_record/associations/join_dependency/join_part.rb
106
+ - lib/active_record/associations/join_dependency.rb
107
+ - lib/active_record/associations/join_helper.rb
108
+ - lib/active_record/associations/preloader/association.rb
109
+ - lib/active_record/associations/preloader/belongs_to.rb
110
+ - lib/active_record/associations/preloader/collection_association.rb
111
+ - lib/active_record/associations/preloader/has_and_belongs_to_many.rb
112
+ - lib/active_record/associations/preloader/has_many.rb
113
+ - lib/active_record/associations/preloader/has_many_through.rb
114
+ - lib/active_record/associations/preloader/has_one.rb
115
+ - lib/active_record/associations/preloader/has_one_through.rb
116
+ - lib/active_record/associations/preloader/singular_association.rb
117
+ - lib/active_record/associations/preloader/through_association.rb
118
+ - lib/active_record/associations/preloader.rb
119
+ - lib/active_record/associations/singular_association.rb
120
+ - lib/active_record/associations/through_association.rb
111
121
  - lib/active_record/associations.rb
122
+ - lib/active_record/attribute_assignment.rb
112
123
  - lib/active_record/attribute_methods/before_type_cast.rb
113
124
  - lib/active_record/attribute_methods/dirty.rb
114
125
  - lib/active_record/attribute_methods/primary_key.rb
115
126
  - lib/active_record/attribute_methods/query.rb
116
127
  - lib/active_record/attribute_methods/read.rb
128
+ - lib/active_record/attribute_methods/serialization.rb
117
129
  - lib/active_record/attribute_methods/time_zone_conversion.rb
118
130
  - lib/active_record/attribute_methods/write.rb
119
131
  - lib/active_record/attribute_methods.rb
120
132
  - lib/active_record/autosave_association.rb
121
133
  - lib/active_record/base.rb
122
134
  - lib/active_record/callbacks.rb
135
+ - lib/active_record/coders/yaml_column.rb
123
136
  - lib/active_record/connection_adapters/abstract/connection_pool.rb
124
- - lib/active_record/connection_adapters/abstract/connection_specification.rb
125
137
  - lib/active_record/connection_adapters/abstract/database_limits.rb
126
138
  - lib/active_record/connection_adapters/abstract/database_statements.rb
127
139
  - lib/active_record/connection_adapters/abstract/query_cache.rb
128
140
  - lib/active_record/connection_adapters/abstract/quoting.rb
129
141
  - lib/active_record/connection_adapters/abstract/schema_definitions.rb
142
+ - lib/active_record/connection_adapters/abstract/schema_dumper.rb
130
143
  - lib/active_record/connection_adapters/abstract/schema_statements.rb
144
+ - lib/active_record/connection_adapters/abstract/transaction.rb
131
145
  - lib/active_record/connection_adapters/abstract_adapter.rb
146
+ - lib/active_record/connection_adapters/abstract_mysql_adapter.rb
147
+ - lib/active_record/connection_adapters/column.rb
148
+ - lib/active_record/connection_adapters/connection_specification.rb
149
+ - lib/active_record/connection_adapters/mysql2_adapter.rb
132
150
  - lib/active_record/connection_adapters/mysql_adapter.rb
151
+ - lib/active_record/connection_adapters/postgresql/array_parser.rb
152
+ - lib/active_record/connection_adapters/postgresql/cast.rb
153
+ - lib/active_record/connection_adapters/postgresql/database_statements.rb
154
+ - lib/active_record/connection_adapters/postgresql/oid.rb
155
+ - lib/active_record/connection_adapters/postgresql/quoting.rb
156
+ - lib/active_record/connection_adapters/postgresql/referential_integrity.rb
157
+ - lib/active_record/connection_adapters/postgresql/schema_statements.rb
133
158
  - lib/active_record/connection_adapters/postgresql_adapter.rb
159
+ - lib/active_record/connection_adapters/schema_cache.rb
134
160
  - lib/active_record/connection_adapters/sqlite3_adapter.rb
135
- - lib/active_record/connection_adapters/sqlite_adapter.rb
161
+ - lib/active_record/connection_adapters/statement_pool.rb
162
+ - lib/active_record/connection_handling.rb
163
+ - lib/active_record/core.rb
136
164
  - lib/active_record/counter_cache.rb
137
- - lib/active_record/dynamic_finder_match.rb
138
- - lib/active_record/dynamic_scope_match.rb
165
+ - lib/active_record/dynamic_matchers.rb
139
166
  - lib/active_record/errors.rb
167
+ - lib/active_record/explain.rb
168
+ - lib/active_record/explain_registry.rb
169
+ - lib/active_record/explain_subscriber.rb
170
+ - lib/active_record/fixture_set/file.rb
140
171
  - lib/active_record/fixtures.rb
172
+ - lib/active_record/inheritance.rb
173
+ - lib/active_record/integration.rb
141
174
  - lib/active_record/locale/en.yml
142
175
  - lib/active_record/locking/optimistic.rb
143
176
  - lib/active_record/locking/pessimistic.rb
144
177
  - lib/active_record/log_subscriber.rb
178
+ - lib/active_record/migration/command_recorder.rb
179
+ - lib/active_record/migration/join_table.rb
145
180
  - lib/active_record/migration.rb
146
- - lib/active_record/named_scope.rb
181
+ - lib/active_record/model_schema.rb
147
182
  - lib/active_record/nested_attributes.rb
148
- - lib/active_record/observer.rb
183
+ - lib/active_record/null_relation.rb
149
184
  - lib/active_record/persistence.rb
150
185
  - lib/active_record/query_cache.rb
186
+ - lib/active_record/querying.rb
151
187
  - lib/active_record/railtie.rb
188
+ - lib/active_record/railties/console_sandbox.rb
152
189
  - lib/active_record/railties/controller_runtime.rb
153
190
  - lib/active_record/railties/databases.rake
191
+ - lib/active_record/railties/jdbcmysql_error.rb
192
+ - lib/active_record/readonly_attributes.rb
154
193
  - lib/active_record/reflection.rb
155
194
  - lib/active_record/relation/batches.rb
156
195
  - lib/active_record/relation/calculations.rb
196
+ - lib/active_record/relation/delegation.rb
157
197
  - lib/active_record/relation/finder_methods.rb
198
+ - lib/active_record/relation/merger.rb
158
199
  - lib/active_record/relation/predicate_builder.rb
159
200
  - lib/active_record/relation/query_methods.rb
160
201
  - lib/active_record/relation/spawn_methods.rb
161
202
  - lib/active_record/relation.rb
203
+ - lib/active_record/result.rb
204
+ - lib/active_record/runtime_registry.rb
205
+ - lib/active_record/sanitization.rb
162
206
  - lib/active_record/schema.rb
163
207
  - lib/active_record/schema_dumper.rb
208
+ - lib/active_record/schema_migration.rb
209
+ - lib/active_record/scoping/default.rb
210
+ - lib/active_record/scoping/named.rb
211
+ - lib/active_record/scoping.rb
164
212
  - lib/active_record/serialization.rb
165
213
  - lib/active_record/serializers/xml_serializer.rb
166
- - lib/active_record/session_store.rb
214
+ - lib/active_record/statement_cache.rb
215
+ - lib/active_record/store.rb
216
+ - lib/active_record/tasks/database_tasks.rb
217
+ - lib/active_record/tasks/firebird_database_tasks.rb
218
+ - lib/active_record/tasks/mysql_database_tasks.rb
219
+ - lib/active_record/tasks/oracle_database_tasks.rb
220
+ - lib/active_record/tasks/postgresql_database_tasks.rb
221
+ - lib/active_record/tasks/sqlite_database_tasks.rb
222
+ - lib/active_record/tasks/sqlserver_database_tasks.rb
167
223
  - lib/active_record/test_case.rb
168
224
  - lib/active_record/timestamp.rb
169
225
  - lib/active_record/transactions.rb
226
+ - lib/active_record/translation.rb
170
227
  - lib/active_record/validations/associated.rb
228
+ - lib/active_record/validations/presence.rb
171
229
  - lib/active_record/validations/uniqueness.rb
172
230
  - lib/active_record/validations.rb
173
231
  - lib/active_record/version.rb
174
232
  - lib/active_record.rb
175
233
  - lib/rails/generators/active_record/migration/migration_generator.rb
234
+ - lib/rails/generators/active_record/migration/templates/create_table_migration.rb
176
235
  - lib/rails/generators/active_record/migration/templates/migration.rb
177
236
  - lib/rails/generators/active_record/model/model_generator.rb
178
- - lib/rails/generators/active_record/model/templates/migration.rb
179
237
  - lib/rails/generators/active_record/model/templates/model.rb
180
238
  - lib/rails/generators/active_record/model/templates/module.rb
181
- - lib/rails/generators/active_record/observer/observer_generator.rb
182
- - lib/rails/generators/active_record/observer/templates/observer.rb
183
- - lib/rails/generators/active_record/session_migration/session_migration_generator.rb
184
- - lib/rails/generators/active_record/session_migration/templates/migration.rb
185
239
  - lib/rails/generators/active_record.rb
186
- has_rdoc: true
187
240
  homepage: http://www.rubyonrails.org
188
- licenses: []
189
-
241
+ licenses:
242
+ - MIT
243
+ metadata: {}
190
244
  post_install_message:
191
- rdoc_options:
245
+ rdoc_options:
192
246
  - --main
193
247
  - README.rdoc
194
- require_paths:
248
+ require_paths:
195
249
  - lib
196
- required_ruby_version: !ruby/object:Gem::Requirement
197
- none: false
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- hash: 57
202
- segments:
203
- - 1
204
- - 8
205
- - 7
206
- version: 1.8.7
207
- required_rubygems_version: !ruby/object:Gem::Requirement
208
- none: false
209
- requirements:
210
- - - ">="
211
- - !ruby/object:Gem::Version
212
- hash: 3
213
- segments:
214
- - 0
215
- version: "0"
250
+ required_ruby_version: !ruby/object:Gem::Requirement
251
+ requirements:
252
+ - - '>='
253
+ - !ruby/object:Gem::Version
254
+ version: 1.9.3
255
+ required_rubygems_version: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - '>='
258
+ - !ruby/object:Gem::Version
259
+ version: '0'
216
260
  requirements: []
217
-
218
- rubyforge_project: activerecord
219
- rubygems_version: 1.3.7
261
+ rubyforge_project:
262
+ rubygems_version: 2.0.2
220
263
  signing_key:
221
- specification_version: 3
264
+ specification_version: 4
222
265
  summary: Object-relational mapper framework (part of Rails).
223
266
  test_files: []
224
-