radiant 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +105 -3
- data/CONTRIBUTORS +29 -0
- data/INSTALL +4 -2
- data/LICENSE +1 -1
- data/README +4 -0
- data/app/controllers/admin/abstract_model_controller.rb +4 -0
- data/app/controllers/admin/extensions_controller.rb +5 -0
- data/app/controllers/admin/layouts_controller.rb +6 -0
- data/app/controllers/admin/page_parts_controller.rb +9 -0
- data/app/controllers/admin/pages_controller.rb +56 -0
- data/app/controllers/admin/preferences_controller.rb +46 -0
- data/app/controllers/admin/references_controller.rb +7 -0
- data/app/controllers/admin/resource_controller.rb +180 -0
- data/app/controllers/admin/snippets_controller.rb +2 -0
- data/app/controllers/admin/users_controller.rb +21 -0
- data/app/controllers/admin/welcome_controller.rb +1 -1
- data/app/controllers/application.rb +7 -3
- data/app/controllers/site_controller.rb +0 -7
- data/app/helpers/admin/extensions_helper.rb +2 -0
- data/app/helpers/admin/layouts_helper.rb +2 -0
- data/app/helpers/admin/pages_helper.rb +59 -0
- data/app/helpers/admin/preferences_helper.rb +2 -0
- data/app/helpers/admin/references_helper.rb +42 -0
- data/app/helpers/admin/snippets_helper.rb +2 -0
- data/app/helpers/admin/users_helper.rb +8 -0
- data/app/helpers/application_helper.rb +12 -8
- data/app/models/page.rb +33 -3
- data/app/models/page_part.rb +5 -1
- data/app/models/radiant/config.rb +3 -3
- data/app/models/response_cache.rb +20 -12
- data/app/models/standard_tags.rb +285 -180
- data/app/models/user.rb +5 -1
- data/app/views/admin/extensions/index.html.haml +40 -0
- data/app/views/admin/layouts/_form.html.haml +36 -0
- data/app/views/admin/layouts/edit.html.haml +7 -0
- data/app/views/admin/layouts/index.html.haml +34 -0
- data/app/views/admin/layouts/new.html.haml +5 -0
- data/app/views/admin/layouts/remove.html.haml +16 -0
- data/app/views/admin/page_parts/_page_part.html.haml +15 -0
- data/app/views/admin/pages/_edit_styles.html.haml +15 -0
- data/app/views/admin/pages/_fields.html.haml +60 -0
- data/app/views/admin/pages/_meta_row.html.haml +6 -0
- data/app/views/admin/pages/_node.html.haml +25 -0
- data/app/views/admin/pages/_popups.html.haml +30 -0
- data/app/views/admin/pages/children.html.haml +2 -0
- data/app/views/admin/pages/edit.html.haml +9 -0
- data/app/views/admin/pages/index.html.haml +28 -0
- data/app/views/admin/pages/new.html.haml +9 -0
- data/app/views/admin/pages/remove.html.haml +21 -0
- data/app/views/admin/preferences/edit.html.haml +36 -0
- data/app/views/admin/references/_tag_reference.haml +3 -0
- data/app/views/admin/references/filters.js.erb +5 -0
- data/app/views/admin/references/tags.js.erb +5 -0
- data/app/views/admin/snippets/_form.html.haml +29 -0
- data/app/views/admin/snippets/edit.html.haml +5 -0
- data/app/views/admin/snippets/index.html.haml +30 -0
- data/app/views/admin/snippets/new.html.haml +5 -0
- data/app/views/admin/snippets/remove.html.haml +19 -0
- data/app/views/admin/users/_form.html.haml +74 -0
- data/app/views/admin/users/edit.html.haml +5 -0
- data/app/views/admin/users/index.html.haml +35 -0
- data/app/views/admin/users/new.html.haml +5 -0
- data/app/views/admin/users/remove.html.haml +18 -0
- data/app/views/layouts/application.html.haml +5 -5
- data/config/boot.rb +24 -7
- data/config/environment.rb +7 -3
- data/config/environments/development.rb +0 -1
- data/config/environments/test.rb +1 -5
- data/config/routes.rb +21 -49
- data/db/migrate/20081203140407_add_indexes.rb +19 -0
- data/db/schema.rb +10 -3
- data/db/templates/roasters.yml +1210 -0
- data/lib/generators/extension/templates/extension.rb +4 -2
- data/lib/generators/extension/templates/spec_helper.rb +2 -3
- data/lib/generators/extension/templates/tasks.rake +1 -1
- data/lib/generators/extension_controller/extension_controller_generator.rb +11 -3
- data/lib/generators/extension_controller/templates/controller.rb +0 -4
- data/lib/generators/extension_controller/templates/functional_test.rb +1 -7
- data/lib/generators/extension_controller/templates/{view.rhtml → view.html.erb} +0 -0
- data/lib/generators/extension_mailer/USAGE +17 -0
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +68 -0
- data/lib/generators/extension_mailer/templates/fixture.erb +3 -0
- data/lib/generators/extension_mailer/templates/mailer.rb +15 -0
- data/lib/generators/extension_mailer/templates/unit_test.rb +21 -0
- data/lib/generators/extension_mailer/templates/view.erb +3 -0
- data/lib/generators/extension_migration/USAGE +34 -0
- data/lib/generators/extension_migration/extension_migration_generator.rb +25 -0
- data/lib/generators/extension_migration/templates/migration.rb +11 -0
- data/lib/generators/extension_model/extension_model_generator.rb +10 -2
- data/lib/generators/extension_model/templates/fixtures.yml +11 -3
- data/lib/generators/extension_model/templates/migration.rb +4 -1
- data/lib/generators/extension_model/templates/unit_test.rb +2 -4
- data/lib/generators/generator_base_extension.rb +0 -7
- data/lib/generators/instance/templates/instance_boot.rb +27 -7
- data/lib/generators/instance/templates/instance_environment.rb +1 -2
- data/lib/generators/instance/templates/instance_generate +2 -0
- data/lib/local_time.rb +2 -2
- data/lib/login_system.rb +18 -31
- data/lib/plugins/active_record_extensions/lib/active_record_extensions.rb +30 -1
- data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +1 -1
- data/lib/plugins/string_extensions/lib/string_extensions.rb +7 -0
- data/lib/radiant.rb +2 -2
- data/lib/radiant/admin_ui.rb +41 -3
- data/lib/radiant/compat.rb +10 -0
- data/lib/radiant/extension.rb +9 -10
- data/lib/radiant/extension/script.rb +103 -7
- data/lib/radiant/extension_loader.rb +1 -1
- data/lib/radiant/extension_migrator.rb +77 -38
- data/lib/radiant/initializer.rb +13 -1
- data/lib/radiant/legacy_routes.rb +72 -0
- data/lib/radiant/resource_responses.rb +115 -0
- data/lib/radiant/taggable.rb +17 -0
- data/lib/tasks/database.rake +0 -42
- data/lib/tasks/extensions.rake +1 -23
- data/lib/tasks/framework.rake +3 -1
- data/lib/tasks/instance.rake +7 -10
- data/lib/tasks/release.rake +22 -8
- data/lib/tasks/rspec.rake +173 -0
- data/lib/tasks/undefine.rake +1 -1
- data/public/javascripts/admin/admin.js +14 -16
- data/public/javascripts/admin/sitemap.js +1 -1
- data/public/javascripts/controls.js +4 -6
- data/public/javascripts/dragdrop.js +1 -3
- data/public/javascripts/effects.js +1 -3
- data/public/javascripts/prototype.js +132 -91
- data/public/stylesheets/admin/main.css +13 -1
- data/script/autospec +5 -0
- data/script/dbconsole +3 -0
- data/script/generate +2 -2
- data/script/performance/request +3 -0
- data/script/spec +3 -10
- data/script/spec_server +22 -5
- data/spec/controllers/admin/export_controller_spec.rb +1 -1
- data/spec/controllers/admin/extensions_controller_spec.rb +21 -0
- data/spec/controllers/admin/layouts_controller_spec.rb +56 -0
- data/spec/controllers/admin/pages_controller_spec.rb +187 -0
- data/spec/controllers/admin/preferences_controller_spec.rb +38 -0
- data/spec/controllers/admin/references_controller_spec.rb +15 -0
- data/spec/controllers/admin/snippets_controller_spec.rb +51 -0
- data/spec/controllers/admin/users_controller_spec.rb +48 -0
- data/spec/controllers/admin/welcome_controller_spec.rb +2 -2
- data/spec/controllers/application_controller_spec.rb +7 -3
- data/spec/controllers/site_controller_spec.rb +5 -38
- data/spec/datasets/file_not_found_dataset.rb +22 -0
- data/spec/datasets/home_page_dataset.rb +64 -0
- data/spec/datasets/layouts_dataset.rb +58 -0
- data/spec/datasets/markup_pages_dataset.rb +13 -0
- data/spec/datasets/pages_dataset.rb +56 -0
- data/spec/datasets/pages_with_layouts_dataset.rb +10 -0
- data/spec/datasets/snippets_dataset.rb +38 -0
- data/spec/datasets/users_and_pages_dataset.rb +9 -0
- data/spec/datasets/users_dataset.rb +43 -0
- data/spec/fixtures/example_extension/README +3 -0
- data/spec/fixtures/example_extension/Rakefile +120 -0
- data/spec/fixtures/example_extension/example_extension.rb +21 -0
- data/spec/fixtures/example_extension/lib/tasks/example_extension_tasks.rake +28 -0
- data/spec/fixtures/example_extension/spec/spec.opts +6 -0
- data/spec/fixtures/example_extension/spec/spec_helper.rb +36 -0
- data/spec/generators/extension_controller_generator_spec.rb +85 -0
- data/spec/generators/extension_generator_spec.rb +172 -0
- data/spec/generators/extension_generators_spec_helper.rb +139 -0
- data/spec/generators/extension_mailer_generator_spec.rb +60 -0
- data/spec/generators/extension_migration_generator_spec.rb +21 -0
- data/spec/generators/extension_model_generator_spec.rb +61 -0
- data/spec/helpers/admin/extensions_helper_spec.rb +4 -0
- data/spec/helpers/admin/layouts_helper_spec.rb +4 -0
- data/spec/helpers/admin/node_helper_spec.rb +33 -31
- data/spec/helpers/admin/pages_helper_spec.rb +63 -0
- data/spec/helpers/admin/preferences_helper_spec.rb +11 -0
- data/spec/helpers/admin/regions_helper_spec.rb +16 -13
- data/spec/helpers/admin/snippets_helper_spec.rb +4 -0
- data/spec/helpers/admin/users_helper_spec.rb +11 -0
- data/spec/helpers/application_helper_spec.rb +75 -61
- data/spec/integration/admin/content_negotiation_spec.rb +27 -0
- data/spec/integration/admin/pages_integration_spec.rb +118 -0
- data/spec/integration/admin/permission_integration_spec.rb +24 -0
- data/spec/integration/admin/snippets_integration_spec.rb +73 -0
- data/spec/integration/admin/user_management_integration_spec.rb +80 -0
- data/spec/integration/admin/user_preferences_integration_spec.rb +19 -0
- data/spec/integration/page_serving_spec.rb +37 -0
- data/spec/lib/autotest_spec.rb +1 -1
- data/spec/lib/core_ext/string_ext_spec.rb +10 -0
- data/spec/lib/login_system_spec.rb +143 -135
- data/spec/lib/radiant/admin_ui_spec.rb +33 -1
- data/spec/lib/radiant/extension/script_spec.rb +111 -4
- data/spec/lib/radiant/extension_migrator_spec.rb +31 -2
- data/spec/lib/radiant/extension_spec.rb +5 -1
- data/spec/lib/radiant/legacy_routes_spec.rb +14 -0
- data/spec/lib/radiant/resource_responses_spec.rb +207 -0
- data/spec/lib/radiant/taggable_spec.rb +38 -2
- data/{vendor/plugins/rspec/spec → spec/matchers}/autotest_matchers.rb +0 -0
- data/spec/matchers/generator_matchers.rb +237 -0
- data/spec/matchers/login_system_matcher.rb +1 -1
- data/spec/matchers/render_form_errors_matcher.rb +62 -0
- data/spec/matchers/render_matcher.rb +2 -2
- data/spec/models/file_not_found_page_spec.rb +1 -1
- data/spec/models/layout_spec.rb +1 -1
- data/spec/models/page_context_spec.rb +2 -4
- data/spec/models/page_part_spec.rb +24 -4
- data/spec/models/page_spec.rb +162 -110
- data/spec/models/radiant/exporter_spec.rb +1 -1
- data/spec/models/response_cache_spec.rb +28 -1
- data/spec/models/snippet_spec.rb +1 -1
- data/spec/models/standard_tags_spec.rb +52 -8
- data/spec/models/user_action_observer_spec.rb +1 -1
- data/spec/models/user_spec.rb +3 -3
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +45 -2
- data/test/fixtures/extensions/01_basic/basic_extension.rb +1 -1
- data/test/fixtures/extensions/01_basic/db/migrate/200812131420_create_initial_schema.rb +10 -0
- data/test/fixtures/extensions/01_basic/db/migrate/200812131421_modify_initial_schema.rb +10 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/01_first.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/02_second.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/03_pending.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/04_dont_run.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/upgrading_extension.rb +2 -0
- data/test/fixtures/extensions/special_characters/db/migrate/001_create_initial_schema.rb +10 -0
- data/test/fixtures/extensions/special_characters/special_characters_extension.rb +3 -0
- data/test/helpers/page_test_helper.rb +3 -1
- data/vendor/extensions/archive/spec/datasets/archive_dataset.rb +51 -0
- data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/spec_helper.rb +2 -3
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +5 -4
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +33 -0
- data/vendor/extensions/markdown_filter/lib/smarty_pants_filter.rb +0 -2
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +18 -1
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +11 -4
- data/vendor/extensions/markdown_filter/spec/models/smarty_pants_filter_spec.rb +8 -1
- data/vendor/extensions/markdown_filter/spec/spec_helper.rb +2 -3
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/CHANGES +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/LICENSE +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/README +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/bin/bluecloth +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/install.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/lib/bluecloth.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/test.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/00_Class.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/05_Markdown.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/10_Bug.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/15_Contrib.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/bctestcase.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/antsugar.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/ml-announce.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/re-overflow.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/re-overflow2.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/utils.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/README +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/Rakefile +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/install.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/rubypants.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/test_rubypants.rb +0 -0
- data/vendor/extensions/textile_filter/lib/textile_filter.rb +0 -2
- data/vendor/extensions/textile_filter/lib/textile_tags.rb +24 -0
- data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +9 -1
- data/vendor/extensions/textile_filter/spec/spec_helper.rb +2 -3
- data/vendor/extensions/textile_filter/textile_filter_extension.rb +3 -2
- data/vendor/plugins/dataset/History.txt +9 -0
- data/vendor/plugins/dataset/LICENSE +19 -0
- data/vendor/plugins/dataset/Manifest.txt +21 -0
- data/vendor/plugins/dataset/README.txt +111 -0
- data/vendor/plugins/dataset/Rakefile +20 -0
- data/vendor/plugins/dataset/TODO +19 -0
- data/vendor/plugins/dataset/lib/dataset.rb +123 -0
- data/vendor/plugins/dataset/lib/dataset/base.rb +157 -0
- data/vendor/plugins/dataset/lib/dataset/collection.rb +19 -0
- data/vendor/plugins/dataset/lib/dataset/database/base.rb +30 -0
- data/vendor/plugins/dataset/lib/dataset/database/mysql.rb +34 -0
- data/vendor/plugins/dataset/lib/dataset/database/postgresql.rb +34 -0
- data/vendor/plugins/dataset/lib/dataset/database/sqlite3.rb +32 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/rspec.rb +21 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/test_unit.rb +60 -0
- data/vendor/plugins/dataset/lib/dataset/instance_methods.rb +10 -0
- data/vendor/plugins/dataset/lib/dataset/load.rb +47 -0
- data/vendor/plugins/dataset/lib/dataset/record/fixture.rb +54 -0
- data/vendor/plugins/dataset/lib/dataset/record/meta.rb +42 -0
- data/vendor/plugins/dataset/lib/dataset/record/model.rb +41 -0
- data/vendor/plugins/dataset/lib/dataset/resolver.rb +110 -0
- data/vendor/plugins/dataset/lib/dataset/session.rb +51 -0
- data/vendor/plugins/dataset/lib/dataset/session_binding.rb +299 -0
- data/vendor/plugins/dataset/lib/dataset/version.rb +9 -0
- data/vendor/plugins/dataset/spec/dataset/database/base_spec.rb +21 -0
- data/vendor/plugins/dataset/spec/dataset/resolver_spec.rb +110 -0
- data/vendor/plugins/dataset/spec/dataset/rspec_spec.rb +137 -0
- data/vendor/plugins/dataset/spec/dataset/session_binding_spec.rb +160 -0
- data/vendor/plugins/dataset/spec/dataset/session_spec.rb +299 -0
- data/vendor/plugins/dataset/spec/dataset/test_unit_spec.rb +209 -0
- data/vendor/plugins/{rspec/spec/spec/runner/empty_file.txt → dataset/spec/fixtures/datasets/constant_not_defined.rb} +0 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/ending_with_dataset.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/exact_name.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/not_a_dataset_base.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/more_datasets/in_another_directory.rb +2 -0
- data/vendor/plugins/dataset/spec/models.rb +6 -0
- data/vendor/plugins/dataset/spec/schema.rb +24 -0
- data/vendor/plugins/{scenarios → dataset}/spec/spec.opts +0 -0
- data/vendor/plugins/dataset/spec/spec_helper.rb +49 -0
- data/vendor/plugins/dataset/tasks/dataset.rake +19 -0
- data/vendor/plugins/{scenarios → spec_integration}/LICENSE +0 -0
- data/vendor/plugins/spec_integration/README +117 -0
- data/vendor/plugins/spec_integration/Rakefile +10 -0
- data/vendor/plugins/spec_integration/lib/spec/integration.rb +10 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl.rb +11 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/form.rb +157 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/integration_example_group.rb +97 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/navigation.rb +102 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions.rb +8 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/action_controller.rb +25 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/hash.rb +48 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers.rb +1 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/display_object.rb +41 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/have_link_to.rb +35 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/navigate_successfully.rb +60 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/showing.rb +44 -0
- data/vendor/plugins/spec_integration/spec/application.rb +3 -0
- data/vendor/plugins/spec_integration/spec/dispatcher.rb +24 -0
- data/vendor/plugins/spec_integration/spec/dsl/form_spec.rb +130 -0
- data/vendor/plugins/spec_integration/spec/dsl/integration_spec_spec.rb +38 -0
- data/vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb +35 -0
- data/vendor/plugins/spec_integration/spec/integration_dsl_controller.rb +5 -0
- data/vendor/plugins/spec_integration/spec/spec.opts +7 -0
- data/vendor/plugins/spec_integration/spec/spec_helper.rb +10 -0
- data/vendor/plugins/spec_integration/tasks/integration.rake +14 -0
- data/vendor/plugins/vizres/CHANGELOG +15 -0
- data/vendor/plugins/vizres/MIT-LICENSE +16 -0
- data/vendor/plugins/vizres/README +80 -0
- data/vendor/plugins/vizres/Rakefile +22 -0
- data/vendor/plugins/vizres/init.rb +1 -0
- data/vendor/plugins/vizres/lib/vizres.rb +33 -0
- data/vendor/plugins/vizres/lib/vizres/browser.rb +36 -0
- data/vendor/plugins/vizres/lib/vizres/scm.rb +27 -0
- data/vendor/plugins/vizres/test/vizres/browser_test.rb +76 -0
- data/vendor/plugins/vizres/test/vizres/scm_test.rb +41 -0
- data/vendor/plugins/vizres/test/vizres_test.rb +55 -0
- data/vendor/plugins/vizres/vizres.gemspec +26 -0
- data/vendor/rails/actionmailer/CHANGELOG +21 -0
- data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
- data/vendor/rails/actionmailer/README +14 -10
- data/vendor/rails/actionmailer/Rakefile +8 -4
- data/vendor/rails/actionmailer/lib/action_mailer.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +145 -101
- data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +7 -7
- data/vendor/rails/actionmailer/lib/action_mailer/part.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +3 -1
- data/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +15 -10
- data/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb +5 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +426 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +46 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb +46 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb +41 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb +63 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb +581 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb +960 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +9 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb +1130 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb +578 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb +495 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +6 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb +248 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb +132 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +1476 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.1.0 → tmail-1.2.3}/tmail/port.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb +118 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +58 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb +49 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb +261 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb +280 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb +337 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb +39 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/test/abstract_unit.rb +13 -6
- data/vendor/rails/actionmailer/test/delivery_method_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_helper_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_render_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_service_test.rb +50 -10
- data/vendor/rails/actionmailer/test/quoting_test.rb +19 -32
- data/vendor/rails/actionmailer/test/test_helper_test.rb +14 -2
- data/vendor/rails/actionmailer/test/tmail_test.rb +1 -1
- data/vendor/rails/actionmailer/test/url_test.rb +2 -2
- data/vendor/rails/actionpack/CHANGELOG +216 -0
- data/vendor/rails/actionpack/MIT-LICENSE +1 -1
- data/vendor/rails/actionpack/README +1 -1
- data/vendor/rails/actionpack/Rakefile +13 -8
- data/vendor/rails/actionpack/lib/action_controller.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +8 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +8 -5
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +56 -73
- data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/base.rb +115 -136
- data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +41 -652
- data/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +144 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +138 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/pages.rb +154 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb +18 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +97 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +28 -24
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +6 -4
- data/vendor/rails/actionpack/lib/action_controller/components.rb +7 -6
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +31 -19
- data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +51 -84
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +294 -419
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +1 -6
- data/vendor/rails/actionpack/lib/action_controller/headers.rb +31 -0
- data/vendor/rails/actionpack/lib/action_controller/helpers.rb +26 -9
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +3 -5
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +68 -15
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +38 -54
- data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +7 -3
- data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +26 -7
- data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +123 -20
- data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +30 -17
- data/vendor/rails/actionpack/lib/action_controller/request.rb +79 -45
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +48 -40
- data/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +44 -13
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +24 -24
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +66 -23
- data/vendor/rails/actionpack/lib/action_controller/response.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +120 -1232
- data/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +203 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/optimisations.rb +120 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb +162 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route.rb +240 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +436 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/routing_ext.rb +46 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +283 -0
- data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +18 -14
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +22 -20
- data/vendor/rails/actionpack/lib/action_controller/session_management.rb +10 -3
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +45 -31
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +5 -5
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +41 -11
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +46 -40
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +44 -37
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +73 -57
- data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view.rb +11 -3
- data/vendor/rails/actionpack/lib/action_view/base.rb +86 -381
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +84 -63
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +126 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +50 -18
- data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +5 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +3 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +1 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +107 -85
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +156 -78
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +57 -24
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +47 -21
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +4 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +11 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +69 -37
- data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +23 -17
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +86 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +4 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +153 -125
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +90 -41
- data/vendor/rails/actionpack/lib/action_view/inline_template.rb +20 -0
- data/vendor/rails/actionpack/lib/action_view/partial_template.rb +70 -0
- data/vendor/rails/actionpack/lib/action_view/partials.rb +31 -73
- data/vendor/rails/actionpack/lib/action_view/template.rb +127 -0
- data/vendor/rails/actionpack/lib/action_view/template_error.rb +18 -10
- data/vendor/rails/actionpack/lib/action_view/template_finder.rb +177 -0
- data/vendor/rails/actionpack/lib/action_view/template_handler.rb +18 -1
- data/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +10 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb +128 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +37 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +14 -1
- data/vendor/rails/actionpack/lib/action_view/test_case.rb +58 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +1 -1
- data/vendor/rails/actionpack/test/active_record_unit.rb +3 -6
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +2 -3
- data/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +158 -41
- data/vendor/rails/actionpack/test/adv_attr_test.rb +20 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +57 -6
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +19 -7
- data/vendor/rails/actionpack/test/controller/base_test.rb +88 -3
- data/vendor/rails/actionpack/test/controller/benchmark_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/caching_test.rb +282 -21
- data/vendor/rails/actionpack/test/controller/capture_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/cgi_test.rb +5 -4
- data/vendor/rails/actionpack/test/controller/components_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +13 -2
- data/vendor/rails/actionpack/test/controller/custom_handler_test.rb +14 -10
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +33 -51
- data/vendor/rails/actionpack/test/controller/fake_controllers.rb +17 -0
- data/vendor/rails/actionpack/test/controller/fake_models.rb +6 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +14 -8
- data/vendor/rails/actionpack/test/controller/filters_test.rb +44 -19
- data/vendor/rails/actionpack/test/controller/flash_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/header_test.rb +14 -0
- data/vendor/rails/actionpack/test/controller/helper_test.rb +19 -15
- data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +26 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +15 -6
- data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +2 -3
- data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +8 -2
- data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/integration_test.rb +14 -17
- data/vendor/rails/actionpack/test/controller/integration_upload_test.rb +43 -0
- data/vendor/rails/actionpack/test/controller/layout_test.rb +26 -6
- data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +39 -7
- data/vendor/rails/actionpack/test/controller/mime_type_test.rb +34 -5
- data/vendor/rails/actionpack/test/controller/new_render_test.rb +150 -37
- data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +153 -77
- data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +38 -2
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +32 -1
- data/vendor/rails/actionpack/test/controller/render_test.rb +78 -15
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +101 -5
- data/vendor/rails/actionpack/test/controller/request_test.rb +103 -11
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +22 -6
- data/vendor/rails/actionpack/test/controller/resources_test.rb +117 -31
- data/vendor/rails/actionpack/test/controller/routing_test.rb +286 -25
- data/vendor/rails/actionpack/test/controller/selector_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +14 -3
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +16 -4
- data/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +3 -4
- data/vendor/rails/actionpack/test/controller/session_fixation_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/session_management_test.rb +23 -1
- data/vendor/rails/actionpack/test/controller/test_test.rb +82 -10
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +69 -5
- data/vendor/rails/actionpack/test/controller/verification_test.rb +35 -18
- data/vendor/rails/actionpack/test/controller/view_paths_test.rb +15 -12
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +48 -3
- data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/company.rb +1 -0
- data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +6 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/good_customers/_good_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/mascot.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/mascots.yml +4 -0
- data/vendor/rails/actionpack/test/fixtures/mascots/_mascot.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/controls.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/dragdrop.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/effects.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/version.1.0.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/version.1.0.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/reply.rb +1 -0
- data/vendor/rails/actionpack/test/fixtures/shared.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +5 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_counter.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_form.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_labelling_form.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_raise.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/topics/_topic.html.erb +1 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +25 -8
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +117 -30
- data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +81 -3
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +10 -22
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +515 -162
- data/vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb +9 -0
- data/vendor/rails/actionpack/test/template/erb_util_test.rb +10 -42
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +192 -66
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +514 -477
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +42 -8
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +10 -13
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +7 -3
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +41 -46
- data/vendor/rails/actionpack/test/template/record_tag_helper_test.rb +54 -0
- data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +5 -6
- data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +7 -13
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +3 -6
- data/vendor/rails/actionpack/test/template/template_finder_test.rb +73 -0
- data/vendor/rails/actionpack/test/template/template_object_test.rb +95 -0
- data/vendor/rails/actionpack/test/template/test_test.rb +56 -0
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +75 -43
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +20 -12
- data/vendor/rails/actionpack/test/testing_sandbox.rb +8 -4
- data/vendor/rails/activerecord/CHANGELOG +235 -2
- data/vendor/rails/activerecord/README +27 -22
- data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +7 -4
- data/vendor/rails/activerecord/Rakefile +27 -26
- data/vendor/rails/activerecord/lib/active_record.rb +16 -12
- data/vendor/rails/activerecord/lib/active_record/aggregations.rb +21 -12
- data/vendor/rails/activerecord/lib/active_record/association_preload.rb +285 -0
- data/vendor/rails/activerecord/lib/active_record/associations.rb +696 -453
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +167 -39
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +73 -13
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +5 -3
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +5 -6
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +26 -79
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +19 -72
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +90 -120
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +9 -7
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +32 -0
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +73 -22
- data/vendor/rails/activerecord/lib/active_record/base.rb +581 -308
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +52 -27
- data/vendor/rails/activerecord/lib/active_record/callbacks.rb +9 -38
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +4 -3
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +9 -4
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +6 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +248 -56
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +159 -37
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +10 -13
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +99 -36
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +204 -57
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +43 -16
- data/vendor/rails/activerecord/lib/active_record/dirty.rb +165 -0
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +144 -181
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +15 -11
- data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/migration.rb +187 -81
- data/vendor/rails/activerecord/lib/active_record/named_scope.rb +168 -0
- data/vendor/rails/activerecord/lib/active_record/observer.rb +24 -8
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +38 -14
- data/vendor/rails/activerecord/lib/active_record/schema.rb +7 -14
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +4 -4
- data/vendor/rails/activerecord/lib/active_record/serialization.rb +5 -5
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +37 -28
- data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +52 -29
- data/vendor/rails/activerecord/lib/active_record/test_case.rb +47 -0
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +4 -4
- data/vendor/rails/activerecord/lib/active_record/transactions.rb +6 -8
- data/vendor/rails/activerecord/lib/active_record/validations.rb +201 -255
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/test/{fixtures → assets}/example.log +0 -0
- data/vendor/rails/activerecord/test/{fixtures → assets}/flowers.jpg +0 -0
- data/vendor/rails/activerecord/test/cases/aaa_create_tables_test.rb +24 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +95 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb +24 -0
- data/vendor/rails/activerecord/test/cases/adapter_test.rb +127 -0
- data/vendor/rails/activerecord/test/cases/adapter_test_sqlserver.rb +95 -0
- data/vendor/rails/activerecord/test/cases/aggregations_test.rb +128 -0
- data/vendor/rails/activerecord/test/cases/ar_schema_test.rb +33 -0
- data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +431 -0
- data/vendor/rails/activerecord/test/cases/associations/callbacks_test.rb +161 -0
- data/vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +123 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +83 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_singularization_test.rb +145 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +643 -0
- data/vendor/rails/activerecord/test/cases/associations/extension_test.rb +62 -0
- data/vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +706 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +1034 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +200 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +345 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +113 -0
- data/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +88 -0
- data/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +714 -0
- data/vendor/rails/activerecord/test/cases/associations_test.rb +262 -0
- data/vendor/rails/activerecord/test/cases/attribute_methods_test.rb +238 -0
- data/vendor/rails/activerecord/test/cases/base_test.rb +2015 -0
- data/vendor/rails/activerecord/test/cases/binary_test.rb +34 -0
- data/vendor/rails/activerecord/test/cases/calculations_test.rb +323 -0
- data/vendor/rails/activerecord/test/cases/callbacks_test.rb +400 -0
- data/vendor/rails/activerecord/test/cases/class_inheritable_attributes_test.rb +32 -0
- data/vendor/rails/activerecord/test/cases/column_alias_test.rb +17 -0
- data/vendor/rails/activerecord/test/cases/column_definition_test.rb +36 -0
- data/vendor/rails/activerecord/test/cases/connection_test_firebird.rb +8 -0
- data/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +30 -0
- data/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +69 -0
- data/vendor/rails/activerecord/test/cases/database_statements_test.rb +12 -0
- data/vendor/rails/activerecord/test/cases/datatype_test_postgresql.rb +203 -0
- data/vendor/rails/activerecord/test/cases/date_time_test.rb +37 -0
- data/vendor/rails/activerecord/test/cases/default_test_firebird.rb +16 -0
- data/vendor/rails/activerecord/test/cases/defaults_test.rb +69 -0
- data/vendor/rails/activerecord/test/cases/deprecated_finder_test.rb +30 -0
- data/vendor/rails/activerecord/test/cases/dirty_test.rb +257 -0
- data/vendor/rails/activerecord/test/cases/finder_respond_to_test.rb +76 -0
- data/vendor/rails/activerecord/test/cases/finder_test.rb +898 -0
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +626 -0
- data/vendor/rails/activerecord/test/cases/helper.rb +47 -0
- data/vendor/rails/activerecord/test/cases/inheritance_test.rb +262 -0
- data/vendor/rails/activerecord/test/cases/invalid_date_test.rb +24 -0
- data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +205 -0
- data/vendor/rails/activerecord/test/cases/lifecycle_test.rb +193 -0
- data/vendor/rails/activerecord/test/cases/locking_test.rb +309 -0
- data/vendor/rails/activerecord/test/cases/method_scoping_test.rb +462 -0
- data/vendor/rails/activerecord/test/cases/migration_test.rb +1444 -0
- data/vendor/rails/activerecord/test/cases/migration_test_firebird.rb +124 -0
- data/vendor/rails/activerecord/test/cases/mixin_test.rb +96 -0
- data/vendor/rails/activerecord/test/cases/modules_test.rb +39 -0
- data/vendor/rails/activerecord/test/cases/multiple_db_test.rb +60 -0
- data/vendor/rails/activerecord/test/cases/named_scope_test.rb +206 -0
- data/vendor/rails/activerecord/test/cases/pk_test.rb +101 -0
- data/vendor/rails/activerecord/test/cases/query_cache_test.rb +127 -0
- data/vendor/rails/activerecord/test/cases/readonly_test.rb +107 -0
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +176 -0
- data/vendor/rails/activerecord/test/cases/reserved_word_test_mysql.rb +176 -0
- data/vendor/rails/activerecord/test/cases/schema_authorization_test_postgresql.rb +75 -0
- data/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +184 -0
- data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +102 -0
- data/vendor/rails/activerecord/test/cases/serialization_test.rb +47 -0
- data/vendor/rails/activerecord/test/cases/synonym_test_oracle.rb +17 -0
- data/vendor/rails/activerecord/test/cases/table_name_test_sqlserver.rb +23 -0
- data/vendor/rails/activerecord/test/cases/threaded_connections_test.rb +48 -0
- data/vendor/rails/activerecord/test/cases/transactions_test.rb +307 -0
- data/vendor/rails/activerecord/test/cases/unconnected_test.rb +32 -0
- data/vendor/rails/activerecord/test/cases/validations_test.rb +1541 -0
- data/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +202 -0
- data/vendor/rails/activerecord/test/config.rb +5 -0
- data/vendor/rails/activerecord/test/connections/native_db2/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +1 -3
- data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +2 -2
- data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +2 -2
- data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +3 -3
- data/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/fixtures/author_addresses.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/authors.yml +2 -0
- data/vendor/rails/activerecord/test/fixtures/clubs.yml +6 -0
- data/vendor/rails/activerecord/test/fixtures/jobs.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/members.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/memberships.yml +20 -0
- data/vendor/rails/activerecord/test/fixtures/owners.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/people.yml +4 -1
- data/vendor/rails/activerecord/test/fixtures/pets.yml +14 -0
- data/vendor/rails/activerecord/test/fixtures/posts.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/price_estimates.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/readers.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/references.yml +17 -0
- data/vendor/rails/activerecord/test/fixtures/sponsors.yml +9 -0
- data/vendor/rails/activerecord/test/fixtures/subscribers.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/subscriptions.yml +12 -0
- data/vendor/rails/activerecord/test/fixtures/taggings.yml +4 -1
- data/vendor/rails/activerecord/test/fixtures/topics.yml +22 -2
- data/vendor/rails/activerecord/test/fixtures/warehouse-things.yml +3 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_decimal → migrations/decimal}/1_give_me_big_numbers.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_duplicate → migrations/duplicate}/3_foo.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations → migrations/duplicate}/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +7 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +7 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_duplicate → migrations/interleaved/pass_1}/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_missing_versions/4_innocent_jointable.rb → migrations/interleaved/pass_2/3_innocent_jointable.rb} +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +8 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/valid/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/models/author.rb +137 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/auto_id.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/binary.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/book.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/categorization.rb +0 -0
- data/vendor/rails/activerecord/test/models/category.rb +30 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/citation.rb +0 -0
- data/vendor/rails/activerecord/test/models/club.rb +7 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/column_name.rb +0 -0
- data/vendor/rails/activerecord/test/models/comment.rb +25 -0
- data/vendor/rails/activerecord/test/models/company.rb +132 -0
- data/vendor/rails/activerecord/test/models/company_in_module.rb +61 -0
- data/vendor/rails/activerecord/test/models/computer.rb +3 -0
- data/vendor/rails/activerecord/test/models/contact.rb +16 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/course.rb +0 -0
- data/vendor/rails/activerecord/test/models/customer.rb +55 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/default.rb +0 -0
- data/vendor/rails/activerecord/test/models/developer.rb +79 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/edge.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/entrant.rb +0 -0
- data/vendor/rails/activerecord/test/models/guid.rb +2 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/item.rb +0 -0
- data/vendor/rails/activerecord/test/models/job.rb +5 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/joke.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/keyboard.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/legacy_thing.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/matey.rb +0 -0
- data/vendor/rails/activerecord/test/models/member.rb +9 -0
- data/vendor/rails/activerecord/test/models/membership.rb +9 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/minimalistic.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/mixed_case_monkey.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/movie.rb +0 -0
- data/vendor/rails/activerecord/test/models/order.rb +4 -0
- data/vendor/rails/activerecord/test/models/owner.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/parrot.rb +0 -0
- data/vendor/rails/activerecord/test/models/person.rb +10 -0
- data/vendor/rails/activerecord/test/models/pet.rb +4 -0
- data/vendor/rails/activerecord/test/models/pirate.rb +9 -0
- data/vendor/rails/activerecord/test/models/post.rb +85 -0
- data/vendor/rails/activerecord/test/models/price_estimate.rb +3 -0
- data/vendor/rails/activerecord/test/models/project.rb +29 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/reader.rb +0 -0
- data/vendor/rails/activerecord/test/models/reference.rb +4 -0
- data/vendor/rails/activerecord/test/models/reply.rb +39 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/ship.rb +0 -0
- data/vendor/rails/activerecord/test/models/sponsor.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/subject.rb +0 -0
- data/vendor/rails/activerecord/test/models/subscriber.rb +8 -0
- data/vendor/rails/activerecord/test/models/subscription.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/tag.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/tagging.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/task.rb +0 -0
- data/vendor/rails/activerecord/test/models/topic.rb +66 -0
- data/vendor/rails/activerecord/test/models/treasure.rb +6 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/vertex.rb +0 -0
- data/vendor/rails/activerecord/test/models/warehouse_thing.rb +5 -0
- data/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +12 -0
- data/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +103 -0
- data/vendor/rails/activerecord/test/schema/schema.rb +429 -0
- data/vendor/rails/activerecord/test/schema/schema2.rb +6 -0
- data/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb +25 -0
- data/vendor/rails/activerecord/test/schema/sqlserver_specific_schema.rb +5 -0
- data/vendor/rails/activeresource/CHANGELOG +33 -0
- data/vendor/rails/activeresource/Rakefile +9 -5
- data/vendor/rails/activeresource/lib/active_resource.rb +1 -1
- data/vendor/rails/activeresource/lib/active_resource/base.rb +309 -160
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +41 -6
- data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +58 -44
- data/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +1 -1
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +82 -12
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +2 -2
- data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
- data/vendor/rails/activeresource/test/abstract_unit.rb +17 -1
- data/vendor/rails/activeresource/test/authorization_test.rb +45 -5
- data/vendor/rails/activeresource/test/base/custom_methods_test.rb +6 -3
- data/vendor/rails/activeresource/test/base/equality_test.rb +1 -1
- data/vendor/rails/activeresource/test/base/load_test.rb +36 -1
- data/vendor/rails/activeresource/test/base_errors_test.rb +1 -1
- data/vendor/rails/activeresource/test/base_test.rb +422 -28
- data/vendor/rails/activeresource/test/connection_test.rb +22 -2
- data/vendor/rails/activeresource/test/fixtures/customer.rb +3 -0
- data/vendor/rails/activeresource/test/format_test.rb +43 -2
- data/vendor/rails/activeresource/test/setter_trap.rb +1 -1
- data/vendor/rails/activesupport/CHANGELOG +214 -2
- data/vendor/rails/activesupport/lib/active_support.rb +13 -1
- data/vendor/rails/activesupport/lib/active_support/base64.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/basic_object.rb +23 -4
- data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +17 -3
- data/vendor/rails/activesupport/lib/active_support/cache.rb +147 -0
- data/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/cache/drb_store.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/cache/file_store.rb +70 -0
- data/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +100 -0
- data/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/callbacks.rb +275 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +2 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +89 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +3 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +39 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +5 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +28 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +13 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +37 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +41 -19
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +19 -13
- data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +6 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +27 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +6 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +4 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +10 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +2 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +11 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +56 -16
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/process.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +16 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +5 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb +36 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +5 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +72 -48
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/filters.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +58 -63
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +12 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +54 -30
- data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +24 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +75 -23
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +33 -38
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/zones.rb +86 -0
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +418 -405
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +29 -10
- data/vendor/rails/activesupport/lib/active_support/duration.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/gzip.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +51 -49
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +267 -236
- data/vendor/rails/activesupport/lib/active_support/json.rb +17 -25
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +9 -6
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +3 -6
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +8 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +10 -14
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +11 -11
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +43 -0
- data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +13 -43
- data/vendor/rails/activesupport/lib/active_support/string_inquirer.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/test_case.rb +10 -2
- data/vendor/rails/activesupport/lib/active_support/testing/default.rb +3 -6
- data/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +93 -0
- data/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +304 -0
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +378 -163
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +849 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/data_timezone.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/data_timezone_info.rb +228 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Casablanca.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/San_Juan.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Bogota.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Caracas.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Chicago.rb +283 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Denver.rb +204 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Godthab.rb +161 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Halifax.rb +274 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Juneau.rb +194 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Lima.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/New_York.rb +282 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Regina.rb +74 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Santiago.rb +205 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Karachi.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/London.rb +288 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/info_timezone.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/linked_timezone.rb +51 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/linked_timezone_info.rb +44 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/offset_rationals.rb +98 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/ruby_core_support.rb +56 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/time_or_datetime.rb +292 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone.rb +508 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_definition.rb +56 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_info.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_offset_info.rb +94 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_period.rb +198 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_transition_info.rb +129 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +30 -10
- data/vendor/rails/railties/CHANGELOG +148 -0
- data/vendor/rails/railties/MIT-LICENSE +1 -1
- data/vendor/rails/railties/README +67 -14
- data/vendor/rails/railties/Rakefile +15 -21
- data/vendor/rails/railties/bin/about +2 -1
- data/vendor/rails/railties/bin/dbconsole +3 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +22 -20
- data/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +1 -1
- data/vendor/rails/railties/configs/databases/frontbase.yml +2 -2
- data/vendor/rails/railties/configs/databases/mysql.yml +2 -2
- data/vendor/rails/railties/configs/databases/oracle.yml +3 -3
- data/vendor/rails/railties/configs/databases/postgresql.yml +2 -2
- data/vendor/rails/railties/configs/databases/sqlite2.yml +2 -2
- data/vendor/rails/railties/configs/databases/sqlite3.yml +2 -2
- data/vendor/rails/railties/configs/initializers/inflections.rb +1 -1
- data/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +17 -0
- data/vendor/rails/railties/configs/routes.rb +8 -0
- data/vendor/rails/railties/dispatches/gateway.cgi +2 -2
- data/vendor/rails/railties/environments/boot.rb +6 -6
- data/vendor/rails/railties/environments/development.rb +0 -1
- data/vendor/rails/railties/environments/environment.rb +15 -7
- data/vendor/rails/railties/environments/production.rb +3 -0
- data/vendor/rails/railties/environments/test.rb +1 -1
- data/vendor/rails/railties/helpers/application.rb +5 -0
- data/vendor/rails/railties/html/images/rails.png +0 -0
- data/vendor/rails/railties/html/index.html +6 -9
- data/vendor/rails/railties/html/javascripts/controls.js +1 -1
- data/vendor/rails/railties/html/javascripts/dragdrop.js +1 -1
- data/vendor/rails/railties/html/javascripts/effects.js +1 -1
- data/vendor/rails/railties/lib/commands/about.rb +1 -0
- data/vendor/rails/railties/lib/commands/console.rb +5 -5
- data/vendor/rails/railties/lib/commands/dbconsole.rb +67 -0
- data/vendor/rails/railties/lib/commands/performance/profiler.rb +1 -1
- data/vendor/rails/railties/lib/commands/plugin.rb +30 -3
- data/vendor/rails/railties/lib/commands/server.rb +2 -2
- data/vendor/rails/railties/lib/commands/servers/lighttpd.rb +1 -1
- data/vendor/rails/railties/lib/commands/servers/mongrel.rb +9 -9
- data/vendor/rails/railties/lib/commands/servers/new_mongrel.rb +16 -0
- data/vendor/rails/railties/lib/commands/servers/webrick.rb +1 -1
- data/vendor/rails/railties/lib/console_app.rb +2 -2
- data/vendor/rails/railties/lib/console_sandbox.rb +2 -2
- data/vendor/rails/railties/lib/console_with_helpers.rb +1 -1
- data/vendor/rails/railties/lib/dispatcher.rb +1 -1
- data/vendor/rails/railties/lib/fcgi_handler.rb +32 -16
- data/vendor/rails/railties/lib/initializer.rb +303 -70
- data/vendor/rails/railties/lib/rails/gem_builder.rb +21 -0
- data/vendor/rails/railties/lib/rails/gem_dependency.rb +129 -0
- data/vendor/rails/railties/lib/rails/mongrel_server/commands.rb +342 -0
- data/vendor/rails/railties/lib/rails/mongrel_server/handler.rb +55 -0
- data/vendor/rails/railties/lib/rails/plugin.rb +51 -19
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +4 -2
- data/vendor/rails/railties/lib/rails/plugin/locator.rb +24 -2
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/base.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/commands.rb +85 -54
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +9 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +1 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +2 -6
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +8 -6
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +4 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +4 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -20
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +3 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +3 -4
- data/vendor/rails/railties/lib/rails_generator/lookup.rb +9 -4
- data/vendor/rails/railties/lib/rails_generator/options.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/scripts.rb +8 -5
- data/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +12 -8
- data/vendor/rails/railties/lib/source_annotation_extractor.rb +40 -0
- data/vendor/rails/railties/lib/tasks/databases.rake +81 -55
- data/vendor/rails/railties/lib/tasks/documentation.rake +4 -4
- data/vendor/rails/railties/lib/tasks/framework.rake +23 -27
- data/vendor/rails/railties/lib/tasks/gems.rake +64 -0
- data/vendor/rails/railties/lib/tasks/misc.rake +47 -0
- data/vendor/rails/railties/lib/tasks/rails.rb +1 -1
- data/vendor/rails/railties/lib/tasks/testing.rake +3 -3
- data/vendor/rails/railties/lib/test_help.rb +8 -0
- metadata +788 -1204
- data/app/controllers/admin/extension_controller.rb +0 -5
- data/app/controllers/admin/layout_controller.rb +0 -21
- data/app/controllers/admin/page_controller.rb +0 -115
- data/app/controllers/admin/snippet_controller.rb +0 -3
- data/app/controllers/admin/user_controller.rb +0 -44
- data/app/helpers/admin/extension_helper.rb +0 -2
- data/app/helpers/admin/layout_helper.rb +0 -2
- data/app/helpers/admin/page_helper.rb +0 -69
- data/app/helpers/admin/snippet_helper.rb +0 -2
- data/app/helpers/admin/user_helper.rb +0 -8
- data/app/models/radiant/extension_meta.rb +0 -5
- data/app/views/admin/extension/index.html.haml +0 -28
- data/app/views/admin/layout/edit.html.haml +0 -44
- data/app/views/admin/layout/index.html.haml +0 -25
- data/app/views/admin/layout/remove.html.haml +0 -16
- data/app/views/admin/page/_meta_row.html.haml +0 -6
- data/app/views/admin/page/_node.html.haml +0 -25
- data/app/views/admin/page/_part.html.haml +0 -17
- data/app/views/admin/page/_tag_reference.html.haml +0 -3
- data/app/views/admin/page/children.html.haml +0 -2
- data/app/views/admin/page/edit.html.haml +0 -115
- data/app/views/admin/page/filter_reference.rjs +0 -5
- data/app/views/admin/page/index.html.haml +0 -28
- data/app/views/admin/page/remove.html.haml +0 -20
- data/app/views/admin/page/tag_reference.rjs +0 -5
- data/app/views/admin/snippet/edit.html.haml +0 -36
- data/app/views/admin/snippet/index.html.haml +0 -20
- data/app/views/admin/snippet/remove.html.haml +0 -19
- data/app/views/admin/user/edit.html.haml +0 -80
- data/app/views/admin/user/index.html.haml +0 -23
- data/app/views/admin/user/preferences.html.haml +0 -28
- data/app/views/admin/user/remove.html.haml +0 -18
- data/lib/plugins/dependencies_fix/init.rb +0 -6
- data/lib/plugins/string_io/init.rb +0 -2
- data/spec/controllers/admin/abstract_model_controller_spec.rb +0 -265
- data/spec/controllers/admin/extension_controller_spec.rb +0 -21
- data/spec/controllers/admin/layout_controller_spec.rb +0 -42
- data/spec/controllers/admin/page_controller_spec.rb +0 -287
- data/spec/controllers/admin/snippet_controller_spec.rb +0 -27
- data/spec/controllers/admin/user_controller_spec.rb +0 -72
- data/spec/helpers/admin/extension_helper_spec.rb +0 -4
- data/spec/helpers/admin/layout_helper_spec.rb +0 -4
- data/spec/helpers/admin/page_helper_spec.rb +0 -45
- data/spec/helpers/admin/snippet_helper_spec.rb +0 -4
- data/spec/helpers/admin/user_helper_spec.rb +0 -11
- data/spec/scenarios/file_not_found_scenario.rb +0 -19
- data/spec/scenarios/home_page_scenario.rb +0 -64
- data/spec/scenarios/layouts_scenario.rb +0 -58
- data/spec/scenarios/markup_pages_scenario.rb +0 -13
- data/spec/scenarios/pages_scenario.rb +0 -56
- data/spec/scenarios/pages_with_layouts_scenario.rb +0 -10
- data/spec/scenarios/snippets_scenario.rb +0 -38
- data/spec/scenarios/users_and_pages_scenario.rb +0 -9
- data/spec/scenarios/users_scenario.rb +0 -43
- data/test/fixtures/extensions/01_basic/db/migrate/001_create_initial_schema.rb +0 -8
- data/test/fixtures/extensions/01_basic/db/migrate/002_modify_initial_schema.rb +0 -8
- data/test/fixtures/layouts.yml +0 -26
- data/test/fixtures/page_parts.yml +0 -119
- data/test/fixtures/pages.yml +0 -353
- data/test/fixtures/sample.txt +0 -1
- data/test/fixtures/snippets.yml +0 -26
- data/test/fixtures/users.yml +0 -35
- data/test/helpers/caching_test_helper.rb +0 -42
- data/test/helpers/difference_test_helper.rb +0 -13
- data/test/helpers/extension_fixture_test_helper.rb +0 -40
- data/test/helpers/extension_tag_test_helper.rb +0 -17
- data/test/helpers/layout_test_helper.rb +0 -35
- data/test/helpers/logging_test_helper.rb +0 -20
- data/test/helpers/login_test_helper.rb +0 -23
- data/test/helpers/page_part_test_helper.rb +0 -49
- data/test/helpers/routing_test_helper.rb +0 -19
- data/test/helpers/snippet_test_helper.rb +0 -32
- data/vendor/extensions/archive/spec/scenarios/archive_scenario.rb +0 -51
- data/vendor/plugins/rspec/CHANGES +0 -1079
- data/vendor/plugins/rspec/MIT-LICENSE +0 -20
- data/vendor/plugins/rspec/README +0 -71
- data/vendor/plugins/rspec/Rakefile +0 -279
- data/vendor/plugins/rspec/TODO +0 -2
- data/vendor/plugins/rspec/UPGRADE +0 -31
- data/vendor/plugins/rspec/bin/spec +0 -4
- data/vendor/plugins/rspec/bin/spec_translator +0 -8
- data/vendor/plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/examples/pure/before_and_after_example.rb +0 -40
- data/vendor/plugins/rspec/examples/pure/behave_as_example.rb +0 -45
- data/vendor/plugins/rspec/examples/pure/custom_expectation_matchers.rb +0 -54
- data/vendor/plugins/rspec/examples/pure/custom_formatter.rb +0 -12
- data/vendor/plugins/rspec/examples/pure/dynamic_spec.rb +0 -9
- data/vendor/plugins/rspec/examples/pure/file_accessor.rb +0 -19
- data/vendor/plugins/rspec/examples/pure/file_accessor_spec.rb +0 -38
- data/vendor/plugins/rspec/examples/pure/greeter_spec.rb +0 -31
- data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +0 -14
- data/vendor/plugins/rspec/examples/pure/io_processor.rb +0 -8
- data/vendor/plugins/rspec/examples/pure/io_processor_spec.rb +0 -21
- data/vendor/plugins/rspec/examples/pure/legacy_spec.rb +0 -11
- data/vendor/plugins/rspec/examples/pure/mocking_example.rb +0 -27
- data/vendor/plugins/rspec/examples/pure/multi_threaded_behaviour_runner.rb +0 -28
- data/vendor/plugins/rspec/examples/pure/nested_classes_example.rb +0 -36
- data/vendor/plugins/rspec/examples/pure/partial_mock_example.rb +0 -28
- data/vendor/plugins/rspec/examples/pure/pending_example.rb +0 -20
- data/vendor/plugins/rspec/examples/pure/predicate_example.rb +0 -27
- data/vendor/plugins/rspec/examples/pure/priority.txt +0 -1
- data/vendor/plugins/rspec/examples/pure/shared_example_group_example.rb +0 -81
- data/vendor/plugins/rspec/examples/pure/shared_stack_examples.rb +0 -38
- data/vendor/plugins/rspec/examples/pure/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/examples/pure/stack.rb +0 -36
- data/vendor/plugins/rspec/examples/pure/stack_spec.rb +0 -63
- data/vendor/plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +0 -67
- data/vendor/plugins/rspec/examples/pure/stubbing_example.rb +0 -69
- data/vendor/plugins/rspec/examples/stories/adder.rb +0 -13
- data/vendor/plugins/rspec/examples/stories/addition +0 -34
- data/vendor/plugins/rspec/examples/stories/addition.rb +0 -9
- data/vendor/plugins/rspec/examples/stories/calculator.rb +0 -65
- data/vendor/plugins/rspec/examples/stories/game-of-life/README.txt +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/everything.rb +0 -6
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/examples.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +0 -35
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +0 -66
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +0 -42
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +0 -42
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +0 -17
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +0 -53
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +0 -52
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/helper.rb +0 -6
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +0 -26
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/steps.rb +0 -5
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.txt +0 -22
- data/vendor/plugins/rspec/examples/stories/game-of-life/life.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/game.rb +0 -23
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/grid.rb +0 -43
- data/vendor/plugins/rspec/examples/stories/helper.rb +0 -9
- data/vendor/plugins/rspec/examples/stories/steps/addition_steps.rb +0 -18
- data/vendor/plugins/rspec/failing_examples/README.txt +0 -7
- data/vendor/plugins/rspec/failing_examples/diffing_spec.rb +0 -36
- data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/failing_examples/failure_in_setup.rb +0 -10
- data/vendor/plugins/rspec/failing_examples/failure_in_teardown.rb +0 -10
- data/vendor/plugins/rspec/failing_examples/mocking_example.rb +0 -40
- data/vendor/plugins/rspec/failing_examples/mocking_with_flexmock.rb +0 -26
- data/vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb +0 -25
- data/vendor/plugins/rspec/failing_examples/mocking_with_rr.rb +0 -27
- data/vendor/plugins/rspec/failing_examples/partial_mock_example.rb +0 -20
- data/vendor/plugins/rspec/failing_examples/predicate_example.rb +0 -29
- data/vendor/plugins/rspec/failing_examples/raising_example.rb +0 -47
- data/vendor/plugins/rspec/failing_examples/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/failing_examples/syntax_error_example.rb +0 -7
- data/vendor/plugins/rspec/failing_examples/team_spec.rb +0 -44
- data/vendor/plugins/rspec/failing_examples/timeout_behaviour.rb +0 -7
- data/vendor/plugins/rspec/init.rb +0 -9
- data/vendor/plugins/rspec/lib/autotest/discover.rb +0 -3
- data/vendor/plugins/rspec/lib/autotest/rspec.rb +0 -72
- data/vendor/plugins/rspec/lib/spec.rb +0 -30
- data/vendor/plugins/rspec/lib/spec/example.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/example/configuration.rb +0 -144
- data/vendor/plugins/rspec/lib/spec/example/errors.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/example/example_group.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/example/example_group_factory.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb +0 -433
- data/vendor/plugins/rspec/lib/spec/example/example_matcher.rb +0 -42
- data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +0 -110
- data/vendor/plugins/rspec/lib/spec/example/module_reopening_fix.rb +0 -21
- data/vendor/plugins/rspec/lib/spec/example/pending.rb +0 -18
- data/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/expectations.rb +0 -56
- data/vendor/plugins/rspec/lib/spec/expectations/differs/default.rb +0 -66
- data/vendor/plugins/rspec/lib/spec/expectations/errors.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/expectations/extensions.rb +0 -2
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb +0 -71
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/string_and_symbol.rb +0 -17
- data/vendor/plugins/rspec/lib/spec/expectations/handler.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/extensions.rb +0 -4
- data/vendor/plugins/rspec/lib/spec/extensions/class.rb +0 -24
- data/vendor/plugins/rspec/lib/spec/extensions/main.rb +0 -102
- data/vendor/plugins/rspec/lib/spec/extensions/metaclass.rb +0 -7
- data/vendor/plugins/rspec/lib/spec/extensions/object.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +0 -61
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +0 -34
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +0 -61
- data/vendor/plugins/rspec/lib/spec/matchers.rb +0 -156
- data/vendor/plugins/rspec/lib/spec/matchers/be.rb +0 -224
- data/vendor/plugins/rspec/lib/spec/matchers/be_close.rb +0 -37
- data/vendor/plugins/rspec/lib/spec/matchers/change.rb +0 -144
- data/vendor/plugins/rspec/lib/spec/matchers/eql.rb +0 -43
- data/vendor/plugins/rspec/lib/spec/matchers/equal.rb +0 -43
- data/vendor/plugins/rspec/lib/spec/matchers/exist.rb +0 -17
- data/vendor/plugins/rspec/lib/spec/matchers/has.rb +0 -34
- data/vendor/plugins/rspec/lib/spec/matchers/have.rb +0 -145
- data/vendor/plugins/rspec/lib/spec/matchers/include.rb +0 -70
- data/vendor/plugins/rspec/lib/spec/matchers/match.rb +0 -41
- data/vendor/plugins/rspec/lib/spec/matchers/operator_matcher.rb +0 -73
- data/vendor/plugins/rspec/lib/spec/matchers/raise_error.rb +0 -132
- data/vendor/plugins/rspec/lib/spec/matchers/respond_to.rb +0 -45
- data/vendor/plugins/rspec/lib/spec/matchers/satisfy.rb +0 -47
- data/vendor/plugins/rspec/lib/spec/matchers/simple_matcher.rb +0 -29
- data/vendor/plugins/rspec/lib/spec/matchers/throw_symbol.rb +0 -74
- data/vendor/plugins/rspec/lib/spec/mocks.rb +0 -211
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +0 -31
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb.orig +0 -27
- data/vendor/plugins/rspec/lib/spec/mocks/argument_expectation.rb +0 -209
- data/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb +0 -84
- data/vendor/plugins/rspec/lib/spec/mocks/errors.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/mocks/extensions/object.rb +0 -3
- data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +0 -269
- data/vendor/plugins/rspec/lib/spec/mocks/methods.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/mocks/mock.rb +0 -50
- data/vendor/plugins/rspec/lib/spec/mocks/order_group.rb +0 -29
- data/vendor/plugins/rspec/lib/spec/mocks/proxy.rb +0 -166
- data/vendor/plugins/rspec/lib/spec/mocks/space.rb +0 -28
- data/vendor/plugins/rspec/lib/spec/mocks/spec_methods.rb +0 -38
- data/vendor/plugins/rspec/lib/spec/rake/spectask.rb +0 -235
- data/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/runner.rb +0 -202
- data/vendor/plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +0 -57
- data/vendor/plugins/rspec/lib/spec/runner/class_and_arguments_parser.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/runner/command_line.rb +0 -28
- data/vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb +0 -20
- data/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb +0 -59
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +0 -77
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +0 -130
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +0 -33
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +0 -20
- data/vendor/plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +0 -333
- data/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +0 -47
- data/vendor/plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +0 -30
- data/vendor/plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +0 -128
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +0 -131
- data/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner.rb +0 -72
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner_unsupported.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/runner/option_parser.rb +0 -205
- data/vendor/plugins/rspec/lib/spec/runner/options.rb +0 -288
- data/vendor/plugins/rspec/lib/spec/runner/reporter.rb +0 -147
- data/vendor/plugins/rspec/lib/spec/runner/spec_parser.rb +0 -71
- data/vendor/plugins/rspec/lib/spec/story.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/story/extensions.rb +0 -3
- data/vendor/plugins/rspec/lib/spec/story/extensions/main.rb +0 -86
- data/vendor/plugins/rspec/lib/spec/story/extensions/regexp.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/story/extensions/string.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/story/given_scenario.rb +0 -14
- data/vendor/plugins/rspec/lib/spec/story/runner.rb +0 -56
- data/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +0 -48
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_collector.rb +0 -18
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb +0 -48
- data/vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb +0 -123
- data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +0 -227
- data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +0 -70
- data/vendor/plugins/rspec/lib/spec/story/scenario.rb +0 -14
- data/vendor/plugins/rspec/lib/spec/story/step.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/story/step_group.rb +0 -89
- data/vendor/plugins/rspec/lib/spec/story/step_mother.rb +0 -37
- data/vendor/plugins/rspec/lib/spec/story/story.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/story/world.rb +0 -124
- data/vendor/plugins/rspec/lib/spec/translator.rb +0 -114
- data/vendor/plugins/rspec/lib/spec/version.rb +0 -22
- data/vendor/plugins/rspec/plugins/mock_frameworks/flexmock.rb +0 -23
- data/vendor/plugins/rspec/plugins/mock_frameworks/mocha.rb +0 -19
- data/vendor/plugins/rspec/plugins/mock_frameworks/rr.rb +0 -21
- data/vendor/plugins/rspec/plugins/mock_frameworks/rspec.rb +0 -18
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit.rb +0 -4
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb +0 -50
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +0 -54
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +0 -111
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +0 -314
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +0 -15
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +0 -51
- data/vendor/plugins/rspec/pre_commit/spec/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/pre_commit/spec/spec_suite.rb +0 -11
- data/vendor/plugins/rspec/rake_tasks/examples.rake +0 -7
- data/vendor/plugins/rspec/rake_tasks/examples_with_rcov.rake +0 -9
- data/vendor/plugins/rspec/rake_tasks/failing_examples_with_html.rake +0 -9
- data/vendor/plugins/rspec/rake_tasks/verify_rcov.rake +0 -7
- data/vendor/plugins/rspec/spec/README.jruby +0 -15
- data/vendor/plugins/rspec/spec/autotest/discover_spec.rb +0 -19
- data/vendor/plugins/rspec/spec/autotest/rspec_spec.rb +0 -197
- data/vendor/plugins/rspec/spec/autotest_helper.rb +0 -6
- data/vendor/plugins/rspec/spec/rspec_suite.rb +0 -7
- data/vendor/plugins/rspec/spec/ruby_forker.rb +0 -13
- data/vendor/plugins/rspec/spec/spec.opts +0 -6
- data/vendor/plugins/rspec/spec/spec/example/configuration_spec.rb +0 -282
- data/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb +0 -48
- data/vendor/plugins/rspec/spec/spec/example/example_group_factory_spec.rb +0 -135
- data/vendor/plugins/rspec/spec/spec/example/example_group_methods_spec.rb +0 -523
- data/vendor/plugins/rspec/spec/spec/example/example_group_spec.rb +0 -711
- data/vendor/plugins/rspec/spec/spec/example/example_matcher_spec.rb +0 -96
- data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +0 -115
- data/vendor/plugins/rspec/spec/spec/example/example_runner_spec.rb +0 -194
- data/vendor/plugins/rspec/spec/spec/example/example_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb +0 -71
- data/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +0 -21
- data/vendor/plugins/rspec/spec/spec/example/shared_example_group_spec.rb +0 -265
- data/vendor/plugins/rspec/spec/spec/example/subclassing_example_group_spec.rb +0 -25
- data/vendor/plugins/rspec/spec/spec/expectations/differs/default_spec.rb +0 -127
- data/vendor/plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +0 -107
- data/vendor/plugins/rspec/spec/spec/expectations/fail_with_spec.rb +0 -71
- data/vendor/plugins/rspec/spec/spec/extensions/main_spec.rb +0 -76
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +0 -38
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +0 -9
- data/vendor/plugins/rspec/spec/spec/matchers/be_close_spec.rb +0 -39
- data/vendor/plugins/rspec/spec/spec/matchers/be_spec.rb +0 -248
- data/vendor/plugins/rspec/spec/spec/matchers/change_spec.rb +0 -319
- data/vendor/plugins/rspec/spec/spec/matchers/description_generation_spec.rb +0 -153
- data/vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb +0 -28
- data/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb +0 -28
- data/vendor/plugins/rspec/spec/spec/matchers/exist_spec.rb +0 -57
- data/vendor/plugins/rspec/spec/spec/matchers/handler_spec.rb +0 -129
- data/vendor/plugins/rspec/spec/spec/matchers/has_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/matchers/have_spec.rb +0 -291
- data/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +0 -37
- data/vendor/plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +0 -78
- data/vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb +0 -24
- data/vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +0 -158
- data/vendor/plugins/rspec/spec/spec/matchers/raise_error_spec.rb +0 -315
- data/vendor/plugins/rspec/spec/spec/matchers/respond_to_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb +0 -36
- data/vendor/plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +0 -29
- data/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb +0 -23
- data/vendor/plugins/rspec/spec/spec/mocks/at_least_spec.rb +0 -97
- data/vendor/plugins/rspec/spec/spec/mocks/at_most_spec.rb +0 -93
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10260_spec.rb +0 -8
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb +0 -24
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +0 -33
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +0 -30
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +0 -19
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb +0 -22
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8165_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +0 -26
- data/vendor/plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +0 -123
- data/vendor/plugins/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +0 -32
- data/vendor/plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +0 -84
- data/vendor/plugins/rspec/spec/spec/mocks/mock_space_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb +0 -481
- data/vendor/plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +0 -113
- data/vendor/plugins/rspec/spec/spec/mocks/null_object_mock_spec.rb +0 -40
- data/vendor/plugins/rspec/spec/spec/mocks/once_counts_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/mocks/options_hash_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +0 -106
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +0 -66
- data/vendor/plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +0 -160
- data/vendor/plugins/rspec/spec/spec/mocks/precise_counts_spec.rb +0 -52
- data/vendor/plugins/rspec/spec/spec/mocks/record_messages_spec.rb +0 -26
- data/vendor/plugins/rspec/spec/spec/mocks/stub_spec.rb +0 -181
- data/vendor/plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +0 -67
- data/vendor/plugins/rspec/spec/spec/package/bin_spec_spec.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +0 -23
- data/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb +0 -147
- data/vendor/plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +0 -92
- data/vendor/plugins/rspec/spec/spec/runner/examples.txt +0 -2
- data/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb +0 -37
- data/vendor/plugins/rspec/spec/spec/runner/failed.txt +0 -3
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +0 -33
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +0 -365
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +0 -387
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +0 -381
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +0 -66
- data/vendor/plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +0 -65
- data/vendor/plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +0 -137
- data/vendor/plugins/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +0 -18
- data/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +0 -103
- data/vendor/plugins/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +0 -129
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +0 -61
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +0 -335
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +0 -365
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +0 -78
- data/vendor/plugins/rspec/spec/spec/runner/heckler_spec.rb +0 -13
- data/vendor/plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/runner/option_parser_spec.rb +0 -384
- data/vendor/plugins/rspec/spec/spec/runner/options_spec.rb +0 -386
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture.rb +0 -7
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +0 -8
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_spec.rb +0 -16
- data/vendor/plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +0 -56
- data/vendor/plugins/rspec/spec/spec/runner/reporter_spec.rb +0 -192
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_bar.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_foo.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_spec.rb +0 -1
- data/vendor/plugins/rspec/spec/spec/runner/spec.opts +0 -2
- data/vendor/plugins/rspec/spec/spec/runner/spec_drb.opts +0 -1
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser/spec_parser_fixture.rb +0 -70
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser_spec.rb +0 -79
- data/vendor/plugins/rspec/spec/spec/runner/spec_spaced.opts +0 -2
- data/vendor/plugins/rspec/spec/spec/runner_spec.rb +0 -11
- data/vendor/plugins/rspec/spec/spec/spec_classes.rb +0 -133
- data/vendor/plugins/rspec/spec/spec/story/builders.rb +0 -46
- data/vendor/plugins/rspec/spec/spec/story/extensions/main_spec.rb +0 -161
- data/vendor/plugins/rspec/spec/spec/story/extensions_spec.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/story/given_scenario_spec.rb +0 -27
- data/vendor/plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +0 -92
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +0 -27
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +0 -191
- data/vendor/plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +0 -133
- data/vendor/plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +0 -384
- data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +0 -294
- data/vendor/plugins/rspec/spec/spec/story/runner_spec.rb +0 -106
- data/vendor/plugins/rspec/spec/spec/story/scenario_spec.rb +0 -20
- data/vendor/plugins/rspec/spec/spec/story/step_group_spec.rb +0 -157
- data/vendor/plugins/rspec/spec/spec/story/step_mother_spec.rb +0 -72
- data/vendor/plugins/rspec/spec/spec/story/step_spec.rb +0 -200
- data/vendor/plugins/rspec/spec/spec/story/story_helper.rb +0 -2
- data/vendor/plugins/rspec/spec/spec/story/story_spec.rb +0 -86
- data/vendor/plugins/rspec/spec/spec/story/world_spec.rb +0 -423
- data/vendor/plugins/rspec/spec/spec/translator_spec.rb +0 -265
- data/vendor/plugins/rspec/spec/spec_helper.rb +0 -103
- data/vendor/plugins/rspec/stories/all.rb +0 -5
- data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +0 -45
- data/vendor/plugins/rspec/stories/example_groups/example_group_with_should_methods +0 -17
- data/vendor/plugins/rspec/stories/example_groups/nested_groups +0 -17
- data/vendor/plugins/rspec/stories/example_groups/output +0 -25
- data/vendor/plugins/rspec/stories/example_groups/stories.rb +0 -7
- data/vendor/plugins/rspec/stories/helper.rb +0 -6
- data/vendor/plugins/rspec/stories/interop/examples_and_tests_together +0 -30
- data/vendor/plugins/rspec/stories/interop/stories.rb +0 -7
- data/vendor/plugins/rspec/stories/interop/test_case_with_should_methods +0 -17
- data/vendor/plugins/rspec/stories/pending_stories/README +0 -3
- data/vendor/plugins/rspec/stories/resources/helpers/cmdline.rb +0 -9
- data/vendor/plugins/rspec/stories/resources/helpers/story_helper.rb +0 -16
- data/vendor/plugins/rspec/stories/resources/matchers/smart_match.rb +0 -37
- data/vendor/plugins/rspec/stories/resources/spec/example_group_with_should_methods.rb +0 -12
- data/vendor/plugins/rspec/stories/resources/spec/simple_spec.rb +0 -8
- data/vendor/plugins/rspec/stories/resources/steps/running_rspec.rb +0 -50
- data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +0 -15
- data/vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb +0 -57
- data/vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +0 -30
- data/vendor/plugins/rspec/story_server/prototype/javascripts/builder.js +0 -136
- data/vendor/plugins/rspec/story_server/prototype/javascripts/controls.js +0 -972
- data/vendor/plugins/rspec/story_server/prototype/javascripts/dragdrop.js +0 -976
- data/vendor/plugins/rspec/story_server/prototype/javascripts/effects.js +0 -1117
- data/vendor/plugins/rspec/story_server/prototype/javascripts/prototype.js +0 -4140
- data/vendor/plugins/rspec/story_server/prototype/javascripts/rspec.js +0 -149
- data/vendor/plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +0 -58
- data/vendor/plugins/rspec/story_server/prototype/javascripts/slider.js +0 -276
- data/vendor/plugins/rspec/story_server/prototype/javascripts/sound.js +0 -55
- data/vendor/plugins/rspec/story_server/prototype/javascripts/unittest.js +0 -568
- data/vendor/plugins/rspec/story_server/prototype/lib/server.rb +0 -24
- data/vendor/plugins/rspec/story_server/prototype/stories.html +0 -176
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/rspec.css +0 -136
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/test.css +0 -90
- data/vendor/plugins/rspec_on_rails/MIT-LICENSE +0 -31
- data/vendor/plugins/rspec_on_rails/README +0 -3
- data/vendor/plugins/rspec_on_rails/Rakefile +0 -9
- data/vendor/plugins/rspec_on_rails/generators/rspec/CHANGES +0 -1
- data/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb +0 -35
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/all_stories.rb +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/previous_failures.txt +0 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +0 -2
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +0 -102
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb +0 -39
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/stories_helper.rb +0 -3
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/USAGE +0 -33
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/rspec_controller_generator.rb +0 -49
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb +0 -25
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +0 -12
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/USAGE +0 -18
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb +0 -30
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +0 -167
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +0 -313
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +0 -25
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +0 -22
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +0 -26
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +0 -61
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +0 -22
- data/vendor/plugins/rspec_on_rails/init.rb +0 -9
- data/vendor/plugins/rspec_on_rails/lib/autotest/discover.rb +0 -1
- data/vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +0 -81
- data/vendor/plugins/rspec_on_rails/lib/spec/rails.rb +0 -51
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb +0 -46
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb +0 -43
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +0 -269
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb +0 -59
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +0 -130
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/model_example_group.rb +0 -14
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +0 -98
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +0 -90
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +0 -178
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb +0 -12
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +0 -14
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/rescue.rb +0 -21
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb +0 -11
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb +0 -27
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb +0 -30
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/object.rb +0 -5
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb +0 -66
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +0 -21
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb +0 -29
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +0 -130
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +0 -55
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb +0 -113
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +0 -70
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +0 -71
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +0 -23
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +0 -36
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb +0 -8
- data/vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb +0 -60
- data/vendor/plugins/rspec_on_rails/spec/rails/example/configuration_spec.rb +0 -83
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +0 -43
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +0 -195
- data/vendor/plugins/rspec_on_rails/spec/rails/example/example_group_factory_spec.rb +0 -112
- data/vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +0 -133
- data/vendor/plugins/rspec_on_rails/spec/rails/example/model_spec_spec.rb +0 -18
- data/vendor/plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +0 -16
- data/vendor/plugins/rspec_on_rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +0 -33
- data/vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +0 -264
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +0 -54
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +0 -48
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +0 -14
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +0 -783
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +0 -37
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb +0 -13
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +0 -62
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +0 -209
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +0 -169
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/ar_classes.rb +0 -10
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +0 -55
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/stub_model_spec.rb +0 -54
- data/vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb +0 -7
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb +0 -89
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/spec/rails_suite.rb +0 -7
- data/vendor/plugins/rspec_on_rails/spec/spec_helper.rb +0 -46
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/action_view_base_spec_controller.rb +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +0 -68
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +0 -59
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +0 -26
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +0 -58
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +0 -10
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/more_explicit_helper.rb +0 -5
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/plugin_application_helper.rb +0 -6
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/view_spec_helper.rb +0 -13
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/_partial.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_template.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/_a_partial.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.js.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_div.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_page_element.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/insert_html.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_effect.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/no_tags.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_used_twice.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_local_variable.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_spacer.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/entry_form.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/explicit_helper.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/foo/show.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/implicit_helper.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/multiple_helpers.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial.rhtml +0 -5
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/stories/all.rb +0 -10
- data/vendor/plugins/rspec_on_rails/stories/helper.rb +0 -5
- data/vendor/plugins/rspec_on_rails/stories/steps/people.rb +0 -8
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback +0 -15
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb +0 -25
- data/vendor/plugins/rspec_on_rails/tasks/rspec.rake +0 -137
- data/vendor/plugins/scenarios/README +0 -262
- data/vendor/plugins/scenarios/Rakefile +0 -66
- data/vendor/plugins/scenarios/TODO +0 -1
- data/vendor/plugins/scenarios/lib/scenarios.rb +0 -34
- data/vendor/plugins/scenarios/lib/scenarios/base.rb +0 -73
- data/vendor/plugins/scenarios/lib/scenarios/builtin/blank_scenario.rb +0 -18
- data/vendor/plugins/scenarios/lib/scenarios/configuration.rb +0 -55
- data/vendor/plugins/scenarios/lib/scenarios/extensions.rb +0 -5
- data/vendor/plugins/scenarios/lib/scenarios/extensions/active_record.rb +0 -14
- data/vendor/plugins/scenarios/lib/scenarios/extensions/delegating_attributes.rb +0 -40
- data/vendor/plugins/scenarios/lib/scenarios/extensions/object.rb +0 -5
- data/vendor/plugins/scenarios/lib/scenarios/extensions/string.rb +0 -22
- data/vendor/plugins/scenarios/lib/scenarios/extensions/symbol.rb +0 -14
- data/vendor/plugins/scenarios/lib/scenarios/extensions/test_case.rb +0 -76
- data/vendor/plugins/scenarios/lib/scenarios/loading.rb +0 -51
- data/vendor/plugins/scenarios/lib/scenarios/table_blasting.rb +0 -20
- data/vendor/plugins/scenarios/lib/scenarios/table_methods.rb +0 -205
- data/vendor/plugins/scenarios/spec/scenarios/complex_composite_scenario.rb +0 -9
- data/vendor/plugins/scenarios/spec/scenarios/composite_scenario.rb +0 -9
- data/vendor/plugins/scenarios/spec/scenarios/empty_scenario.rb +0 -4
- data/vendor/plugins/scenarios/spec/scenarios/people_scenario.rb +0 -26
- data/vendor/plugins/scenarios/spec/scenarios/places_scenario.rb +0 -22
- data/vendor/plugins/scenarios/spec/scenarios/things_scenario.rb +0 -22
- data/vendor/plugins/scenarios/spec/scenarios_spec.rb +0 -189
- data/vendor/plugins/scenarios/spec/spec_helper.rb +0 -6
- data/vendor/plugins/scenarios/tasks/scenario.rake +0 -21
- data/vendor/plugins/scenarios/test/scenarios_test.rb +0 -39
- data/vendor/plugins/scenarios/test/test_helper.rb +0 -5
- data/vendor/plugins/scenarios/testing/application.rb +0 -2
- data/vendor/plugins/scenarios/testing/database.yml +0 -9
- data/vendor/plugins/scenarios/testing/environment.rb +0 -68
- data/vendor/plugins/scenarios/testing/library.rb +0 -128
- data/vendor/plugins/scenarios/testing/models.rb +0 -14
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3014.patch +0 -52
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3119.patch +0 -53
- data/vendor/plugins/scenarios/testing/schema.rb +0 -31
- data/vendor/rails/Rakefile +0 -21
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb +0 -4
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile +0 -19
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb +0 -245
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb +0 -47
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb +0 -52
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb +0 -39
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb +0 -71
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb +0 -67
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb +0 -481
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/facade.rb +0 -552
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb +0 -931
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/info.rb +0 -35
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb +0 -540
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/loader.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb +0 -462
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb +0 -435
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mbox.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb +0 -282
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb +0 -137
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb +0 -1475
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y +0 -381
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb +0 -142
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb +0 -43
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb +0 -263
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb +0 -279
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/tmail.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb +0 -281
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb +0 -38
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string +0 -1
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/routing_optimisation.rb +0 -119
- data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +0 -69
- data/vendor/rails/actionpack/test/action_view_test.rb +0 -44
- data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +0 -47
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +0 -193
- data/vendor/rails/activemodel/CHANGES +0 -12
- data/vendor/rails/activemodel/README +0 -21
- data/vendor/rails/activemodel/Rakefile +0 -4
- data/vendor/rails/activemodel/lib/active_model.rb +0 -17
- data/vendor/rails/activemodel/lib/active_model/base.rb +0 -4
- data/vendor/rails/activemodel/lib/active_model/callbacks.rb +0 -5
- data/vendor/rails/activemodel/lib/active_model/observing.rb +0 -100
- data/vendor/rails/activemodel/lib/active_model/validations.rb +0 -4
- data/vendor/rails/activemodel/spec/observing_spec.rb +0 -120
- data/vendor/rails/activemodel/spec/spec_helper.rb +0 -17
- data/vendor/rails/activerecord/MIT-LICENSE +0 -20
- data/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +0 -362
- data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +0 -72
- data/vendor/rails/activerecord/test/abstract_unit.rb +0 -84
- data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +0 -43
- data/vendor/rails/activerecord/test/adapter_test.rb +0 -105
- data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +0 -95
- data/vendor/rails/activerecord/test/aggregations_test.rb +0 -128
- data/vendor/rails/activerecord/test/all.sh +0 -8
- data/vendor/rails/activerecord/test/ar_schema_test.rb +0 -33
- data/vendor/rails/activerecord/test/association_inheritance_reload.rb +0 -14
- data/vendor/rails/activerecord/test/associations/callbacks_test.rb +0 -147
- data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +0 -110
- data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +0 -145
- data/vendor/rails/activerecord/test/associations/eager_test.rb +0 -442
- data/vendor/rails/activerecord/test/associations/extension_test.rb +0 -47
- data/vendor/rails/activerecord/test/associations/inner_join_association_test.rb +0 -88
- data/vendor/rails/activerecord/test/associations/join_model_test.rb +0 -559
- data/vendor/rails/activerecord/test/associations_test.rb +0 -2147
- data/vendor/rails/activerecord/test/attribute_methods_test.rb +0 -146
- data/vendor/rails/activerecord/test/base_test.rb +0 -1745
- data/vendor/rails/activerecord/test/binary_test.rb +0 -32
- data/vendor/rails/activerecord/test/calculations_test.rb +0 -251
- data/vendor/rails/activerecord/test/callbacks_test.rb +0 -400
- data/vendor/rails/activerecord/test/class_inheritable_attributes_test.rb +0 -32
- data/vendor/rails/activerecord/test/column_alias_test.rb +0 -17
- data/vendor/rails/activerecord/test/connection_test_firebird.rb +0 -8
- data/vendor/rails/activerecord/test/connection_test_mysql.rb +0 -30
- data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +0 -69
- data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +0 -203
- data/vendor/rails/activerecord/test/date_time_test.rb +0 -37
- data/vendor/rails/activerecord/test/default_test_firebird.rb +0 -16
- data/vendor/rails/activerecord/test/defaults_test.rb +0 -67
- data/vendor/rails/activerecord/test/deprecated_finder_test.rb +0 -30
- data/vendor/rails/activerecord/test/finder_test.rb +0 -650
- data/vendor/rails/activerecord/test/fixtures/author.rb +0 -109
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_numeric_first_char +0 -1
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_spaces +0 -1
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/blank_line +0 -3
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/duplicate_attributes +0 -3
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/missing_value +0 -1
- data/vendor/rails/activerecord/test/fixtures/category.rb +0 -26
- data/vendor/rails/activerecord/test/fixtures/comment.rb +0 -23
- data/vendor/rails/activerecord/test/fixtures/company.rb +0 -114
- data/vendor/rails/activerecord/test/fixtures/company_in_module.rb +0 -59
- data/vendor/rails/activerecord/test/fixtures/computer.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/contact.rb +0 -16
- data/vendor/rails/activerecord/test/fixtures/customer.rb +0 -55
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +0 -235
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +0 -65
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +0 -310
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.sql +0 -6
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +0 -273
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.drop.sql +0 -1
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +0 -318
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.sql +0 -7
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +0 -67
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +0 -330
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.sql +0 -6
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +0 -44
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +0 -292
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +0 -354
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema2.rb +0 -11
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +0 -219
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +0 -35
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +0 -222
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.drop.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/developer.rb +0 -72
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_action_controller +0 -3
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_active_record +0 -3
- data/vendor/rails/activerecord/test/fixtures/developers_projects/jamis_active_record +0 -2
- data/vendor/rails/activerecord/test/fixtures/migrations/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations/2_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/2_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1000_people_have_middle_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/3_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/order.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/person.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/pirate.rb +0 -5
- data/vendor/rails/activerecord/test/fixtures/post.rb +0 -59
- data/vendor/rails/activerecord/test/fixtures/project.rb +0 -28
- data/vendor/rails/activerecord/test/fixtures/reply.rb +0 -37
- data/vendor/rails/activerecord/test/fixtures/subscriber.rb +0 -6
- data/vendor/rails/activerecord/test/fixtures/subscribers/first +0 -2
- data/vendor/rails/activerecord/test/fixtures/subscribers/second +0 -2
- data/vendor/rails/activerecord/test/fixtures/topic.rb +0 -37
- data/vendor/rails/activerecord/test/fixtures/treasure.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures_test.rb +0 -602
- data/vendor/rails/activerecord/test/inheritance_test.rb +0 -211
- data/vendor/rails/activerecord/test/json_serialization_test.rb +0 -180
- data/vendor/rails/activerecord/test/lifecycle_test.rb +0 -137
- data/vendor/rails/activerecord/test/locking_test.rb +0 -282
- data/vendor/rails/activerecord/test/method_scoping_test.rb +0 -416
- data/vendor/rails/activerecord/test/migration_test.rb +0 -933
- data/vendor/rails/activerecord/test/migration_test_firebird.rb +0 -124
- data/vendor/rails/activerecord/test/mixin_test.rb +0 -95
- data/vendor/rails/activerecord/test/modules_test.rb +0 -34
- data/vendor/rails/activerecord/test/multiple_db_test.rb +0 -60
- data/vendor/rails/activerecord/test/pk_test.rb +0 -101
- data/vendor/rails/activerecord/test/query_cache_test.rb +0 -104
- data/vendor/rails/activerecord/test/readonly_test.rb +0 -107
- data/vendor/rails/activerecord/test/reflection_test.rb +0 -175
- data/vendor/rails/activerecord/test/reserved_word_test_mysql.rb +0 -177
- data/vendor/rails/activerecord/test/schema_authorization_test_postgresql.rb +0 -75
- data/vendor/rails/activerecord/test/schema_dumper_test.rb +0 -131
- data/vendor/rails/activerecord/test/schema_test_postgresql.rb +0 -64
- data/vendor/rails/activerecord/test/serialization_test.rb +0 -47
- data/vendor/rails/activerecord/test/synonym_test_oracle.rb +0 -17
- data/vendor/rails/activerecord/test/table_name_test_sqlserver.rb +0 -23
- data/vendor/rails/activerecord/test/threaded_connections_test.rb +0 -48
- data/vendor/rails/activerecord/test/transactions_test.rb +0 -281
- data/vendor/rails/activerecord/test/unconnected_test.rb +0 -32
- data/vendor/rails/activerecord/test/validations_test.rb +0 -1395
- data/vendor/rails/activerecord/test/xml_serialization_test.rb +0 -202
- data/vendor/rails/activeresource/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/Rakefile +0 -83
- data/vendor/rails/activesupport/install.rb +0 -30
- data/vendor/rails/activesupport/lib/active_support/testing.rb +0 -1
- data/vendor/rails/activesupport/test/abstract_unit.rb +0 -20
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
- data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
- data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
- data/vendor/rails/activesupport/test/buffered_logger_test.rb +0 -107
- data/vendor/rails/activesupport/test/clean_logger_test.rb +0 -57
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -250
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -19
- data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
- data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
- data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -224
- data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +0 -105
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -46
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -196
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -230
- data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +0 -22
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -21
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -61
- data/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -64
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -29
- data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +0 -25
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -743
- data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
- data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
- data/vendor/rails/activesupport/test/core_ext/load_error_tests.rb +0 -16
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
- data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
- data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
- data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -58
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -293
- data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -24
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -147
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -242
- data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
- data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -63
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -180
- data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -420
- data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
- data/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies_test.rb +0 -751
- data/vendor/rails/activesupport/test/deprecation_test.rb +0 -151
- data/vendor/rails/activesupport/test/inflector_test.rb +0 -248
- data/vendor/rails/activesupport/test/inflector_test_cases.rb +0 -208
- data/vendor/rails/activesupport/test/json/decoding_test.rb +0 -41
- data/vendor/rails/activesupport/test/json/encoding_test.rb +0 -111
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -173
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -141
- data/vendor/rails/activesupport/test/multibyte_handler_test.rb +0 -367
- data/vendor/rails/activesupport/test/option_merger_test.rb +0 -50
- data/vendor/rails/activesupport/test/ordered_options_test.rb +0 -84
- data/vendor/rails/activesupport/test/test_test.rb +0 -73
- data/vendor/rails/activesupport/test/time_zone_test.rb +0 -98
- data/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -38
- data/vendor/rails/cleanlogs.sh +0 -1
- data/vendor/rails/pushgems.rb +0 -15
- data/vendor/rails/railties/lib/tasks/tmp.rake +0 -37
- data/vendor/rails/railties/test/abstract_unit.rb +0 -24
- data/vendor/rails/railties/test/boot_test.rb +0 -179
- data/vendor/rails/railties/test/console_app_test.rb +0 -29
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -265
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
- data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
- data/vendor/rails/railties/test/generators/generator_test_helper.rb +0 -195
- data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +0 -109
- data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +0 -106
- data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +0 -185
- data/vendor/rails/railties/test/initializer_test.rb +0 -218
- data/vendor/rails/railties/test/mocks/routes.rb +0 -6
- data/vendor/rails/railties/test/plugin_loader_test.rb +0 -140
- data/vendor/rails/railties/test/plugin_locator_test.rb +0 -69
- data/vendor/rails/railties/test/plugin_test.rb +0 -141
- data/vendor/rails/railties/test/plugin_test_helper.rb +0 -29
- data/vendor/rails/railties/test/rails_generator_test.rb +0 -137
- data/vendor/rails/railties/test/rails_info_controller_test.rb +0 -48
- data/vendor/rails/railties/test/rails_info_test.rb +0 -105
- data/vendor/rails/railties/test/secret_key_generation_test.rb +0 -35
- data/vendor/rails/release.rb +0 -25
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2004-
|
2
|
+
# Copyright (c) 2004-2008 David Heinemeier Hansson
|
3
3
|
#
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
# a copy of this software and associated documentation files (the
|
@@ -24,25 +24,25 @@
|
|
24
24
|
$:.unshift(File.dirname(__FILE__)) unless
|
25
25
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
require 'active_support'
|
36
|
-
end
|
27
|
+
active_support_path = File.dirname(__FILE__) + "/../../activesupport/lib"
|
28
|
+
if File.exist?(active_support_path)
|
29
|
+
$:.unshift active_support_path
|
30
|
+
require 'active_support'
|
31
|
+
else
|
32
|
+
require 'rubygems'
|
33
|
+
gem 'activesupport'
|
34
|
+
require 'active_support'
|
37
35
|
end
|
38
36
|
|
39
37
|
require 'active_record/base'
|
38
|
+
require 'active_record/named_scope'
|
40
39
|
require 'active_record/observer'
|
41
40
|
require 'active_record/query_cache'
|
42
41
|
require 'active_record/validations'
|
43
42
|
require 'active_record/callbacks'
|
44
43
|
require 'active_record/reflection'
|
45
44
|
require 'active_record/associations'
|
45
|
+
require 'active_record/association_preload'
|
46
46
|
require 'active_record/aggregations'
|
47
47
|
require 'active_record/transactions'
|
48
48
|
require 'active_record/timestamp'
|
@@ -53,22 +53,26 @@ require 'active_record/schema'
|
|
53
53
|
require 'active_record/calculations'
|
54
54
|
require 'active_record/serialization'
|
55
55
|
require 'active_record/attribute_methods'
|
56
|
+
require 'active_record/dirty'
|
56
57
|
|
57
58
|
ActiveRecord::Base.class_eval do
|
58
59
|
extend ActiveRecord::QueryCache
|
59
60
|
include ActiveRecord::Validations
|
60
61
|
include ActiveRecord::Locking::Optimistic
|
61
62
|
include ActiveRecord::Locking::Pessimistic
|
63
|
+
include ActiveRecord::AttributeMethods
|
64
|
+
include ActiveRecord::Dirty
|
62
65
|
include ActiveRecord::Callbacks
|
63
66
|
include ActiveRecord::Observing
|
64
67
|
include ActiveRecord::Timestamp
|
65
68
|
include ActiveRecord::Associations
|
69
|
+
include ActiveRecord::NamedScope
|
70
|
+
include ActiveRecord::AssociationPreload
|
66
71
|
include ActiveRecord::Aggregations
|
67
72
|
include ActiveRecord::Transactions
|
68
73
|
include ActiveRecord::Reflection
|
69
74
|
include ActiveRecord::Calculations
|
70
75
|
include ActiveRecord::Serialization
|
71
|
-
include ActiveRecord::AttributeMethods
|
72
76
|
end
|
73
77
|
|
74
78
|
require 'active_record/connection_adapters/abstract_adapter'
|
@@ -92,30 +92,39 @@ module ActiveRecord
|
|
92
92
|
#
|
93
93
|
# == Writing value objects
|
94
94
|
#
|
95
|
-
# Value objects are immutable and interchangeable objects that represent a given value, such as a
|
96
|
-
# $5. Two
|
97
|
-
# makes sense). This is unlike entity objects where equality is determined by identity. An entity class such as
|
95
|
+
# Value objects are immutable and interchangeable objects that represent a given value, such as a Money object representing
|
96
|
+
# $5. Two Money objects both representing $5 should be equal (through methods such as <tt>==</tt> and <tt><=></tt> from Comparable if ranking
|
97
|
+
# makes sense). This is unlike entity objects where equality is determined by identity. An entity class such as Customer can
|
98
98
|
# easily have two different objects that both have an address on Hyancintvej. Entity identity is determined by object or
|
99
|
-
# relational unique identifiers (such as primary keys). Normal
|
99
|
+
# relational unique identifiers (such as primary keys). Normal ActiveRecord::Base classes are entity objects.
|
100
100
|
#
|
101
|
-
# It's also important to treat the value objects as immutable. Don't allow the
|
102
|
-
# creation. Create a new
|
101
|
+
# It's also important to treat the value objects as immutable. Don't allow the Money object to have its amount changed after
|
102
|
+
# creation. Create a new Money object with the new value instead. This is exemplified by the Money#exchanged_to method that
|
103
103
|
# returns a new value object instead of changing its own values. Active Record won't persist value objects that have been
|
104
104
|
# changed through means other than the writer method.
|
105
105
|
#
|
106
106
|
# The immutable requirement is enforced by Active Record by freezing any object assigned as a value object. Attempting to
|
107
|
-
# change it afterwards will result in a
|
107
|
+
# change it afterwards will result in a ActiveSupport::FrozenObjectError.
|
108
108
|
#
|
109
109
|
# Read more about value objects on http://c2.com/cgi/wiki?ValueObject and on the dangers of not keeping value objects
|
110
110
|
# immutable on http://c2.com/cgi/wiki?ValueObjectsShouldBeImmutable
|
111
|
+
#
|
112
|
+
# == Finding records by a value object
|
113
|
+
#
|
114
|
+
# Once a +composed_of+ relationship is specified for a model, records can be loaded from the database by specifying an instance
|
115
|
+
# of the value object in the conditions hash. The following example finds all customers with +balance_amount+ equal to 20 and
|
116
|
+
# +balance_currency+ equal to "USD":
|
117
|
+
#
|
118
|
+
# Customer.find(:all, :conditions => {:balance => Money.new(20, "USD")})
|
119
|
+
#
|
111
120
|
module ClassMethods
|
112
121
|
# Adds reader and writer methods for manipulating a value object:
|
113
122
|
# <tt>composed_of :address</tt> adds <tt>address</tt> and <tt>address=(new_address)</tt> methods.
|
114
123
|
#
|
115
124
|
# Options are:
|
116
125
|
# * <tt>:class_name</tt> - specify the class name of the association. Use it only if that name can't be inferred
|
117
|
-
# from the part id. So <tt>composed_of :address</tt> will by default be linked to the
|
118
|
-
# if the real class name is
|
126
|
+
# from the part id. So <tt>composed_of :address</tt> will by default be linked to the Address class, but
|
127
|
+
# if the real class name is CompanyAddress, you'll have to specify it with this option.
|
119
128
|
# * <tt>:mapping</tt> - specifies a number of mapping arrays (attribute, parameter) that bind an attribute name
|
120
129
|
# to a constructor parameter on the value class.
|
121
130
|
# * <tt>:allow_nil</tt> - specifies that the aggregate object will not be instantiated when all mapped
|
@@ -155,7 +164,7 @@ module ActiveRecord
|
|
155
164
|
if (instance_variable_get("@#{name}").nil? || force_reload) && (!allow_nil || mapping.any? {|pair| !read_attribute(pair.first).nil? })
|
156
165
|
instance_variable_set("@#{name}", class_name.constantize.new(*mapping.collect {|pair| read_attribute(pair.first)}))
|
157
166
|
end
|
158
|
-
|
167
|
+
instance_variable_get("@#{name}")
|
159
168
|
end
|
160
169
|
end
|
161
170
|
|
@@ -165,11 +174,11 @@ module ActiveRecord
|
|
165
174
|
module_eval do
|
166
175
|
define_method("#{name}=") do |part|
|
167
176
|
if part.nil? && allow_nil
|
168
|
-
mapping.each { |pair|
|
177
|
+
mapping.each { |pair| self[pair.first] = nil }
|
169
178
|
instance_variable_set("@#{name}", nil)
|
170
179
|
else
|
171
180
|
part = conversion.call(part) unless part.is_a?(class_name.constantize) || conversion.nil?
|
172
|
-
mapping.each { |pair|
|
181
|
+
mapping.each { |pair| self[pair.first] = part.send(pair.last) }
|
173
182
|
instance_variable_set("@#{name}", part.freeze)
|
174
183
|
end
|
175
184
|
end
|
@@ -0,0 +1,285 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module AssociationPreload #:nodoc:
|
3
|
+
def self.included(base)
|
4
|
+
base.extend(ClassMethods)
|
5
|
+
end
|
6
|
+
|
7
|
+
module ClassMethods
|
8
|
+
|
9
|
+
# Loads the named associations for the activerecord record (or records) given
|
10
|
+
# preload_options is passed only one level deep: don't pass to the child associations when associations is a Hash
|
11
|
+
protected
|
12
|
+
def preload_associations(records, associations, preload_options={})
|
13
|
+
records = [records].flatten.compact.uniq
|
14
|
+
return if records.empty?
|
15
|
+
case associations
|
16
|
+
when Array then associations.each {|association| preload_associations(records, association, preload_options)}
|
17
|
+
when Symbol, String then preload_one_association(records, associations.to_sym, preload_options)
|
18
|
+
when Hash then
|
19
|
+
associations.each do |parent, child|
|
20
|
+
raise "parent must be an association name" unless parent.is_a?(String) || parent.is_a?(Symbol)
|
21
|
+
preload_associations(records, parent, preload_options)
|
22
|
+
reflection = reflections[parent]
|
23
|
+
parents = records.map {|record| record.send(reflection.name)}.flatten
|
24
|
+
unless parents.empty? || parents.first.nil?
|
25
|
+
parents.first.class.preload_associations(parents, child)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def preload_one_association(records, association, preload_options={})
|
34
|
+
class_to_reflection = {}
|
35
|
+
# Not all records have the same class, so group then preload
|
36
|
+
# group on the reflection itself so that if various subclass share the same association then we do not split them
|
37
|
+
# unncessarily
|
38
|
+
records.group_by {|record| class_to_reflection[record.class] ||= record.class.reflections[association]}.each do |reflection, records|
|
39
|
+
raise ConfigurationError, "Association named '#{ association }' was not found; perhaps you misspelled it?" unless reflection
|
40
|
+
send("preload_#{reflection.macro}_association", records, reflection, preload_options)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def add_preloaded_records_to_collection(parent_records, reflection_name, associated_record)
|
45
|
+
parent_records.each do |parent_record|
|
46
|
+
association_proxy = parent_record.send(reflection_name)
|
47
|
+
association_proxy.loaded
|
48
|
+
association_proxy.target.push(*[associated_record].flatten)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def add_preloaded_record_to_collection(parent_records, reflection_name, associated_record)
|
53
|
+
parent_records.each do |parent_record|
|
54
|
+
parent_record.send("set_#{reflection_name}_target", associated_record)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def set_association_collection_records(id_to_record_map, reflection_name, associated_records, key)
|
59
|
+
associated_records.each do |associated_record|
|
60
|
+
mapped_records = id_to_record_map[associated_record[key].to_s]
|
61
|
+
add_preloaded_records_to_collection(mapped_records, reflection_name, associated_record)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def set_association_single_records(id_to_record_map, reflection_name, associated_records, key)
|
66
|
+
seen_keys = {}
|
67
|
+
associated_records.each do |associated_record|
|
68
|
+
#this is a has_one or belongs_to: there should only be one record.
|
69
|
+
#Unfortunately we can't (in portable way) ask the database for 'all records where foo_id in (x,y,z), but please
|
70
|
+
# only one row per distinct foo_id' so this where we enforce that
|
71
|
+
next if seen_keys[associated_record[key].to_s]
|
72
|
+
seen_keys[associated_record[key].to_s] = true
|
73
|
+
mapped_records = id_to_record_map[associated_record[key].to_s]
|
74
|
+
mapped_records.each do |mapped_record|
|
75
|
+
mapped_record.send("set_#{reflection_name}_target", associated_record)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def construct_id_map(records)
|
81
|
+
id_to_record_map = {}
|
82
|
+
ids = []
|
83
|
+
records.each do |record|
|
84
|
+
ids << record.id
|
85
|
+
mapped_records = (id_to_record_map[record.id.to_s] ||= [])
|
86
|
+
mapped_records << record
|
87
|
+
end
|
88
|
+
ids.uniq!
|
89
|
+
return id_to_record_map, ids
|
90
|
+
end
|
91
|
+
|
92
|
+
def preload_has_and_belongs_to_many_association(records, reflection, preload_options={})
|
93
|
+
table_name = reflection.klass.quoted_table_name
|
94
|
+
id_to_record_map, ids = construct_id_map(records)
|
95
|
+
records.each {|record| record.send(reflection.name).loaded}
|
96
|
+
options = reflection.options
|
97
|
+
|
98
|
+
conditions = "t0.#{reflection.primary_key_name} #{in_or_equals_for_ids(ids)}"
|
99
|
+
conditions << append_conditions(reflection, preload_options)
|
100
|
+
|
101
|
+
associated_records = reflection.klass.find(:all, :conditions => [conditions, ids],
|
102
|
+
:include => options[:include],
|
103
|
+
:joins => "INNER JOIN #{connection.quote_table_name options[:join_table]} as t0 ON #{reflection.klass.quoted_table_name}.#{reflection.klass.primary_key} = t0.#{reflection.association_foreign_key}",
|
104
|
+
:select => "#{options[:select] || table_name+'.*'}, t0.#{reflection.primary_key_name} as the_parent_record_id",
|
105
|
+
:order => options[:order])
|
106
|
+
|
107
|
+
set_association_collection_records(id_to_record_map, reflection.name, associated_records, 'the_parent_record_id')
|
108
|
+
end
|
109
|
+
|
110
|
+
def preload_has_one_association(records, reflection, preload_options={})
|
111
|
+
id_to_record_map, ids = construct_id_map(records)
|
112
|
+
options = reflection.options
|
113
|
+
records.each {|record| record.send("set_#{reflection.name}_target", nil)}
|
114
|
+
if options[:through]
|
115
|
+
through_records = preload_through_records(records, reflection, options[:through])
|
116
|
+
through_reflection = reflections[options[:through]]
|
117
|
+
through_primary_key = through_reflection.primary_key_name
|
118
|
+
unless through_records.empty?
|
119
|
+
source = reflection.source_reflection.name
|
120
|
+
through_records.first.class.preload_associations(through_records, source)
|
121
|
+
through_records.each do |through_record|
|
122
|
+
add_preloaded_record_to_collection(id_to_record_map[through_record[through_primary_key].to_s],
|
123
|
+
reflection.name, through_record.send(source))
|
124
|
+
end
|
125
|
+
end
|
126
|
+
else
|
127
|
+
set_association_single_records(id_to_record_map, reflection.name, find_associated_records(ids, reflection, preload_options), reflection.primary_key_name)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
def preload_has_many_association(records, reflection, preload_options={})
|
132
|
+
id_to_record_map, ids = construct_id_map(records)
|
133
|
+
records.each {|record| record.send(reflection.name).loaded}
|
134
|
+
options = reflection.options
|
135
|
+
|
136
|
+
if options[:through]
|
137
|
+
through_records = preload_through_records(records, reflection, options[:through])
|
138
|
+
through_reflection = reflections[options[:through]]
|
139
|
+
through_primary_key = through_reflection.primary_key_name
|
140
|
+
unless through_records.empty?
|
141
|
+
source = reflection.source_reflection.name
|
142
|
+
#add conditions from reflection!
|
143
|
+
through_records.first.class.preload_associations(through_records, source, reflection.options)
|
144
|
+
through_records.each do |through_record|
|
145
|
+
add_preloaded_records_to_collection(id_to_record_map[through_record[through_primary_key].to_s],
|
146
|
+
reflection.name, through_record.send(source))
|
147
|
+
end
|
148
|
+
end
|
149
|
+
else
|
150
|
+
set_association_collection_records(id_to_record_map, reflection.name, find_associated_records(ids, reflection, preload_options),
|
151
|
+
reflection.primary_key_name)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
def preload_through_records(records, reflection, through_association)
|
156
|
+
through_reflection = reflections[through_association]
|
157
|
+
through_primary_key = through_reflection.primary_key_name
|
158
|
+
|
159
|
+
if reflection.options[:source_type]
|
160
|
+
interface = reflection.source_reflection.options[:foreign_type]
|
161
|
+
preload_options = {:conditions => ["#{connection.quote_column_name interface} = ?", reflection.options[:source_type]]}
|
162
|
+
|
163
|
+
records.compact!
|
164
|
+
records.first.class.preload_associations(records, through_association, preload_options)
|
165
|
+
|
166
|
+
# Dont cache the association - we would only be caching a subset
|
167
|
+
through_records = []
|
168
|
+
records.each do |record|
|
169
|
+
proxy = record.send(through_association)
|
170
|
+
|
171
|
+
if proxy.respond_to?(:target)
|
172
|
+
through_records << proxy.target
|
173
|
+
proxy.reset
|
174
|
+
else # this is a has_one :through reflection
|
175
|
+
through_records << proxy if proxy
|
176
|
+
end
|
177
|
+
end
|
178
|
+
through_records.flatten!
|
179
|
+
else
|
180
|
+
records.first.class.preload_associations(records, through_association)
|
181
|
+
through_records = records.map {|record| record.send(through_association)}.flatten
|
182
|
+
end
|
183
|
+
through_records.compact!
|
184
|
+
through_records
|
185
|
+
end
|
186
|
+
|
187
|
+
def preload_belongs_to_association(records, reflection, preload_options={})
|
188
|
+
options = reflection.options
|
189
|
+
primary_key_name = reflection.primary_key_name
|
190
|
+
|
191
|
+
if options[:polymorphic]
|
192
|
+
polymorph_type = options[:foreign_type]
|
193
|
+
klasses_and_ids = {}
|
194
|
+
|
195
|
+
# Construct a mapping from klass to a list of ids to load and a mapping of those ids back to their parent_records
|
196
|
+
records.each do |record|
|
197
|
+
if klass = record.send(polymorph_type)
|
198
|
+
klass_id = record.send(primary_key_name)
|
199
|
+
if klass_id
|
200
|
+
id_map = klasses_and_ids[klass] ||= {}
|
201
|
+
id_list_for_klass_id = (id_map[klass_id.to_s] ||= [])
|
202
|
+
id_list_for_klass_id << record
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
klasses_and_ids = klasses_and_ids.to_a
|
207
|
+
else
|
208
|
+
id_map = {}
|
209
|
+
records.each do |record|
|
210
|
+
key = record.send(primary_key_name)
|
211
|
+
if key
|
212
|
+
mapped_records = (id_map[key.to_s] ||= [])
|
213
|
+
mapped_records << record
|
214
|
+
end
|
215
|
+
end
|
216
|
+
klasses_and_ids = [[reflection.klass.name, id_map]]
|
217
|
+
end
|
218
|
+
|
219
|
+
klasses_and_ids.each do |klass_and_id|
|
220
|
+
klass_name, id_map = *klass_and_id
|
221
|
+
klass = klass_name.constantize
|
222
|
+
|
223
|
+
table_name = klass.quoted_table_name
|
224
|
+
primary_key = klass.primary_key
|
225
|
+
column_type = klass.columns.detect{|c| c.name == primary_key}.type
|
226
|
+
ids = id_map.keys.uniq.map do |id|
|
227
|
+
if column_type == :integer
|
228
|
+
id.to_i
|
229
|
+
elsif column_type == :float
|
230
|
+
id.to_f
|
231
|
+
else
|
232
|
+
id
|
233
|
+
end
|
234
|
+
end
|
235
|
+
conditions = "#{table_name}.#{connection.quote_column_name(primary_key)} #{in_or_equals_for_ids(ids)}"
|
236
|
+
conditions << append_conditions(reflection, preload_options)
|
237
|
+
associated_records = klass.find(:all, :conditions => [conditions, ids],
|
238
|
+
:include => options[:include],
|
239
|
+
:select => options[:select],
|
240
|
+
:joins => options[:joins],
|
241
|
+
:order => options[:order])
|
242
|
+
set_association_single_records(id_map, reflection.name, associated_records, primary_key)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
def find_associated_records(ids, reflection, preload_options)
|
247
|
+
options = reflection.options
|
248
|
+
table_name = reflection.klass.quoted_table_name
|
249
|
+
|
250
|
+
if interface = reflection.options[:as]
|
251
|
+
conditions = "#{reflection.klass.quoted_table_name}.#{connection.quote_column_name "#{interface}_id"} #{in_or_equals_for_ids(ids)} and #{reflection.klass.quoted_table_name}.#{connection.quote_column_name "#{interface}_type"} = '#{self.base_class.sti_name}'"
|
252
|
+
else
|
253
|
+
foreign_key = reflection.primary_key_name
|
254
|
+
conditions = "#{reflection.klass.quoted_table_name}.#{foreign_key} #{in_or_equals_for_ids(ids)}"
|
255
|
+
end
|
256
|
+
|
257
|
+
conditions << append_conditions(reflection, preload_options)
|
258
|
+
|
259
|
+
reflection.klass.find(:all,
|
260
|
+
:select => (preload_options[:select] || options[:select] || "#{table_name}.*"),
|
261
|
+
:include => preload_options[:include] || options[:include],
|
262
|
+
:conditions => [conditions, ids],
|
263
|
+
:joins => options[:joins],
|
264
|
+
:group => preload_options[:group] || options[:group],
|
265
|
+
:order => preload_options[:order] || options[:order])
|
266
|
+
end
|
267
|
+
|
268
|
+
|
269
|
+
def interpolate_sql_for_preload(sql)
|
270
|
+
instance_eval("%@#{sql.gsub('@', '\@')}@")
|
271
|
+
end
|
272
|
+
|
273
|
+
def append_conditions(reflection, preload_options)
|
274
|
+
sql = ""
|
275
|
+
sql << " AND (#{interpolate_sql_for_preload(reflection.sanitized_conditions)})" if reflection.sanitized_conditions
|
276
|
+
sql << " AND (#{sanitize_sql preload_options[:conditions]})" if preload_options[:conditions]
|
277
|
+
sql
|
278
|
+
end
|
279
|
+
|
280
|
+
def in_or_equals_for_ids(ids)
|
281
|
+
ids.size > 1 ? "IN (?)" : "= ?"
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
end
|
@@ -6,6 +6,7 @@ require 'active_record/associations/has_one_association'
|
|
6
6
|
require 'active_record/associations/has_many_association'
|
7
7
|
require 'active_record/associations/has_many_through_association'
|
8
8
|
require 'active_record/associations/has_and_belongs_to_many_association'
|
9
|
+
require 'active_record/associations/has_one_through_association'
|
9
10
|
|
10
11
|
module ActiveRecord
|
11
12
|
class HasManyThroughAssociationNotFoundError < ActiveRecordError #:nodoc:
|
@@ -19,13 +20,13 @@ module ActiveRecord
|
|
19
20
|
super("Cannot have a has_many :through association '#{owner_class_name}##{reflection.name}' on the polymorphic object '#{source_reflection.class_name}##{source_reflection.name}'.")
|
20
21
|
end
|
21
22
|
end
|
22
|
-
|
23
|
+
|
23
24
|
class HasManyThroughAssociationPointlessSourceTypeError < ActiveRecordError #:nodoc:
|
24
25
|
def initialize(owner_class_name, reflection, source_reflection)
|
25
26
|
super("Cannot have a has_many :through association '#{owner_class_name}##{reflection.name}' with a :source_type option if the '#{reflection.through_reflection.class_name}##{source_reflection.name}' is not polymorphic. Try removing :source_type on your association.")
|
26
27
|
end
|
27
28
|
end
|
28
|
-
|
29
|
+
|
29
30
|
class HasManyThroughSourceAssociationNotFoundError < ActiveRecordError #:nodoc:
|
30
31
|
def initialize(reflection)
|
31
32
|
through_reflection = reflection.through_reflection
|
@@ -43,6 +44,11 @@ module ActiveRecord
|
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
47
|
+
class HasManyThroughCantAssociateThroughHasManyReflection < ActiveRecordError #:nodoc:
|
48
|
+
def initialize(owner, reflection)
|
49
|
+
super("Cannot modify association '#{owner.class.name}##{reflection.name}' because the source reflection class '#{reflection.source_reflection.class_name}' is associated to '#{reflection.through_reflection.class_name}' via :#{reflection.source_reflection.macro}.")
|
50
|
+
end
|
51
|
+
end
|
46
52
|
class HasManyThroughCantAssociateNewRecords < ActiveRecordError #:nodoc:
|
47
53
|
def initialize(owner, reflection)
|
48
54
|
super("Cannot associate new records through '#{owner.class.name}##{reflection.name}' on '#{reflection.source_reflection.class_name rescue nil}##{reflection.source_reflection.name rescue nil}'. Both records must have an id in order to create the has_many :through record associating them.")
|
@@ -72,21 +78,21 @@ module ActiveRecord
|
|
72
78
|
base.extend(ClassMethods)
|
73
79
|
end
|
74
80
|
|
75
|
-
# Clears out the association cache
|
81
|
+
# Clears out the association cache
|
76
82
|
def clear_association_cache #:nodoc:
|
77
83
|
self.class.reflect_on_all_associations.to_a.each do |assoc|
|
78
84
|
instance_variable_set "@#{assoc.name}", nil
|
79
85
|
end unless self.new_record?
|
80
86
|
end
|
81
|
-
|
82
|
-
# Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like
|
83
|
-
# "Project has one Project Manager" or "Project belongs to a Portfolio". Each macro adds a number of methods to the class which are
|
84
|
-
# specialized according to the collection or association symbol and the options hash. It works much the same way as Ruby's own <tt>attr*</tt>
|
87
|
+
|
88
|
+
# Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like
|
89
|
+
# "Project has one Project Manager" or "Project belongs to a Portfolio". Each macro adds a number of methods to the class which are
|
90
|
+
# specialized according to the collection or association symbol and the options hash. It works much the same way as Ruby's own <tt>attr*</tt>
|
85
91
|
# methods. Example:
|
86
92
|
#
|
87
93
|
# class Project < ActiveRecord::Base
|
88
94
|
# belongs_to :portfolio
|
89
|
-
# has_one :project_manager
|
95
|
+
# has_one :project_manager
|
90
96
|
# has_many :milestones
|
91
97
|
# has_and_belongs_to_many :categories
|
92
98
|
# end
|
@@ -104,11 +110,11 @@ module ActiveRecord
|
|
104
110
|
#
|
105
111
|
# Don't create associations that have the same name as instance methods of ActiveRecord::Base. Since the association
|
106
112
|
# adds a method with that name to its model, it will override the inherited method and break things.
|
107
|
-
# For instance,
|
113
|
+
# For instance, +attributes+ and +connection+ would be bad choices for association names.
|
108
114
|
#
|
109
115
|
# == Auto-generated methods
|
110
116
|
#
|
111
|
-
# ===Singular associations (one-to-one)
|
117
|
+
# === Singular associations (one-to-one)
|
112
118
|
# | | belongs_to |
|
113
119
|
# generated methods | belongs_to | :polymorphic | has_one
|
114
120
|
# ----------------------------------+------------+--------------+---------
|
@@ -117,41 +123,41 @@ module ActiveRecord
|
|
117
123
|
# #build_other(attributes={}) | X | | X
|
118
124
|
# #create_other(attributes={}) | X | | X
|
119
125
|
# #other.create!(attributes={}) | | | X
|
120
|
-
# #other.nil? | X | X |
|
126
|
+
# #other.nil? | X | X |
|
121
127
|
#
|
122
128
|
# ===Collection associations (one-to-many / many-to-many)
|
123
129
|
# | | | has_many
|
124
|
-
# generated methods | habtm | has_many | :through
|
130
|
+
# generated methods | habtm | has_many | :through
|
125
131
|
# ----------------------------------+-------+----------+----------
|
126
132
|
# #others | X | X | X
|
127
|
-
# #others=(other,other,...) | X | X |
|
133
|
+
# #others=(other,other,...) | X | X | X
|
128
134
|
# #other_ids | X | X | X
|
129
|
-
# #other_ids=(id,id,...) | X | X |
|
135
|
+
# #other_ids=(id,id,...) | X | X | X
|
130
136
|
# #others<< | X | X | X
|
131
137
|
# #others.push | X | X | X
|
132
138
|
# #others.concat | X | X | X
|
133
139
|
# #others.build(attributes={}) | X | X | X
|
134
|
-
# #others.create(attributes={}) | X | X |
|
140
|
+
# #others.create(attributes={}) | X | X | X
|
135
141
|
# #others.create!(attributes={}) | X | X | X
|
136
142
|
# #others.size | X | X | X
|
137
143
|
# #others.length | X | X | X
|
138
|
-
# #others.count |
|
144
|
+
# #others.count | X | X | X
|
139
145
|
# #others.sum(args*,&block) | X | X | X
|
140
146
|
# #others.empty? | X | X | X
|
141
|
-
# #others.clear | X | X |
|
147
|
+
# #others.clear | X | X | X
|
142
148
|
# #others.delete(other,other,...) | X | X | X
|
143
|
-
# #others.delete_all | X | X |
|
149
|
+
# #others.delete_all | X | X |
|
144
150
|
# #others.destroy_all | X | X | X
|
145
151
|
# #others.find(*args) | X | X | X
|
146
|
-
# #others.find_first | X | |
|
147
|
-
# #others.uniq | X | X |
|
152
|
+
# #others.find_first | X | |
|
153
|
+
# #others.uniq | X | X | X
|
148
154
|
# #others.reset | X | X | X
|
149
155
|
#
|
150
156
|
# == Cardinality and associations
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
# the relation.
|
157
|
+
#
|
158
|
+
# Active Record associations can be used to describe one-to-one, one-to-many and many-to-many
|
159
|
+
# relationships between models. Each model uses an association to describe its role in
|
160
|
+
# the relation. The +belongs_to+ association is always used in the model that has
|
155
161
|
# the foreign key.
|
156
162
|
#
|
157
163
|
# === One-to-one
|
@@ -207,7 +213,7 @@ module ActiveRecord
|
|
207
213
|
# end
|
208
214
|
#
|
209
215
|
# Choosing which way to build a many-to-many relationship is not always simple.
|
210
|
-
# If you need to work with the relationship model as its own entity,
|
216
|
+
# If you need to work with the relationship model as its own entity,
|
211
217
|
# use <tt>has_many :through</tt>. Use +has_and_belongs_to_many+ when working with legacy schemas or when
|
212
218
|
# you never work directly with the relationship itself.
|
213
219
|
#
|
@@ -252,16 +258,16 @@ module ActiveRecord
|
|
252
258
|
# order to update their primary keys - except if the parent object is unsaved (<tt>new_record? == true</tt>).
|
253
259
|
# * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns +false+ and the assignment
|
254
260
|
# is cancelled.
|
255
|
-
# * If you wish to assign an object to a +has_one+ association without saving it, use the <tt
|
256
|
-
# * Assigning an object to a +belongs_to+ association does not save the object, since the foreign key field belongs on the parent. It
|
261
|
+
# * If you wish to assign an object to a +has_one+ association without saving it, use the <tt>association.build</tt> method (documented below).
|
262
|
+
# * Assigning an object to a +belongs_to+ association does not save the object, since the foreign key field belongs on the parent. It
|
257
263
|
# does not save the parent either.
|
258
264
|
#
|
259
265
|
# === Collections
|
260
266
|
#
|
261
267
|
# * Adding an object to a collection (+has_many+ or +has_and_belongs_to_many+) automatically saves that object, except if the parent object
|
262
268
|
# (the owner of the collection) is not yet stored in the database.
|
263
|
-
# * If saving any of the objects being added to a collection (via <tt
|
264
|
-
# * You can add an object to a collection without automatically saving it by using the <tt
|
269
|
+
# * If saving any of the objects being added to a collection (via <tt>push</tt> or similar) fails, then <tt>push</tt> returns +false+.
|
270
|
+
# * You can add an object to a collection without automatically saving it by using the <tt>collection.build</tt> method (documented below).
|
265
271
|
# * All unsaved (<tt>new_record? == true</tt>) members of the collection are automatically saved when the parent is saved.
|
266
272
|
#
|
267
273
|
# === Association callbacks
|
@@ -275,10 +281,10 @@ module ActiveRecord
|
|
275
281
|
# def evaluate_velocity(developer)
|
276
282
|
# ...
|
277
283
|
# end
|
278
|
-
# end
|
284
|
+
# end
|
279
285
|
#
|
280
286
|
# It's possible to stack callbacks by passing them as an array. Example:
|
281
|
-
#
|
287
|
+
#
|
282
288
|
# class Project
|
283
289
|
# has_and_belongs_to_many :developers, :after_add => [:evaluate_velocity, Proc.new { |p, d| p.shipping_date = Time.now}]
|
284
290
|
# end
|
@@ -334,43 +340,43 @@ module ActiveRecord
|
|
334
340
|
#
|
335
341
|
# Some extensions can only be made to work with knowledge of the association proxy's internals.
|
336
342
|
# Extensions can access relevant state using accessors on the association proxy:
|
337
|
-
#
|
343
|
+
#
|
338
344
|
# * +proxy_owner+ - Returns the object the association is part of.
|
339
345
|
# * +proxy_reflection+ - Returns the reflection object that describes the association.
|
340
346
|
# * +proxy_target+ - Returns the associated object for +belongs_to+ and +has_one+, or the collection of associated objects for +has_many+ and +has_and_belongs_to_many+.
|
341
347
|
#
|
342
348
|
# === Association Join Models
|
343
|
-
#
|
349
|
+
#
|
344
350
|
# Has Many associations can be configured with the <tt>:through</tt> option to use an explicit join model to retrieve the data. This
|
345
351
|
# operates similarly to a +has_and_belongs_to_many+ association. The advantage is that you're able to add validations,
|
346
352
|
# callbacks, and extra attributes on the join model. Consider the following schema:
|
347
|
-
#
|
353
|
+
#
|
348
354
|
# class Author < ActiveRecord::Base
|
349
355
|
# has_many :authorships
|
350
356
|
# has_many :books, :through => :authorships
|
351
357
|
# end
|
352
|
-
#
|
358
|
+
#
|
353
359
|
# class Authorship < ActiveRecord::Base
|
354
360
|
# belongs_to :author
|
355
361
|
# belongs_to :book
|
356
362
|
# end
|
357
|
-
#
|
363
|
+
#
|
358
364
|
# @author = Author.find :first
|
359
365
|
# @author.authorships.collect { |a| a.book } # selects all books that the author's authorships belong to.
|
360
366
|
# @author.books # selects all books by using the Authorship join model
|
361
|
-
#
|
367
|
+
#
|
362
368
|
# You can also go through a +has_many+ association on the join model:
|
363
|
-
#
|
369
|
+
#
|
364
370
|
# class Firm < ActiveRecord::Base
|
365
371
|
# has_many :clients
|
366
372
|
# has_many :invoices, :through => :clients
|
367
373
|
# end
|
368
|
-
#
|
374
|
+
#
|
369
375
|
# class Client < ActiveRecord::Base
|
370
376
|
# belongs_to :firm
|
371
377
|
# has_many :invoices
|
372
378
|
# end
|
373
|
-
#
|
379
|
+
#
|
374
380
|
# class Invoice < ActiveRecord::Base
|
375
381
|
# belongs_to :client
|
376
382
|
# end
|
@@ -380,36 +386,36 @@ module ActiveRecord
|
|
380
386
|
# @firm.invoices # selects all invoices by going through the Client join model.
|
381
387
|
#
|
382
388
|
# === Polymorphic Associations
|
383
|
-
#
|
384
|
-
# Polymorphic associations on models are not restricted on what types of models they can be associated with. Rather, they
|
389
|
+
#
|
390
|
+
# Polymorphic associations on models are not restricted on what types of models they can be associated with. Rather, they
|
385
391
|
# specify an interface that a +has_many+ association must adhere to.
|
386
|
-
#
|
392
|
+
#
|
387
393
|
# class Asset < ActiveRecord::Base
|
388
394
|
# belongs_to :attachable, :polymorphic => true
|
389
395
|
# end
|
390
|
-
#
|
396
|
+
#
|
391
397
|
# class Post < ActiveRecord::Base
|
392
398
|
# has_many :assets, :as => :attachable # The :as option specifies the polymorphic interface to use.
|
393
399
|
# end
|
394
400
|
#
|
395
401
|
# @asset.attachable = @post
|
396
|
-
#
|
402
|
+
#
|
397
403
|
# This works by using a type column in addition to a foreign key to specify the associated record. In the Asset example, you'd need
|
398
404
|
# an +attachable_id+ integer column and an +attachable_type+ string column.
|
399
405
|
#
|
400
406
|
# Using polymorphic associations in combination with single table inheritance (STI) is a little tricky. In order
|
401
|
-
# for the associations to work as expected, ensure that you store the base model for the STI models in the
|
407
|
+
# for the associations to work as expected, ensure that you store the base model for the STI models in the
|
402
408
|
# type column of the polymorphic association. To continue with the asset example above, suppose there are guest posts
|
403
409
|
# and member posts that use the posts table for STI. In this case, there must be a +type+ column in the posts table.
|
404
410
|
#
|
405
411
|
# class Asset < ActiveRecord::Base
|
406
412
|
# belongs_to :attachable, :polymorphic => true
|
407
|
-
#
|
413
|
+
#
|
408
414
|
# def attachable_type=(sType)
|
409
415
|
# super(sType.to_s.classify.constantize.base_class.to_s)
|
410
416
|
# end
|
411
417
|
# end
|
412
|
-
#
|
418
|
+
#
|
413
419
|
# class Post < ActiveRecord::Base
|
414
420
|
# # because we store "Post" in attachable_type now :dependent => :destroy will work
|
415
421
|
# has_many :assets, :as => :attachable, :dependent => :destroy
|
@@ -424,7 +430,7 @@ module ActiveRecord
|
|
424
430
|
# == Caching
|
425
431
|
#
|
426
432
|
# All of the methods are built on a simple caching principle that will keep the result of the last query around unless specifically
|
427
|
-
# instructed not to. The cache is even shared across methods to make it even cheaper to use the macro-added methods without
|
433
|
+
# instructed not to. The cache is even shared across methods to make it even cheaper to use the macro-added methods without
|
428
434
|
# worrying too much about performance at the first go. Example:
|
429
435
|
#
|
430
436
|
# project.milestones # fetches milestones from the database
|
@@ -435,9 +441,9 @@ module ActiveRecord
|
|
435
441
|
#
|
436
442
|
# == Eager loading of associations
|
437
443
|
#
|
438
|
-
# Eager loading is a way to find objects of a certain class and a number of named associations
|
444
|
+
# Eager loading is a way to find objects of a certain class and a number of named associations. This is
|
439
445
|
# one of the easiest ways of to prevent the dreaded 1+N problem in which fetching 100 posts that each need to display their author
|
440
|
-
# triggers 101 database queries. Through the use of eager loading, the 101 queries can be reduced to
|
446
|
+
# triggers 101 database queries. Through the use of eager loading, the 101 queries can be reduced to 2. Example:
|
441
447
|
#
|
442
448
|
# class Post < ActiveRecord::Base
|
443
449
|
# belongs_to :author
|
@@ -446,24 +452,25 @@ module ActiveRecord
|
|
446
452
|
#
|
447
453
|
# Consider the following loop using the class above:
|
448
454
|
#
|
449
|
-
# for post in Post.
|
455
|
+
# for post in Post.all
|
450
456
|
# puts "Post: " + post.title
|
451
457
|
# puts "Written by: " + post.author.name
|
452
458
|
# puts "Last comment on: " + post.comments.first.created_on
|
453
|
-
# end
|
459
|
+
# end
|
454
460
|
#
|
455
461
|
# To iterate over these one hundred posts, we'll generate 201 database queries. Let's first just optimize it for retrieving the author:
|
456
462
|
#
|
457
463
|
# for post in Post.find(:all, :include => :author)
|
458
464
|
#
|
459
|
-
# This references the name of the +belongs_to+ association that also used the <tt>:author</tt> symbol
|
460
|
-
#
|
465
|
+
# This references the name of the +belongs_to+ association that also used the <tt>:author</tt> symbol. After loading the posts, find
|
466
|
+
# will collect the +author_id+ from each one and load all the referenced authors with one query. Doing so will cut down the number of queries from 201 to 102.
|
461
467
|
#
|
462
468
|
# We can improve upon the situation further by referencing both associations in the finder with:
|
463
469
|
#
|
464
470
|
# for post in Post.find(:all, :include => [ :author, :comments ])
|
465
471
|
#
|
466
|
-
#
|
472
|
+
# This will load all comments with a single query. This reduces the total number of queries to 3. More generally the number of queries
|
473
|
+
# will be 1 plus the number of associations named (except if some of the associations are polymorphic +belongs_to+ - see below).
|
467
474
|
#
|
468
475
|
# To include a deep hierarchy of associations, use a hash:
|
469
476
|
#
|
@@ -475,66 +482,96 @@ module ActiveRecord
|
|
475
482
|
# All of this power shouldn't fool you into thinking that you can pull out huge amounts of data with no performance penalty just because you've reduced
|
476
483
|
# the number of queries. The database still needs to send all the data to Active Record and it still needs to be processed. So it's no
|
477
484
|
# catch-all for performance problems, but it's a great way to cut down on the number of queries in a situation as the one described above.
|
478
|
-
#
|
479
|
-
# Since
|
480
|
-
#
|
481
|
-
#
|
482
|
-
#
|
483
|
-
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
#
|
485
|
+
#
|
486
|
+
# Since only one table is loaded at a time, conditions or orders cannot reference tables other than the main one. If this is the case
|
487
|
+
# Active Record falls back to the previously used LEFT OUTER JOIN based strategy. For example
|
488
|
+
#
|
489
|
+
# Post.find(:all, :include => [ :author, :comments ], :conditions => ['comments.approved = ?', true])
|
490
|
+
#
|
491
|
+
# will result in a single SQL query with joins along the lines of: <tt>LEFT OUTER JOIN comments ON comments.post_id = posts.id</tt> and
|
492
|
+
# <tt>LEFT OUTER JOIN authors ON authors.id = posts.author_id</tt>. Note that using conditions like this can have unintended consequences.
|
493
|
+
# In the above example posts with no approved comments are not returned at all, because the conditions apply to the SQL statement as a whole
|
494
|
+
# and not just to the association. You must disambiguate column references for this fallback to happen, for example
|
495
|
+
# <tt>:order => "author.name DESC"</tt> will work but <tt>:order => "name DESC"</tt> will not.
|
496
|
+
#
|
497
|
+
# If you do want eagerload only some members of an association it is usually more natural to <tt>:include</tt> an association
|
498
|
+
# which has conditions defined on it:
|
499
|
+
#
|
500
|
+
# class Post < ActiveRecord::Base
|
501
|
+
# has_many :approved_comments, :class_name => 'Comment', :conditions => ['approved = ?', true]
|
502
|
+
# end
|
503
|
+
#
|
504
|
+
# Post.find(:all, :include => :approved_comments)
|
505
|
+
#
|
506
|
+
# will load posts and eager load the +approved_comments+ association, which contains only those comments that have been approved.
|
507
|
+
#
|
487
508
|
# When eager loaded, conditions are interpolated in the context of the model class, not the model instance. Conditions are lazily interpolated
|
488
509
|
# before the actual model exists.
|
489
|
-
#
|
510
|
+
#
|
511
|
+
# Eager loading is supported with polymorphic associations.
|
512
|
+
#
|
513
|
+
# class Address < ActiveRecord::Base
|
514
|
+
# belongs_to :addressable, :polymorphic => true
|
515
|
+
# end
|
516
|
+
#
|
517
|
+
# A call that tries to eager load the addressable model
|
518
|
+
#
|
519
|
+
# Address.find(:all, :include => :addressable)
|
520
|
+
#
|
521
|
+
# will execute one query to load the addresses and load the addressables with one query per addressable type.
|
522
|
+
# For example if all the addressables are either of class Person or Company then a total of 3 queries will be executed. The list of
|
523
|
+
# addressable types to load is determined on the back of the addresses loaded. This is not supported if Active Record has to fallback
|
524
|
+
# to the previous implementation of eager loading and will raise ActiveRecord::EagerLoadPolymorphicError. The reason is that the parent
|
525
|
+
# model's type is a column value so its corresponding table name cannot be put in the +FROM+/+JOIN+ clauses of that query.
|
526
|
+
#
|
490
527
|
# == Table Aliasing
|
491
528
|
#
|
492
|
-
#
|
529
|
+
# Active Record uses table aliasing in the case that a table is referenced multiple times in a join. If a table is referenced only once,
|
493
530
|
# the standard table name is used. The second time, the table is aliased as <tt>#{reflection_name}_#{parent_table_name}</tt>. Indexes are appended
|
494
531
|
# for any more successive uses of the table name.
|
495
|
-
#
|
496
|
-
# Post.find :all, :
|
497
|
-
# # => SELECT ... FROM posts
|
498
|
-
# Post.find :all, :
|
499
|
-
# # => SELECT ... FROM posts
|
500
|
-
# Post.find :all, :
|
501
|
-
# # => SELECT ... FROM posts
|
502
|
-
#
|
532
|
+
#
|
533
|
+
# Post.find :all, :joins => :comments
|
534
|
+
# # => SELECT ... FROM posts INNER JOIN comments ON ...
|
535
|
+
# Post.find :all, :joins => :special_comments # STI
|
536
|
+
# # => SELECT ... FROM posts INNER JOIN comments ON ... AND comments.type = 'SpecialComment'
|
537
|
+
# Post.find :all, :joins => [:comments, :special_comments] # special_comments is the reflection name, posts is the parent table name
|
538
|
+
# # => SELECT ... FROM posts INNER JOIN comments ON ... INNER JOIN comments special_comments_posts
|
539
|
+
#
|
503
540
|
# Acts as tree example:
|
504
|
-
#
|
505
|
-
# TreeMixin.find :all, :
|
506
|
-
# # => SELECT ... FROM mixins
|
507
|
-
# TreeMixin.find :all, :
|
508
|
-
# # => SELECT ... FROM mixins
|
509
|
-
#
|
510
|
-
# TreeMixin.find :all, :
|
511
|
-
# # => SELECT ... FROM mixins
|
512
|
-
#
|
513
|
-
#
|
514
|
-
#
|
541
|
+
#
|
542
|
+
# TreeMixin.find :all, :joins => :children
|
543
|
+
# # => SELECT ... FROM mixins INNER JOIN mixins childrens_mixins ...
|
544
|
+
# TreeMixin.find :all, :joins => {:children => :parent}
|
545
|
+
# # => SELECT ... FROM mixins INNER JOIN mixins childrens_mixins ...
|
546
|
+
# INNER JOIN parents_mixins ...
|
547
|
+
# TreeMixin.find :all, :joins => {:children => {:parent => :children}}
|
548
|
+
# # => SELECT ... FROM mixins INNER JOIN mixins childrens_mixins ...
|
549
|
+
# INNER JOIN parents_mixins ...
|
550
|
+
# INNER JOIN mixins childrens_mixins_2
|
551
|
+
#
|
515
552
|
# Has and Belongs to Many join tables use the same idea, but add a <tt>_join</tt> suffix:
|
516
|
-
#
|
517
|
-
# Post.find :all, :
|
518
|
-
# # => SELECT ... FROM posts
|
519
|
-
# Post.find :all, :
|
520
|
-
# # => SELECT ... FROM posts
|
521
|
-
#
|
522
|
-
# Post.find :all, :
|
523
|
-
# # => SELECT ... FROM posts
|
524
|
-
#
|
525
|
-
#
|
526
|
-
#
|
553
|
+
#
|
554
|
+
# Post.find :all, :joins => :categories
|
555
|
+
# # => SELECT ... FROM posts INNER JOIN categories_posts ... INNER JOIN categories ...
|
556
|
+
# Post.find :all, :joins => {:categories => :posts}
|
557
|
+
# # => SELECT ... FROM posts INNER JOIN categories_posts ... INNER JOIN categories ...
|
558
|
+
# INNER JOIN categories_posts posts_categories_join INNER JOIN posts posts_categories
|
559
|
+
# Post.find :all, :joins => {:categories => {:posts => :categories}}
|
560
|
+
# # => SELECT ... FROM posts INNER JOIN categories_posts ... INNER JOIN categories ...
|
561
|
+
# INNER JOIN categories_posts posts_categories_join INNER JOIN posts posts_categories
|
562
|
+
# INNER JOIN categories_posts categories_posts_join INNER JOIN categories categories_posts_2
|
563
|
+
#
|
527
564
|
# If you wish to specify your own custom joins using a <tt>:joins</tt> option, those table names will take precedence over the eager associations:
|
528
|
-
#
|
529
|
-
# Post.find :all, :
|
530
|
-
# # => SELECT ... FROM posts
|
531
|
-
# Post.find :all, :
|
532
|
-
# # => SELECT ... FROM posts
|
533
|
-
#
|
565
|
+
#
|
566
|
+
# Post.find :all, :joins => :comments, :joins => "inner join comments ..."
|
567
|
+
# # => SELECT ... FROM posts INNER JOIN comments_posts ON ... INNER JOIN comments ...
|
568
|
+
# Post.find :all, :joins => [:comments, :special_comments], :joins => "inner join comments ..."
|
569
|
+
# # => SELECT ... FROM posts INNER JOIN comments comments_posts ON ...
|
570
|
+
# INNER JOIN comments special_comments_posts ...
|
534
571
|
# INNER JOIN comments ...
|
535
|
-
#
|
572
|
+
#
|
536
573
|
# Table aliases are automatically truncated according to the maximum length of table identifiers according to the specific database.
|
537
|
-
#
|
574
|
+
#
|
538
575
|
# == Modules
|
539
576
|
#
|
540
577
|
# By default, associations will look for objects within the current module scope. Consider:
|
@@ -549,7 +586,7 @@ module ActiveRecord
|
|
549
586
|
# end
|
550
587
|
# end
|
551
588
|
#
|
552
|
-
# When
|
589
|
+
# When Firm#clients is called, it will in turn call <tt>MyApplication::Business::Company.find(firm.id)</tt>. If you want to associate
|
553
590
|
# with a class in another module scope, this can be done by specifying the complete class name. Example:
|
554
591
|
#
|
555
592
|
# module MyApplication
|
@@ -575,30 +612,30 @@ module ActiveRecord
|
|
575
612
|
# possible.
|
576
613
|
module ClassMethods
|
577
614
|
# Adds the following methods for retrieval and query of collections of associated objects:
|
578
|
-
# +collection+ is replaced with the symbol passed as the first argument, so
|
615
|
+
# +collection+ is replaced with the symbol passed as the first argument, so
|
579
616
|
# <tt>has_many :clients</tt> would add among others <tt>clients.empty?</tt>.
|
580
|
-
# * <tt>collection(force_reload = false)</tt> -
|
617
|
+
# * <tt>collection(force_reload = false)</tt> - Returns an array of all the associated objects.
|
581
618
|
# An empty array is returned if none are found.
|
582
|
-
# * <tt>collection<<(object, ...)</tt> -
|
583
|
-
# * <tt>collection.delete(object, ...)</tt> -
|
619
|
+
# * <tt>collection<<(object, ...)</tt> - Adds one or more objects to the collection by setting their foreign keys to the collection's primary key.
|
620
|
+
# * <tt>collection.delete(object, ...)</tt> - Removes one or more objects from the collection by setting their foreign keys to +NULL+.
|
584
621
|
# This will also destroy the objects if they're declared as +belongs_to+ and dependent on this model.
|
585
|
-
# * <tt>collection=objects</tt> -
|
586
|
-
# * <tt>collection_singular_ids</tt> -
|
587
|
-
# * <tt>collection_singular_ids=ids</tt> -
|
588
|
-
# * <tt>collection.clear</tt> -
|
622
|
+
# * <tt>collection=objects</tt> - Replaces the collections content by deleting and adding objects as appropriate.
|
623
|
+
# * <tt>collection_singular_ids</tt> - Returns an array of the associated objects' ids
|
624
|
+
# * <tt>collection_singular_ids=ids</tt> - Replace the collection with the objects identified by the primary keys in +ids+
|
625
|
+
# * <tt>collection.clear</tt> - Removes every object from the collection. This destroys the associated objects if they
|
589
626
|
# are associated with <tt>:dependent => :destroy</tt>, deletes them directly from the database if <tt>:dependent => :delete_all</tt>,
|
590
|
-
# otherwise sets their foreign keys to NULL
|
591
|
-
# * <tt>collection.empty?</tt> -
|
592
|
-
# * <tt>collection.size</tt> -
|
593
|
-
# * <tt>collection.find</tt> -
|
594
|
-
# * <tt>collection.build(attributes = {}, ...)</tt> -
|
595
|
-
# with +attributes+ and linked to this object through a foreign key, but have not yet been saved. *Note:* This only works if an
|
627
|
+
# otherwise sets their foreign keys to +NULL+.
|
628
|
+
# * <tt>collection.empty?</tt> - Returns +true+ if there are no associated objects.
|
629
|
+
# * <tt>collection.size</tt> - Returns the number of associated objects.
|
630
|
+
# * <tt>collection.find</tt> - Finds an associated object according to the same rules as Base.find.
|
631
|
+
# * <tt>collection.build(attributes = {}, ...)</tt> - Returns one or more new objects of the collection type that have been instantiated
|
632
|
+
# with +attributes+ and linked to this object through a foreign key, but have not yet been saved. *Note:* This only works if an
|
596
633
|
# associated object already exists, not if it's +nil+!
|
597
|
-
# * <tt>collection.create(attributes = {})</tt> -
|
634
|
+
# * <tt>collection.create(attributes = {})</tt> - Returns a new object of the collection type that has been instantiated
|
598
635
|
# with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
|
599
636
|
# *Note:* This only works if an associated object already exists, not if it's +nil+!
|
600
637
|
#
|
601
|
-
# Example: A
|
638
|
+
# Example: A Firm class declares <tt>has_many :clients</tt>, which will add:
|
602
639
|
# * <tt>Firm#clients</tt> (similar to <tt>Clients.find :all, :conditions => "firm_id = #{id}"</tt>)
|
603
640
|
# * <tt>Firm#clients<<</tt>
|
604
641
|
# * <tt>Firm#clients.delete</tt>
|
@@ -612,43 +649,48 @@ module ActiveRecord
|
|
612
649
|
# * <tt>Firm#clients.build</tt> (similar to <tt>Client.new("firm_id" => id)</tt>)
|
613
650
|
# * <tt>Firm#clients.create</tt> (similar to <tt>c = Client.new("firm_id" => id); c.save; c</tt>)
|
614
651
|
# The declaration can also include an options hash to specialize the behavior of the association.
|
615
|
-
#
|
652
|
+
#
|
616
653
|
# Options are:
|
617
|
-
# * <tt>:class_name</tt>
|
618
|
-
# from the association name. So <tt>has_many :products</tt> will by default be linked to the
|
619
|
-
# if the real class name is
|
620
|
-
# * <tt>:conditions</tt>
|
621
|
-
# SQL fragment, such as <tt>price > 5 AND name LIKE 'B%'</tt>.
|
622
|
-
#
|
623
|
-
#
|
624
|
-
# * <tt>:
|
625
|
-
#
|
626
|
-
#
|
627
|
-
#
|
628
|
-
#
|
629
|
-
#
|
630
|
-
#
|
631
|
-
#
|
654
|
+
# * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
|
655
|
+
# from the association name. So <tt>has_many :products</tt> will by default be linked to the Product class, but
|
656
|
+
# if the real class name is SpecialProduct, you'll have to specify it with this option.
|
657
|
+
# * <tt>:conditions</tt> - Specify the conditions that the associated objects must meet in order to be included as a +WHERE+
|
658
|
+
# SQL fragment, such as <tt>price > 5 AND name LIKE 'B%'</tt>. Record creations from the association are scoped if a hash
|
659
|
+
# is used. <tt>has_many :posts, :conditions => {:published => true}</tt> will create published posts with <tt>@blog.posts.create</tt>
|
660
|
+
# or <tt>@blog.posts.build</tt>.
|
661
|
+
# * <tt>:order</tt> - Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
662
|
+
# such as <tt>last_name, first_name DESC</tt>.
|
663
|
+
# * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
|
664
|
+
# of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_many+ association will use "person_id"
|
665
|
+
# as the default <tt>:foreign_key</tt>.
|
666
|
+
# * <tt>:dependent</tt> - If set to <tt>:destroy</tt> all the associated objects are destroyed
|
667
|
+
# alongside this object by calling their +destroy+ method. If set to <tt>:delete_all</tt> all associated
|
668
|
+
# objects are deleted *without* calling their +destroy+ method. If set to <tt>:nullify</tt> all associated
|
669
|
+
# objects' foreign keys are set to +NULL+ *without* calling their +save+ callbacks. *Warning:* This option is ignored when also using
|
670
|
+
# the <tt>:through</tt> option.
|
671
|
+
# * <tt>:finder_sql</tt> - Specify a complete SQL statement to fetch the association. This is a good way to go for complex
|
632
672
|
# associations that depend on multiple tables. Note: When this option is used, +find_in_collection+ is _not_ added.
|
633
|
-
# * <tt>:counter_sql</tt>
|
673
|
+
# * <tt>:counter_sql</tt> - Specify a complete SQL statement to fetch the size of the association. If <tt>:finder_sql</tt> is
|
634
674
|
# specified but not <tt>:counter_sql</tt>, <tt>:counter_sql</tt> will be generated by replacing <tt>SELECT ... FROM</tt> with <tt>SELECT COUNT(*) FROM</tt>.
|
635
|
-
# * <tt>:extend</tt>
|
636
|
-
# * <tt>:include</tt>
|
637
|
-
# * <tt>:group</tt
|
638
|
-
# * <tt>:limit</tt
|
639
|
-
# * <tt>:offset</tt
|
640
|
-
# * <tt>:select</tt
|
641
|
-
# but not include the joined columns.
|
642
|
-
# * <tt>:as</tt
|
643
|
-
# * <tt>:through</tt
|
675
|
+
# * <tt>:extend</tt> - Specify a named module for extending the proxy. See "Association extensions".
|
676
|
+
# * <tt>:include</tt> - Specify second-order associations that should be eager loaded when the collection is loaded.
|
677
|
+
# * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
|
678
|
+
# * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
|
679
|
+
# * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.
|
680
|
+
# * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if you, for example, want to do a join
|
681
|
+
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will rise an error.
|
682
|
+
# * <tt>:as</tt> - Specifies a polymorphic interface (See <tt>belongs_to</tt>).
|
683
|
+
# * <tt>:through</tt> - Specifies a Join Model through which to perform the query. Options for <tt>:class_name</tt> and <tt>:foreign_key</tt>
|
644
684
|
# are ignored, as the association uses the source reflection. You can only use a <tt>:through</tt> query through a <tt>belongs_to</tt>
|
645
685
|
# or <tt>has_many</tt> association on the join model.
|
646
|
-
# * <tt>:source</tt
|
686
|
+
# * <tt>:source</tt> - Specifies the source association name used by <tt>has_many :through</tt> queries. Only use it if the name cannot be
|
647
687
|
# inferred from the association. <tt>has_many :subscribers, :through => :subscriptions</tt> will look for either <tt>:subscribers</tt> or
|
648
|
-
# <tt>:subscriber</tt> on
|
649
|
-
# * <tt>:source_type</tt
|
688
|
+
# <tt>:subscriber</tt> on Subscription, unless a <tt>:source</tt> is given.
|
689
|
+
# * <tt>:source_type</tt> - Specifies type of the source association used by <tt>has_many :through</tt> queries where the source
|
650
690
|
# association is a polymorphic +belongs_to+.
|
651
|
-
# * <tt>:uniq</tt> -
|
691
|
+
# * <tt>:uniq</tt> - If true, duplicates will be omitted from the collection. Useful in conjunction with <tt>:through</tt>.
|
692
|
+
# * <tt>:readonly</tt> - If true, all the associated objects are readonly through the association.
|
693
|
+
# * <tt>:validate</tt> - If false, don't validate the associated objects when saving the parent object. true by default.
|
652
694
|
#
|
653
695
|
# Option examples:
|
654
696
|
# has_many :comments, :order => "posted_on"
|
@@ -657,6 +699,7 @@ module ActiveRecord
|
|
657
699
|
# has_many :tracks, :order => "position", :dependent => :destroy
|
658
700
|
# has_many :comments, :dependent => :nullify
|
659
701
|
# has_many :tags, :as => :taggable
|
702
|
+
# has_many :reports, :readonly => true
|
660
703
|
# has_many :subscribers, :through => :subscriptions, :source => :user
|
661
704
|
# has_many :subscribers, :class_name => "Person", :finder_sql =>
|
662
705
|
# 'SELECT DISTINCT people.* ' +
|
@@ -668,27 +711,28 @@ module ActiveRecord
|
|
668
711
|
|
669
712
|
configure_dependency_for_has_many(reflection)
|
670
713
|
|
714
|
+
add_multiple_associated_validation_callbacks(reflection.name) unless options[:validate] == false
|
715
|
+
add_multiple_associated_save_callbacks(reflection.name)
|
716
|
+
add_association_callbacks(reflection.name, reflection.options)
|
717
|
+
|
671
718
|
if options[:through]
|
672
|
-
|
673
|
-
collection_accessor_methods(reflection, HasManyThroughAssociation, false)
|
719
|
+
collection_accessor_methods(reflection, HasManyThroughAssociation)
|
674
720
|
else
|
675
|
-
add_multiple_associated_save_callbacks(reflection.name)
|
676
|
-
add_association_callbacks(reflection.name, reflection.options)
|
677
721
|
collection_accessor_methods(reflection, HasManyAssociation)
|
678
722
|
end
|
679
723
|
end
|
680
724
|
|
681
725
|
# Adds the following methods for retrieval and query of a single associated object:
|
682
|
-
# +association+ is replaced with the symbol passed as the first argument, so
|
726
|
+
# +association+ is replaced with the symbol passed as the first argument, so
|
683
727
|
# <tt>has_one :manager</tt> would add among others <tt>manager.nil?</tt>.
|
684
|
-
# * <tt>association(force_reload = false)</tt> -
|
685
|
-
# * <tt>association=(associate)</tt> -
|
728
|
+
# * <tt>association(force_reload = false)</tt> - Returns the associated object. +nil+ is returned if none is found.
|
729
|
+
# * <tt>association=(associate)</tt> - Assigns the associate object, extracts the primary key, sets it as the foreign key,
|
686
730
|
# and saves the associate object.
|
687
|
-
# * <tt>association.nil?</tt> -
|
688
|
-
# * <tt>build_association(attributes = {})</tt> -
|
731
|
+
# * <tt>association.nil?</tt> - Returns +true+ if there is no associated object.
|
732
|
+
# * <tt>build_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
|
689
733
|
# with +attributes+ and linked to this object through a foreign key, but has not yet been saved. Note: This ONLY works if
|
690
734
|
# an association already exists. It will NOT work if the association is +nil+.
|
691
|
-
# * <tt>create_association(attributes = {})</tt> -
|
735
|
+
# * <tt>create_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
|
692
736
|
# with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
|
693
737
|
#
|
694
738
|
# Example: An Account class declares <tt>has_one :beneficiary</tt>, which will add:
|
@@ -699,59 +743,83 @@ module ActiveRecord
|
|
699
743
|
# * <tt>Account#create_beneficiary</tt> (similar to <tt>b = Beneficiary.new("account_id" => id); b.save; b</tt>)
|
700
744
|
#
|
701
745
|
# The declaration can also include an options hash to specialize the behavior of the association.
|
702
|
-
#
|
746
|
+
#
|
703
747
|
# Options are:
|
704
|
-
# * <tt>:class_name</tt>
|
705
|
-
# from the association name. So <tt>has_one :manager</tt> will by default be linked to the
|
706
|
-
# if the real class name is
|
707
|
-
# * <tt>:conditions</tt>
|
748
|
+
# * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
|
749
|
+
# from the association name. So <tt>has_one :manager</tt> will by default be linked to the Manager class, but
|
750
|
+
# if the real class name is Person, you'll have to specify it with this option.
|
751
|
+
# * <tt>:conditions</tt> - Specify the conditions that the associated object must meet in order to be included as a +WHERE+
|
708
752
|
# SQL fragment, such as <tt>rank = 5</tt>.
|
709
|
-
# * <tt>:order</tt>
|
710
|
-
# such as <tt>last_name, first_name DESC</tt
|
711
|
-
# * <tt>:dependent</tt>
|
753
|
+
# * <tt>:order</tt> - Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
754
|
+
# such as <tt>last_name, first_name DESC</tt>.
|
755
|
+
# * <tt>:dependent</tt> - If set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
|
712
756
|
# <tt>:delete</tt>, the associated object is deleted *without* calling its destroy method. If set to <tt>:nullify</tt>, the associated
|
713
757
|
# object's foreign key is set to +NULL+. Also, association is assigned.
|
714
|
-
# * <tt>:foreign_key</tt> -
|
715
|
-
# of this class in lower-case and
|
716
|
-
# as the default
|
717
|
-
# * <tt>:include</tt>
|
718
|
-
# * <tt>:as</tt
|
719
|
-
|
758
|
+
# * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
|
759
|
+
# of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_one+ association will use "person_id"
|
760
|
+
# as the default <tt>:foreign_key</tt>.
|
761
|
+
# * <tt>:include</tt> - Specify second-order associations that should be eager loaded when this object is loaded.
|
762
|
+
# * <tt>:as</tt> - Specifies a polymorphic interface (See <tt>belongs_to</tt>).
|
763
|
+
# * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
|
764
|
+
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
|
765
|
+
# * <tt>:through</tt>: Specifies a Join Model through which to perform the query. Options for <tt>:class_name</tt> and <tt>:foreign_key</tt>
|
766
|
+
# are ignored, as the association uses the source reflection. You can only use a <tt>:through</tt> query through a
|
767
|
+
# <tt>has_one</tt> or <tt>belongs_to</tt> association on the join model.
|
768
|
+
# * <tt>:source</tt> - Specifies the source association name used by <tt>has_one :through</tt> queries. Only use it if the name cannot be
|
769
|
+
# inferred from the association. <tt>has_one :favorite, :through => :favorites</tt> will look for a
|
770
|
+
# <tt>:favorite</tt> on Favorite, unless a <tt>:source</tt> is given.
|
771
|
+
# * <tt>:source_type</tt> - Specifies type of the source association used by <tt>has_one :through</tt> queries where the source
|
772
|
+
# association is a polymorphic +belongs_to+.
|
773
|
+
# * <tt>:readonly</tt> - If true, the associated object is readonly through the association.
|
774
|
+
# * <tt>:validate</tt> - If false, don't validate the associated object when saving the parent object. +false+ by default.
|
775
|
+
#
|
720
776
|
# Option examples:
|
721
777
|
# has_one :credit_card, :dependent => :destroy # destroys the associated credit card
|
722
778
|
# has_one :credit_card, :dependent => :nullify # updates the associated records foreign key value to NULL rather than destroying it
|
723
779
|
# has_one :last_comment, :class_name => "Comment", :order => "posted_on"
|
724
780
|
# has_one :project_manager, :class_name => "Person", :conditions => "role = 'project_manager'"
|
725
781
|
# has_one :attachment, :as => :attachable
|
782
|
+
# has_one :boss, :readonly => :true
|
783
|
+
# has_one :club, :through => :membership
|
784
|
+
# has_one :primary_address, :through => :addressables, :conditions => ["addressable.primary = ?", true], :source => :addressable
|
726
785
|
def has_one(association_id, options = {})
|
727
|
-
|
786
|
+
if options[:through]
|
787
|
+
reflection = create_has_one_through_reflection(association_id, options)
|
788
|
+
association_accessor_methods(reflection, ActiveRecord::Associations::HasOneThroughAssociation)
|
789
|
+
else
|
790
|
+
reflection = create_has_one_reflection(association_id, options)
|
791
|
+
|
792
|
+
ivar = "@#{reflection.name}"
|
793
|
+
|
794
|
+
method_name = "has_one_after_save_for_#{reflection.name}".to_sym
|
795
|
+
define_method(method_name) do
|
796
|
+
association = instance_variable_get("#{ivar}") if instance_variable_defined?("#{ivar}")
|
728
797
|
|
729
|
-
module_eval do
|
730
|
-
after_save <<-EOF
|
731
|
-
association = instance_variable_get("@#{reflection.name}")
|
732
798
|
if !association.nil? && (new_record? || association.new_record? || association["#{reflection.primary_key_name}"] != id)
|
733
799
|
association["#{reflection.primary_key_name}"] = id
|
734
800
|
association.save(true)
|
735
801
|
end
|
736
|
-
|
802
|
+
end
|
803
|
+
after_save method_name
|
804
|
+
|
805
|
+
add_single_associated_validation_callbacks(reflection.name) if options[:validate] == true
|
806
|
+
association_accessor_methods(reflection, HasOneAssociation)
|
807
|
+
association_constructor_method(:build, reflection, HasOneAssociation)
|
808
|
+
association_constructor_method(:create, reflection, HasOneAssociation)
|
809
|
+
|
810
|
+
configure_dependency_for_has_one(reflection)
|
737
811
|
end
|
738
|
-
|
739
|
-
association_accessor_methods(reflection, HasOneAssociation)
|
740
|
-
association_constructor_method(:build, reflection, HasOneAssociation)
|
741
|
-
association_constructor_method(:create, reflection, HasOneAssociation)
|
742
|
-
|
743
|
-
configure_dependency_for_has_one(reflection)
|
744
812
|
end
|
745
813
|
|
746
814
|
# Adds the following methods for retrieval and query for a single associated object for which this object holds an id:
|
747
|
-
# +association+ is replaced with the symbol passed as the first argument, so
|
815
|
+
# +association+ is replaced with the symbol passed as the first argument, so
|
748
816
|
# <tt>belongs_to :author</tt> would add among others <tt>author.nil?</tt>.
|
749
|
-
# * <tt>association(force_reload = false)</tt> -
|
750
|
-
# * <tt>association=(associate)</tt> -
|
751
|
-
# * <tt>association.nil?</tt> -
|
752
|
-
# * <tt>build_association(attributes = {})</tt> -
|
817
|
+
# * <tt>association(force_reload = false)</tt> - Returns the associated object. +nil+ is returned if none is found.
|
818
|
+
# * <tt>association=(associate)</tt> - Assigns the associate object, extracts the primary key, and sets it as the foreign key.
|
819
|
+
# * <tt>association.nil?</tt> - Returns +true+ if there is no associated object.
|
820
|
+
# * <tt>build_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
|
753
821
|
# with +attributes+ and linked to this object through a foreign key, but has not yet been saved.
|
754
|
-
# * <tt>create_association(attributes = {})</tt> -
|
822
|
+
# * <tt>create_association(attributes = {})</tt> - Returns a new object of the associated type that has been instantiated
|
755
823
|
# with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
|
756
824
|
#
|
757
825
|
# Example: A Post class declares <tt>belongs_to :author</tt>, which will add:
|
@@ -762,134 +830,157 @@ module ActiveRecord
|
|
762
830
|
# * <tt>Post#build_author</tt> (similar to <tt>post.author = Author.new</tt>)
|
763
831
|
# * <tt>Post#create_author</tt> (similar to <tt>post.author = Author.new; post.author.save; post.author</tt>)
|
764
832
|
# The declaration can also include an options hash to specialize the behavior of the association.
|
765
|
-
#
|
833
|
+
#
|
766
834
|
# Options are:
|
767
|
-
# * <tt>:class_name</tt>
|
768
|
-
# from the association name. So <tt>has_one :author</tt> will by default be linked to the
|
769
|
-
# if the real class name is
|
770
|
-
# * <tt>:conditions</tt>
|
835
|
+
# * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
|
836
|
+
# from the association name. So <tt>has_one :author</tt> will by default be linked to the Author class, but
|
837
|
+
# if the real class name is Person, you'll have to specify it with this option.
|
838
|
+
# * <tt>:conditions</tt> - Specify the conditions that the associated object must meet in order to be included as a +WHERE+
|
771
839
|
# SQL fragment, such as <tt>authorized = 1</tt>.
|
772
|
-
# * <tt>:
|
773
|
-
#
|
774
|
-
# * <tt>:foreign_key</tt> -
|
775
|
-
# of the
|
776
|
-
#
|
777
|
-
#
|
840
|
+
# * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
|
841
|
+
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
|
842
|
+
# * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
|
843
|
+
# of the association with an "_id" suffix. So a class that defines a <tt>belongs_to :person</tt> association will use
|
844
|
+
# "person_id" as the default <tt>:foreign_key</tt>. Similarly, <tt>belongs_to :favorite_person, :class_name => "Person"</tt>
|
845
|
+
# will use a foreign key of "favorite_person_id".
|
846
|
+
# * <tt>:dependent</tt> - If set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
|
847
|
+
# <tt>:delete</tt>, the associated object is deleted *without* calling its destroy method. This option should not be specified when
|
848
|
+
# <tt>belongs_to</tt> is used in conjunction with a <tt>has_many</tt> relationship on another class because of the potential to leave
|
849
|
+
# orphaned records behind.
|
850
|
+
# * <tt>:counter_cache</tt> - Caches the number of belonging objects on the associate class through the use of +increment_counter+
|
778
851
|
# and +decrement_counter+. The counter cache is incremented when an object of this class is created and decremented when it's
|
779
|
-
# destroyed. This requires that a column named <tt>#{table_name}_count</tt> (such as +comments_count+ for a belonging
|
780
|
-
# is used on the associate class (such as a
|
852
|
+
# destroyed. This requires that a column named <tt>#{table_name}_count</tt> (such as +comments_count+ for a belonging Comment class)
|
853
|
+
# is used on the associate class (such as a Post class). You can also specify a custom counter cache column by providing
|
781
854
|
# a column name instead of a +true+/+false+ value to this option (e.g., <tt>:counter_cache => :my_custom_counter</tt>.)
|
782
|
-
#
|
783
|
-
#
|
784
|
-
#
|
785
|
-
#
|
786
|
-
#
|
855
|
+
# When creating a counter cache column, the database statement or migration must specify a default value of <tt>0</tt>, failing to do
|
856
|
+
# this results in a counter with +NULL+ value, which will never increment.
|
857
|
+
# Note: Specifying a counter cache will add it to that model's list of readonly attributes using +attr_readonly+.
|
858
|
+
# * <tt>:include</tt> - Specify second-order associations that should be eager loaded when this object is loaded.
|
859
|
+
# * <tt>:polymorphic</tt> - Specify this association is a polymorphic association by passing +true+.
|
860
|
+
# Note: If you've enabled the counter cache, then you may want to add the counter cache attribute
|
861
|
+
# to the +attr_readonly+ list in the associated classes (e.g. <tt>class Post; attr_readonly :comments_count; end</tt>).
|
862
|
+
# * <tt>:readonly</tt> - If true, the associated object is readonly through the association.
|
863
|
+
# * <tt>:validate</tt> - If false, don't validate the associated objects when saving the parent object. +false+ by default.
|
787
864
|
#
|
788
865
|
# Option examples:
|
789
866
|
# belongs_to :firm, :foreign_key => "client_of"
|
790
867
|
# belongs_to :author, :class_name => "Person", :foreign_key => "author_id"
|
791
|
-
# belongs_to :valid_coupon, :class_name => "Coupon", :foreign_key => "coupon_id",
|
868
|
+
# belongs_to :valid_coupon, :class_name => "Coupon", :foreign_key => "coupon_id",
|
792
869
|
# :conditions => 'discounts > #{payments_count}'
|
793
870
|
# belongs_to :attachable, :polymorphic => true
|
871
|
+
# belongs_to :project, :readonly => true
|
872
|
+
# belongs_to :post, :counter_cache => true
|
794
873
|
def belongs_to(association_id, options = {})
|
795
874
|
reflection = create_belongs_to_reflection(association_id, options)
|
796
|
-
|
875
|
+
|
876
|
+
ivar = "@#{reflection.name}"
|
877
|
+
|
797
878
|
if reflection.options[:polymorphic]
|
798
879
|
association_accessor_methods(reflection, BelongsToPolymorphicAssociation)
|
799
880
|
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
if association.updated?
|
809
|
-
self["#{reflection.primary_key_name}"] = association.id
|
810
|
-
self["#{reflection.options[:foreign_type]}"] = association.class.base_class.name.to_s
|
811
|
-
end
|
881
|
+
method_name = "polymorphic_belongs_to_before_save_for_#{reflection.name}".to_sym
|
882
|
+
define_method(method_name) do
|
883
|
+
association = instance_variable_get("#{ivar}") if instance_variable_defined?("#{ivar}")
|
884
|
+
|
885
|
+
if association && association.target
|
886
|
+
if association.new_record?
|
887
|
+
association.save(true)
|
812
888
|
end
|
813
|
-
|
889
|
+
|
890
|
+
if association.updated?
|
891
|
+
self["#{reflection.primary_key_name}"] = association.id
|
892
|
+
self["#{reflection.options[:foreign_type]}"] = association.class.base_class.name.to_s
|
893
|
+
end
|
894
|
+
end
|
814
895
|
end
|
896
|
+
before_save method_name
|
815
897
|
else
|
816
898
|
association_accessor_methods(reflection, BelongsToAssociation)
|
817
899
|
association_constructor_method(:build, reflection, BelongsToAssociation)
|
818
900
|
association_constructor_method(:create, reflection, BelongsToAssociation)
|
819
901
|
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
end
|
832
|
-
|
902
|
+
method_name = "belongs_to_before_save_for_#{reflection.name}".to_sym
|
903
|
+
define_method(method_name) do
|
904
|
+
association = instance_variable_get("#{ivar}") if instance_variable_defined?("#{ivar}")
|
905
|
+
|
906
|
+
if !association.nil?
|
907
|
+
if association.new_record?
|
908
|
+
association.save(true)
|
909
|
+
end
|
910
|
+
|
911
|
+
if association.updated?
|
912
|
+
self["#{reflection.primary_key_name}"] = association.id
|
913
|
+
end
|
914
|
+
end
|
833
915
|
end
|
916
|
+
before_save method_name
|
834
917
|
end
|
835
918
|
|
836
919
|
# Create the callbacks to update counter cache
|
837
920
|
if options[:counter_cache]
|
838
921
|
cache_column = options[:counter_cache] == true ?
|
839
|
-
"#{self.to_s.underscore.pluralize}_count" :
|
922
|
+
"#{self.to_s.demodulize.underscore.pluralize}_count" :
|
840
923
|
options[:counter_cache]
|
841
924
|
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
925
|
+
method_name = "belongs_to_counter_cache_after_create_for_#{reflection.name}".to_sym
|
926
|
+
define_method(method_name) do
|
927
|
+
association = send("#{reflection.name}")
|
928
|
+
association.class.increment_counter("#{cache_column}", send("#{reflection.primary_key_name}")) unless association.nil?
|
929
|
+
end
|
930
|
+
after_create method_name
|
931
|
+
|
932
|
+
method_name = "belongs_to_counter_cache_before_destroy_for_#{reflection.name}".to_sym
|
933
|
+
define_method(method_name) do
|
934
|
+
association = send("#{reflection.name}")
|
935
|
+
association.class.decrement_counter("#{cache_column}", send("#{reflection.primary_key_name}")) unless association.nil?
|
936
|
+
end
|
937
|
+
before_destroy method_name
|
846
938
|
|
847
|
-
module_eval(
|
848
|
-
"before_destroy '#{reflection.name}.class.decrement_counter(\"#{cache_column}\", #{reflection.primary_key_name})" +
|
849
|
-
" unless #{reflection.name}.nil?'"
|
850
|
-
)
|
851
|
-
|
852
939
|
module_eval(
|
853
940
|
"#{reflection.class_name}.send(:attr_readonly,\"#{cache_column}\".intern) if defined?(#{reflection.class_name}) && #{reflection.class_name}.respond_to?(:attr_readonly)"
|
854
941
|
)
|
855
942
|
end
|
943
|
+
|
944
|
+
add_single_associated_validation_callbacks(reflection.name) if options[:validate] == true
|
945
|
+
|
946
|
+
configure_dependency_for_belongs_to(reflection)
|
856
947
|
end
|
857
948
|
|
858
949
|
# Associates two classes via an intermediate join table. Unless the join table is explicitly specified as
|
859
|
-
# an option, it is guessed using the lexical order of the class names. So a join between
|
860
|
-
# will give the default join table name of
|
861
|
-
# is calculated using the <tt><</tt> operator for
|
950
|
+
# an option, it is guessed using the lexical order of the class names. So a join between Developer and Project
|
951
|
+
# will give the default join table name of "developers_projects" because "D" outranks "P". Note that this precedence
|
952
|
+
# is calculated using the <tt><</tt> operator for String. This means that if the strings are of different lengths,
|
862
953
|
# and the strings are equal when compared up to the shortest length, then the longer string is considered of higher
|
863
|
-
# lexical precedence than the shorter one. For example, one would expect the tables
|
864
|
-
# to generate a join table name of
|
865
|
-
# but it in fact generates a join table name of
|
866
|
-
# custom <tt
|
954
|
+
# lexical precedence than the shorter one. For example, one would expect the tables "paper_boxes" and "papers"
|
955
|
+
# to generate a join table name of "papers_paper_boxes" because of the length of the name "paper_boxes",
|
956
|
+
# but it in fact generates a join table name of "paper_boxes_papers". Be aware of this caveat, and use the
|
957
|
+
# custom <tt>:join_table</tt> option if you need to.
|
867
958
|
#
|
868
959
|
# Deprecated: Any additional fields added to the join table will be placed as attributes when pulling records out through
|
869
960
|
# +has_and_belongs_to_many+ associations. Records returned from join tables with additional attributes will be marked as
|
870
|
-
#
|
961
|
+
# readonly (because we can't save changes to the additional attributes). It's strongly recommended that you upgrade any
|
871
962
|
# associations with attributes to a real join model (see introduction).
|
872
963
|
#
|
873
964
|
# Adds the following methods for retrieval and query:
|
874
|
-
# +collection+ is replaced with the symbol passed as the first argument, so
|
965
|
+
# +collection+ is replaced with the symbol passed as the first argument, so
|
875
966
|
# <tt>has_and_belongs_to_many :categories</tt> would add among others <tt>categories.empty?</tt>.
|
876
|
-
# * <tt>collection(force_reload = false)</tt> -
|
967
|
+
# * <tt>collection(force_reload = false)</tt> - Returns an array of all the associated objects.
|
877
968
|
# An empty array is returned if none are found.
|
878
|
-
# * <tt>collection<<(object, ...)</tt> -
|
969
|
+
# * <tt>collection<<(object, ...)</tt> - Adds one or more objects to the collection by creating associations in the join table
|
879
970
|
# (<tt>collection.push</tt> and <tt>collection.concat</tt> are aliases to this method).
|
880
|
-
# * <tt>collection.delete(object, ...)</tt> -
|
971
|
+
# * <tt>collection.delete(object, ...)</tt> - Removes one or more objects from the collection by removing their associations from the join table.
|
881
972
|
# This does not destroy the objects.
|
882
|
-
# * <tt>collection=objects</tt> -
|
883
|
-
# * <tt>collection_singular_ids</tt> -
|
884
|
-
# * <tt>collection_singular_ids=ids</tt> -
|
885
|
-
# * <tt>collection.clear</tt> -
|
886
|
-
# * <tt>collection.empty?</tt> -
|
887
|
-
# * <tt>collection.size</tt> -
|
888
|
-
# * <tt>collection.find(id)</tt> -
|
973
|
+
# * <tt>collection=objects</tt> - Replaces the collection's content by deleting and adding objects as appropriate.
|
974
|
+
# * <tt>collection_singular_ids</tt> - Returns an array of the associated objects' ids.
|
975
|
+
# * <tt>collection_singular_ids=ids</tt> - Replace the collection by the objects identified by the primary keys in +ids+.
|
976
|
+
# * <tt>collection.clear</tt> - Removes every object from the collection. This does not destroy the objects.
|
977
|
+
# * <tt>collection.empty?</tt> - Returns +true+ if there are no associated objects.
|
978
|
+
# * <tt>collection.size</tt> - Returns the number of associated objects.
|
979
|
+
# * <tt>collection.find(id)</tt> - Finds an associated object responding to the +id+ and that
|
889
980
|
# meets the condition that it has to be associated with this object.
|
890
|
-
# * <tt>collection.build(attributes = {})</tt> -
|
981
|
+
# * <tt>collection.build(attributes = {})</tt> - Returns a new object of the collection type that has been instantiated
|
891
982
|
# with +attributes+ and linked to this object through the join table, but has not yet been saved.
|
892
|
-
# * <tt>collection.create(attributes = {})</tt> -
|
983
|
+
# * <tt>collection.create(attributes = {})</tt> - Returns a new object of the collection type that has been instantiated
|
893
984
|
# with +attributes+, linked to this object through the join table, and that has already been saved (if it passed the validation).
|
894
985
|
#
|
895
986
|
# Example: A Developer class declares <tt>has_and_belongs_to_many :projects</tt>, which will add:
|
@@ -906,48 +997,54 @@ module ActiveRecord
|
|
906
997
|
# * <tt>Developer#projects.build</tt> (similar to <tt>Project.new("project_id" => id)</tt>)
|
907
998
|
# * <tt>Developer#projects.create</tt> (similar to <tt>c = Project.new("project_id" => id); c.save; c</tt>)
|
908
999
|
# The declaration may include an options hash to specialize the behavior of the association.
|
909
|
-
#
|
1000
|
+
#
|
910
1001
|
# Options are:
|
911
|
-
# * <tt>:class_name</tt> -
|
912
|
-
# from the association name. So <tt>has_and_belongs_to_many :projects</tt> will by default be linked to the
|
913
|
-
#
|
914
|
-
# * <tt>:join_table</tt> -
|
1002
|
+
# * <tt>:class_name</tt> - Specify the class name of the association. Use it only if that name can't be inferred
|
1003
|
+
# from the association name. So <tt>has_and_belongs_to_many :projects</tt> will by default be linked to the
|
1004
|
+
# Project class, but if the real class name is SuperProject, you'll have to specify it with this option.
|
1005
|
+
# * <tt>:join_table</tt> - Specify the name of the join table if the default based on lexical order isn't what you want.
|
915
1006
|
# WARNING: If you're overwriting the table name of either class, the +table_name+ method MUST be declared underneath any
|
916
1007
|
# +has_and_belongs_to_many+ declaration in order to work.
|
917
|
-
# * <tt>:foreign_key</tt> -
|
918
|
-
# of this class in lower-case and
|
919
|
-
# will use
|
920
|
-
# * <tt>:association_foreign_key</tt> -
|
921
|
-
# guessed to be the name of the associated class in lower-case and
|
922
|
-
# the +has_and_belongs_to_many+ association will use
|
923
|
-
# * <tt>:conditions</tt>
|
924
|
-
# SQL fragment, such as <tt>authorized = 1</tt>.
|
925
|
-
#
|
1008
|
+
# * <tt>:foreign_key</tt> - Specify the foreign key used for the association. By default this is guessed to be the name
|
1009
|
+
# of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_and_belongs_to_many+ association
|
1010
|
+
# will use "person_id" as the default <tt>:foreign_key</tt>.
|
1011
|
+
# * <tt>:association_foreign_key</tt> - Specify the association foreign key used for the association. By default this is
|
1012
|
+
# guessed to be the name of the associated class in lower-case and "_id" suffixed. So if the associated class is Project,
|
1013
|
+
# the +has_and_belongs_to_many+ association will use "project_id" as the default <tt>:association_foreign_key</tt>.
|
1014
|
+
# * <tt>:conditions</tt> - Specify the conditions that the associated object must meet in order to be included as a +WHERE+
|
1015
|
+
# SQL fragment, such as <tt>authorized = 1</tt>. Record creations from the association are scoped if a hash is used.
|
1016
|
+
# <tt>has_many :posts, :conditions => {:published => true}</tt> will create published posts with <tt>@blog.posts.create</tt>
|
1017
|
+
# or <tt>@blog.posts.build</tt>.
|
1018
|
+
# * <tt>:order</tt> - Specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
926
1019
|
# such as <tt>last_name, first_name DESC</tt>
|
927
|
-
# * <tt>:uniq</tt> -
|
928
|
-
# * <tt>:finder_sql</tt> -
|
929
|
-
# * <tt>:delete_sql</tt> -
|
930
|
-
# classes with a manual statement
|
931
|
-
# * <tt>:insert_sql</tt> -
|
932
|
-
# with a manual statement
|
933
|
-
# * <tt>:extend</tt>
|
934
|
-
# * <tt>:include</tt>
|
935
|
-
# * <tt>:group</tt
|
936
|
-
# * <tt>:limit</tt
|
937
|
-
# * <tt>:offset</tt
|
938
|
-
# * <tt>:select</tt
|
939
|
-
# but not include the joined columns.
|
1020
|
+
# * <tt>:uniq</tt> - If true, duplicate associated objects will be ignored by accessors and query methods.
|
1021
|
+
# * <tt>:finder_sql</tt> - Overwrite the default generated SQL statement used to fetch the association with a manual statement
|
1022
|
+
# * <tt>:delete_sql</tt> - Overwrite the default generated SQL statement used to remove links between the associated
|
1023
|
+
# classes with a manual statement.
|
1024
|
+
# * <tt>:insert_sql</tt> - Overwrite the default generated SQL statement used to add links between the associated classes
|
1025
|
+
# with a manual statement.
|
1026
|
+
# * <tt>:extend</tt> - Anonymous module for extending the proxy, see "Association extensions".
|
1027
|
+
# * <tt>:include</tt> - Specify second-order associations that should be eager loaded when the collection is loaded.
|
1028
|
+
# * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
|
1029
|
+
# * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
|
1030
|
+
# * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, it would skip the first 4 rows.
|
1031
|
+
# * <tt>:select</tt> - By default, this is <tt>*</tt> as in <tt>SELECT * FROM</tt>, but can be changed if, for example, you want to do a join
|
1032
|
+
# but not include the joined columns. Do not forget to include the primary and foreign keys, otherwise it will raise an error.
|
1033
|
+
# * <tt>:readonly</tt> - If true, all the associated objects are readonly through the association.
|
1034
|
+
# * <tt>:validate</tt> - If false, don't validate the associated objects when saving the parent object. +true+ by default.
|
940
1035
|
#
|
941
1036
|
# Option examples:
|
942
1037
|
# has_and_belongs_to_many :projects
|
943
1038
|
# has_and_belongs_to_many :projects, :include => [ :milestones, :manager ]
|
944
1039
|
# has_and_belongs_to_many :nations, :class_name => "Country"
|
945
1040
|
# has_and_belongs_to_many :categories, :join_table => "prods_cats"
|
946
|
-
# has_and_belongs_to_many :
|
1041
|
+
# has_and_belongs_to_many :categories, :readonly => true
|
1042
|
+
# has_and_belongs_to_many :active_projects, :join_table => 'developers_projects', :delete_sql =>
|
947
1043
|
# 'DELETE FROM developers_projects WHERE active=1 AND developer_id = #{id} AND project_id = #{record.id}'
|
948
1044
|
def has_and_belongs_to_many(association_id, options = {}, &extension)
|
949
1045
|
reflection = create_has_and_belongs_to_many_reflection(association_id, options, &extension)
|
950
|
-
|
1046
|
+
|
1047
|
+
add_multiple_associated_validation_callbacks(reflection.name) unless options[:validate] == false
|
951
1048
|
add_multiple_associated_save_callbacks(reflection.name)
|
952
1049
|
collection_accessor_methods(reflection, HasAndBelongsToManyAssociation)
|
953
1050
|
|
@@ -981,37 +1078,41 @@ module ActiveRecord
|
|
981
1078
|
|
982
1079
|
table_name_prefix + join_table + table_name_suffix
|
983
1080
|
end
|
984
|
-
|
1081
|
+
|
985
1082
|
def association_accessor_methods(reflection, association_proxy_class)
|
1083
|
+
ivar = "@#{reflection.name}"
|
1084
|
+
|
986
1085
|
define_method(reflection.name) do |*params|
|
987
1086
|
force_reload = params.first unless params.empty?
|
988
|
-
|
1087
|
+
|
1088
|
+
association = instance_variable_get(ivar) if instance_variable_defined?(ivar)
|
989
1089
|
|
990
1090
|
if association.nil? || force_reload
|
991
1091
|
association = association_proxy_class.new(self, reflection)
|
992
1092
|
retval = association.reload
|
993
1093
|
if retval.nil? and association_proxy_class == BelongsToAssociation
|
994
|
-
instance_variable_set(
|
1094
|
+
instance_variable_set(ivar, nil)
|
995
1095
|
return nil
|
996
1096
|
end
|
997
|
-
instance_variable_set(
|
1097
|
+
instance_variable_set(ivar, association)
|
998
1098
|
end
|
999
1099
|
|
1000
1100
|
association.target.nil? ? nil : association
|
1001
1101
|
end
|
1002
1102
|
|
1003
1103
|
define_method("#{reflection.name}=") do |new_value|
|
1004
|
-
association = instance_variable_get(
|
1104
|
+
association = instance_variable_get(ivar) if instance_variable_defined?(ivar)
|
1105
|
+
|
1005
1106
|
if association.nil? || association.target != new_value
|
1006
1107
|
association = association_proxy_class.new(self, reflection)
|
1007
1108
|
end
|
1008
1109
|
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
instance_variable_set("@#{reflection.name}", association)
|
1110
|
+
if association_proxy_class == HasOneThroughAssociation
|
1111
|
+
association.create_through_record(new_value)
|
1112
|
+
self.send(reflection.name, new_value)
|
1013
1113
|
else
|
1014
|
-
|
1114
|
+
association.replace(new_value)
|
1115
|
+
instance_variable_set(ivar, new_value.nil? ? nil : association)
|
1015
1116
|
end
|
1016
1117
|
end
|
1017
1118
|
|
@@ -1019,55 +1120,76 @@ module ActiveRecord
|
|
1019
1120
|
return if target.nil? and association_proxy_class == BelongsToAssociation
|
1020
1121
|
association = association_proxy_class.new(self, reflection)
|
1021
1122
|
association.target = target
|
1022
|
-
instance_variable_set(
|
1123
|
+
instance_variable_set(ivar, association)
|
1023
1124
|
end
|
1024
1125
|
end
|
1025
1126
|
|
1026
1127
|
def collection_reader_method(reflection, association_proxy_class)
|
1027
1128
|
define_method(reflection.name) do |*params|
|
1129
|
+
ivar = "@#{reflection.name}"
|
1130
|
+
|
1028
1131
|
force_reload = params.first unless params.empty?
|
1029
|
-
association = instance_variable_get(
|
1132
|
+
association = instance_variable_get(ivar) if instance_variable_defined?(ivar)
|
1030
1133
|
|
1031
1134
|
unless association.respond_to?(:loaded?)
|
1032
1135
|
association = association_proxy_class.new(self, reflection)
|
1033
|
-
instance_variable_set(
|
1136
|
+
instance_variable_set(ivar, association)
|
1034
1137
|
end
|
1035
1138
|
|
1036
1139
|
association.reload if force_reload
|
1037
1140
|
|
1038
1141
|
association
|
1039
1142
|
end
|
1143
|
+
|
1144
|
+
define_method("#{reflection.name.to_s.singularize}_ids") do
|
1145
|
+
send(reflection.name).map(&:id)
|
1146
|
+
end
|
1040
1147
|
end
|
1041
1148
|
|
1042
1149
|
def collection_accessor_methods(reflection, association_proxy_class, writer = true)
|
1043
1150
|
collection_reader_method(reflection, association_proxy_class)
|
1044
1151
|
|
1045
|
-
|
1046
|
-
#
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1152
|
+
if writer
|
1153
|
+
define_method("#{reflection.name}=") do |new_value|
|
1154
|
+
# Loads proxy class instance (defined in collection_reader_method) if not already loaded
|
1155
|
+
association = send(reflection.name)
|
1156
|
+
association.replace(new_value)
|
1157
|
+
association
|
1158
|
+
end
|
1051
1159
|
|
1052
|
-
|
1053
|
-
|
1160
|
+
define_method("#{reflection.name.to_s.singularize}_ids=") do |new_value|
|
1161
|
+
ids = (new_value || []).reject { |nid| nid.blank? }
|
1162
|
+
send("#{reflection.name}=", reflection.class_name.constantize.find(ids))
|
1163
|
+
end
|
1054
1164
|
end
|
1055
|
-
|
1056
|
-
define_method("#{reflection.name.to_s.singularize}_ids=") do |new_value|
|
1057
|
-
ids = (new_value || []).reject { |nid| nid.blank? }
|
1058
|
-
send("#{reflection.name}=", reflection.class_name.constantize.find(ids))
|
1059
|
-
end if writer
|
1060
1165
|
end
|
1061
|
-
|
1062
|
-
def
|
1166
|
+
|
1167
|
+
def add_single_associated_validation_callbacks(association_name)
|
1063
1168
|
method_name = "validate_associated_records_for_#{association_name}".to_sym
|
1064
1169
|
define_method(method_name) do
|
1065
1170
|
association = instance_variable_get("@#{association_name}")
|
1171
|
+
if !association.nil?
|
1172
|
+
errors.add "#{association_name}" unless association.target.nil? || association.valid?
|
1173
|
+
end
|
1174
|
+
end
|
1175
|
+
|
1176
|
+
validate method_name
|
1177
|
+
end
|
1178
|
+
|
1179
|
+
def add_multiple_associated_validation_callbacks(association_name)
|
1180
|
+
method_name = "validate_associated_records_for_#{association_name}".to_sym
|
1181
|
+
ivar = "@#{association_name}"
|
1182
|
+
|
1183
|
+
define_method(method_name) do
|
1184
|
+
association = instance_variable_get(ivar) if instance_variable_defined?(ivar)
|
1185
|
+
|
1066
1186
|
if association.respond_to?(:loaded?)
|
1067
1187
|
if new_record?
|
1068
1188
|
association
|
1069
|
-
|
1189
|
+
elsif association.loaded?
|
1070
1190
|
association.select { |record| record.new_record? }
|
1191
|
+
else
|
1192
|
+
association.target.select { |record| record.new_record? }
|
1071
1193
|
end.each do |record|
|
1072
1194
|
errors.add "#{association_name}" unless record.valid?
|
1073
1195
|
end
|
@@ -1075,39 +1197,53 @@ module ActiveRecord
|
|
1075
1197
|
end
|
1076
1198
|
|
1077
1199
|
validate method_name
|
1078
|
-
|
1200
|
+
end
|
1079
1201
|
|
1080
|
-
|
1081
|
-
|
1202
|
+
def add_multiple_associated_save_callbacks(association_name)
|
1203
|
+
ivar = "@#{association_name}"
|
1204
|
+
|
1205
|
+
method_name = "before_save_associated_records_for_#{association_name}".to_sym
|
1206
|
+
define_method(method_name) do
|
1207
|
+
@new_record_before_save = new_record?
|
1208
|
+
true
|
1209
|
+
end
|
1210
|
+
before_save method_name
|
1211
|
+
|
1212
|
+
method_name = "after_create_or_update_associated_records_for_#{association_name}".to_sym
|
1213
|
+
define_method(method_name) do
|
1214
|
+
association = instance_variable_get("#{ivar}") if instance_variable_defined?("#{ivar}")
|
1082
1215
|
|
1083
1216
|
records_to_save = if @new_record_before_save
|
1084
1217
|
association
|
1085
1218
|
elsif association.respond_to?(:loaded?) && association.loaded?
|
1086
1219
|
association.select { |record| record.new_record? }
|
1220
|
+
elsif association.respond_to?(:loaded?) && !association.loaded?
|
1221
|
+
association.target.select { |record| record.new_record? }
|
1087
1222
|
else
|
1088
1223
|
[]
|
1089
1224
|
end
|
1090
|
-
|
1091
1225
|
records_to_save.each { |record| association.send(:insert_record, record) } unless records_to_save.blank?
|
1092
|
-
|
1226
|
+
|
1093
1227
|
# reconstruct the SQL queries now that we know the owner's id
|
1094
1228
|
association.send(:construct_sql) if association.respond_to?(:construct_sql)
|
1095
|
-
|
1229
|
+
end
|
1096
1230
|
|
1097
1231
|
# Doesn't use after_save as that would save associations added in after_create/after_update twice
|
1098
|
-
after_create
|
1099
|
-
after_update
|
1232
|
+
after_create method_name
|
1233
|
+
after_update method_name
|
1100
1234
|
end
|
1101
1235
|
|
1102
1236
|
def association_constructor_method(constructor, reflection, association_proxy_class)
|
1103
1237
|
define_method("#{constructor}_#{reflection.name}") do |*params|
|
1238
|
+
ivar = "@#{reflection.name}"
|
1239
|
+
|
1104
1240
|
attributees = params.first unless params.empty?
|
1105
1241
|
replace_existing = params[1].nil? ? true : params[1]
|
1106
|
-
association = instance_variable_get(
|
1242
|
+
association = instance_variable_get(ivar) if instance_variable_defined?(ivar)
|
1107
1243
|
|
1108
1244
|
if association.nil?
|
1109
1245
|
association = association_proxy_class.new(self, reflection)
|
1110
|
-
instance_variable_set(
|
1246
|
+
instance_variable_set(ivar, association)
|
1111
1247
|
end
|
1112
1248
|
|
1113
1249
|
if association_proxy_class == HasOneAssociation
|
@@ -1117,7 +1253,7 @@ module ActiveRecord
|
|
1117
1253
|
end
|
1118
1254
|
end
|
1119
1255
|
end
|
1120
|
-
|
1256
|
+
|
1121
1257
|
def find_with_associations(options = {})
|
1122
1258
|
catch :invalid_query do
|
1123
1259
|
join_dependency = JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins])
|
@@ -1140,7 +1276,11 @@ module ActiveRecord
|
|
1140
1276
|
|
1141
1277
|
case reflection.options[:dependent]
|
1142
1278
|
when :destroy
|
1143
|
-
|
1279
|
+
method_name = "has_many_dependent_destroy_for_#{reflection.name}".to_sym
|
1280
|
+
define_method(method_name) do
|
1281
|
+
send("#{reflection.name}").each { |o| o.destroy }
|
1282
|
+
end
|
1283
|
+
before_destroy method_name
|
1144
1284
|
when :delete_all
|
1145
1285
|
module_eval "before_destroy { |record| #{reflection.class_name}.delete_all(%(#{dependent_conditions})) }"
|
1146
1286
|
when :nullify
|
@@ -1155,17 +1295,55 @@ module ActiveRecord
|
|
1155
1295
|
if reflection.options.include?(:dependent)
|
1156
1296
|
case reflection.options[:dependent]
|
1157
1297
|
when :destroy
|
1158
|
-
|
1298
|
+
method_name = "has_one_dependent_destroy_for_#{reflection.name}".to_sym
|
1299
|
+
define_method(method_name) do
|
1300
|
+
association = send("#{reflection.name}")
|
1301
|
+
association.destroy unless association.nil?
|
1302
|
+
end
|
1303
|
+
before_destroy method_name
|
1159
1304
|
when :delete
|
1160
|
-
|
1305
|
+
method_name = "has_one_dependent_delete_for_#{reflection.name}".to_sym
|
1306
|
+
define_method(method_name) do
|
1307
|
+
association = send("#{reflection.name}")
|
1308
|
+
association.class.delete(association.id) unless association.nil?
|
1309
|
+
end
|
1310
|
+
before_destroy method_name
|
1161
1311
|
when :nullify
|
1162
|
-
|
1312
|
+
method_name = "has_one_dependent_nullify_for_#{reflection.name}".to_sym
|
1313
|
+
define_method(method_name) do
|
1314
|
+
association = send("#{reflection.name}")
|
1315
|
+
association.update_attribute("#{reflection.primary_key_name}", nil) unless association.nil?
|
1316
|
+
end
|
1317
|
+
before_destroy method_name
|
1163
1318
|
else
|
1164
1319
|
raise ArgumentError, "The :dependent option expects either :destroy, :delete or :nullify (#{reflection.options[:dependent].inspect})"
|
1165
1320
|
end
|
1166
1321
|
end
|
1167
1322
|
end
|
1168
1323
|
|
1324
|
+
def configure_dependency_for_belongs_to(reflection)
|
1325
|
+
if reflection.options.include?(:dependent)
|
1326
|
+
case reflection.options[:dependent]
|
1327
|
+
when :destroy
|
1328
|
+
method_name = "belongs_to_dependent_destroy_for_#{reflection.name}".to_sym
|
1329
|
+
define_method(method_name) do
|
1330
|
+
association = send("#{reflection.name}")
|
1331
|
+
association.destroy unless association.nil?
|
1332
|
+
end
|
1333
|
+
before_destroy method_name
|
1334
|
+
when :delete
|
1335
|
+
method_name = "belongs_to_dependent_delete_for_#{reflection.name}".to_sym
|
1336
|
+
define_method(method_name) do
|
1337
|
+
association = send("#{reflection.name}")
|
1338
|
+
association.class.delete(association.id) unless association.nil?
|
1339
|
+
end
|
1340
|
+
before_destroy method_name
|
1341
|
+
else
|
1342
|
+
raise ArgumentError, "The :dependent option expects either :destroy or :delete (#{reflection.options[:dependent].inspect})"
|
1343
|
+
end
|
1344
|
+
end
|
1345
|
+
end
|
1346
|
+
|
1169
1347
|
def create_has_many_reflection(association_id, options, &extension)
|
1170
1348
|
options.assert_valid_keys(
|
1171
1349
|
:class_name, :table_name, :foreign_key,
|
@@ -1173,30 +1351,38 @@ module ActiveRecord
|
|
1173
1351
|
:select, :conditions, :include, :order, :group, :limit, :offset,
|
1174
1352
|
:as, :through, :source, :source_type,
|
1175
1353
|
:uniq,
|
1176
|
-
:finder_sql, :counter_sql,
|
1177
|
-
:before_add, :after_add, :before_remove, :after_remove,
|
1178
|
-
:extend
|
1354
|
+
:finder_sql, :counter_sql,
|
1355
|
+
:before_add, :after_add, :before_remove, :after_remove,
|
1356
|
+
:extend, :readonly,
|
1357
|
+
:validate
|
1179
1358
|
)
|
1180
1359
|
|
1181
|
-
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
|
1360
|
+
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
|
1182
1361
|
|
1183
1362
|
create_reflection(:has_many, association_id, options, self)
|
1184
1363
|
end
|
1185
1364
|
|
1186
1365
|
def create_has_one_reflection(association_id, options)
|
1187
1366
|
options.assert_valid_keys(
|
1188
|
-
:class_name, :foreign_key, :remote, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as
|
1367
|
+
:class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :readonly, :validate
|
1189
1368
|
)
|
1190
1369
|
|
1191
1370
|
create_reflection(:has_one, association_id, options, self)
|
1192
1371
|
end
|
1372
|
+
|
1373
|
+
def create_has_one_through_reflection(association_id, options)
|
1374
|
+
options.assert_valid_keys(
|
1375
|
+
:class_name, :foreign_key, :remote, :select, :conditions, :order, :include, :dependent, :counter_cache, :extend, :as, :through, :source, :source_type, :validate
|
1376
|
+
)
|
1377
|
+
create_reflection(:has_one, association_id, options, self)
|
1378
|
+
end
|
1193
1379
|
|
1194
1380
|
def create_belongs_to_reflection(association_id, options)
|
1195
1381
|
options.assert_valid_keys(
|
1196
|
-
:class_name, :foreign_key, :foreign_type, :remote, :
|
1197
|
-
:counter_cache, :extend, :polymorphic
|
1382
|
+
:class_name, :foreign_key, :foreign_type, :remote, :select, :conditions, :include, :dependent,
|
1383
|
+
:counter_cache, :extend, :polymorphic, :readonly, :validate
|
1198
1384
|
)
|
1199
|
-
|
1385
|
+
|
1200
1386
|
reflection = create_reflection(:belongs_to, association_id, options, self)
|
1201
1387
|
|
1202
1388
|
if options[:polymorphic]
|
@@ -1205,23 +1391,24 @@ module ActiveRecord
|
|
1205
1391
|
|
1206
1392
|
reflection
|
1207
1393
|
end
|
1208
|
-
|
1394
|
+
|
1209
1395
|
def create_has_and_belongs_to_many_reflection(association_id, options, &extension)
|
1210
1396
|
options.assert_valid_keys(
|
1211
|
-
:class_name, :table_name, :join_table, :foreign_key, :association_foreign_key,
|
1397
|
+
:class_name, :table_name, :join_table, :foreign_key, :association_foreign_key,
|
1212
1398
|
:select, :conditions, :include, :order, :group, :limit, :offset,
|
1213
|
-
:uniq,
|
1399
|
+
:uniq,
|
1214
1400
|
:finder_sql, :delete_sql, :insert_sql,
|
1215
|
-
:before_add, :after_add, :before_remove, :after_remove,
|
1216
|
-
:extend
|
1401
|
+
:before_add, :after_add, :before_remove, :after_remove,
|
1402
|
+
:extend, :readonly,
|
1403
|
+
:validate
|
1217
1404
|
)
|
1218
1405
|
|
1219
|
-
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
|
1406
|
+
options[:extend] = create_extension_modules(association_id, extension, options[:extend])
|
1220
1407
|
|
1221
1408
|
reflection = create_reflection(:has_and_belongs_to_many, association_id, options, self)
|
1222
1409
|
|
1223
1410
|
reflection.options[:join_table] ||= join_table_name(undecorated_table_name(self.to_s), undecorated_table_name(reflection.class_name))
|
1224
|
-
|
1411
|
+
|
1225
1412
|
reflection
|
1226
1413
|
end
|
1227
1414
|
|
@@ -1232,7 +1419,7 @@ module ActiveRecord
|
|
1232
1419
|
def guard_against_unlimitable_reflections(reflections, options)
|
1233
1420
|
if (options[:offset] || options[:limit]) && !using_limitable_reflections?(reflections)
|
1234
1421
|
raise(
|
1235
|
-
ConfigurationError,
|
1422
|
+
ConfigurationError,
|
1236
1423
|
"You can not use offset and limit together with has_many or has_and_belongs_to_many associations"
|
1237
1424
|
)
|
1238
1425
|
end
|
@@ -1249,7 +1436,7 @@ module ActiveRecord
|
|
1249
1436
|
scope = scope(:find)
|
1250
1437
|
sql = "SELECT #{column_aliases(join_dependency)} FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} "
|
1251
1438
|
sql << join_dependency.join_associations.collect{|join| join.association_join }.join
|
1252
|
-
|
1439
|
+
|
1253
1440
|
add_joins!(sql, options, scope)
|
1254
1441
|
add_conditions!(sql, options[:conditions], scope)
|
1255
1442
|
add_limited_ids_condition!(sql, options, join_dependency) if !using_limitable_reflections?(join_dependency.reflections) && ((scope && scope[:limit]) || options[:limit])
|
@@ -1258,10 +1445,10 @@ module ActiveRecord
|
|
1258
1445
|
add_order!(sql, options[:order], scope)
|
1259
1446
|
add_limit!(sql, options, scope) if using_limitable_reflections?(join_dependency.reflections)
|
1260
1447
|
add_lock!(sql, options, scope)
|
1261
|
-
|
1448
|
+
|
1262
1449
|
return sanitize_sql(sql)
|
1263
1450
|
end
|
1264
|
-
|
1451
|
+
|
1265
1452
|
def add_limited_ids_condition!(sql, options, join_dependency)
|
1266
1453
|
unless (id_list = select_limited_ids_list(options, join_dependency)).empty?
|
1267
1454
|
sql << "#{condition_word(sql)} #{connection.quote_table_name table_name}.#{primary_key} IN (#{id_list}) "
|
@@ -1281,25 +1468,39 @@ module ActiveRecord
|
|
1281
1468
|
|
1282
1469
|
def construct_finder_sql_for_association_limiting(options, join_dependency)
|
1283
1470
|
scope = scope(:find)
|
1284
|
-
|
1471
|
+
|
1472
|
+
# Only join tables referenced in order or conditions since this is particularly slow on the pre-query.
|
1473
|
+
tables_from_conditions = conditions_tables(options)
|
1474
|
+
tables_from_order = order_tables(options)
|
1475
|
+
all_tables = tables_from_conditions + tables_from_order
|
1476
|
+
distinct_join_associations = all_tables.uniq.map{|table|
|
1477
|
+
join_dependency.joins_for_table_name(table)
|
1478
|
+
}.flatten.compact.uniq
|
1479
|
+
|
1480
|
+
order = options[:order]
|
1481
|
+
if scoped_order = (scope && scope[:order])
|
1482
|
+
order = order ? "#{order}, #{scoped_order}" : scoped_order
|
1483
|
+
end
|
1484
|
+
|
1485
|
+
is_distinct = !options[:joins].blank? || include_eager_conditions?(options, tables_from_conditions) || include_eager_order?(options, tables_from_order)
|
1285
1486
|
sql = "SELECT "
|
1286
1487
|
if is_distinct
|
1287
|
-
sql << connection.distinct("#{connection.quote_table_name table_name}.#{primary_key}",
|
1488
|
+
sql << connection.distinct("#{connection.quote_table_name table_name}.#{primary_key}", order)
|
1288
1489
|
else
|
1289
1490
|
sql << primary_key
|
1290
1491
|
end
|
1291
1492
|
sql << " FROM #{connection.quote_table_name table_name} "
|
1292
1493
|
|
1293
1494
|
if is_distinct
|
1294
|
-
sql <<
|
1495
|
+
sql << distinct_join_associations.collect(&:association_join).join
|
1295
1496
|
add_joins!(sql, options, scope)
|
1296
1497
|
end
|
1297
1498
|
|
1298
1499
|
add_conditions!(sql, options[:conditions], scope)
|
1299
1500
|
add_group!(sql, options[:group], scope)
|
1300
1501
|
|
1301
|
-
if
|
1302
|
-
connection.add_order_by_for_association_limiting!(sql,
|
1502
|
+
if order && is_distinct
|
1503
|
+
connection.add_order_by_for_association_limiting!(sql, :order => order)
|
1303
1504
|
else
|
1304
1505
|
add_order!(sql, options[:order], scope)
|
1305
1506
|
end
|
@@ -1309,8 +1510,7 @@ module ActiveRecord
|
|
1309
1510
|
return sanitize_sql(sql)
|
1310
1511
|
end
|
1311
1512
|
|
1312
|
-
|
1313
|
-
def include_eager_conditions?(options)
|
1513
|
+
def conditions_tables(options)
|
1314
1514
|
# look in both sets of conditions
|
1315
1515
|
conditions = [scope(:find, :conditions), options[:conditions]].inject([]) do |all, cond|
|
1316
1516
|
case cond
|
@@ -1319,19 +1519,37 @@ module ActiveRecord
|
|
1319
1519
|
else all << cond
|
1320
1520
|
end
|
1321
1521
|
end
|
1322
|
-
|
1323
|
-
conditions.join(' ').scan(/([\.\w]+)\.\w+/).flatten.any? do |condition_table_name|
|
1324
|
-
condition_table_name != table_name
|
1325
|
-
end
|
1522
|
+
conditions.join(' ').scan(/([\.a-zA-Z_]+).?\./).flatten
|
1326
1523
|
end
|
1327
|
-
|
1524
|
+
|
1525
|
+
def order_tables(options)
|
1526
|
+
order = [options[:order], scope(:find, :order) ].join(", ")
|
1527
|
+
return [] unless order && order.is_a?(String)
|
1528
|
+
order.scan(/([\.a-zA-Z_]+).?\./).flatten
|
1529
|
+
end
|
1530
|
+
|
1531
|
+
def selects_tables(options)
|
1532
|
+
select = options[:select]
|
1533
|
+
return [] unless select && select.is_a?(String)
|
1534
|
+
select.scan(/"?([\.a-zA-Z_]+)"?.?\./).flatten
|
1535
|
+
end
|
1536
|
+
|
1537
|
+
# Checks if the conditions reference a table other than the current model table
|
1538
|
+
def include_eager_conditions?(options, tables = nil)
|
1539
|
+
((tables || conditions_tables(options)) - [table_name]).any?
|
1540
|
+
end
|
1541
|
+
|
1328
1542
|
# Checks if the query order references a table other than the current model's table.
|
1329
|
-
def include_eager_order?(options)
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1543
|
+
def include_eager_order?(options, tables = nil)
|
1544
|
+
((tables || order_tables(options)) - [table_name]).any?
|
1545
|
+
end
|
1546
|
+
|
1547
|
+
def include_eager_select?(options)
|
1548
|
+
(selects_tables(options) - [table_name]).any?
|
1549
|
+
end
|
1550
|
+
|
1551
|
+
def references_eager_loaded_tables?(options)
|
1552
|
+
include_eager_order?(options) || include_eager_conditions?(options) || include_eager_select?(options)
|
1335
1553
|
end
|
1336
1554
|
|
1337
1555
|
def using_limitable_reflections?(reflections)
|
@@ -1362,13 +1580,16 @@ module ActiveRecord
|
|
1362
1580
|
end
|
1363
1581
|
|
1364
1582
|
def create_extension_modules(association_id, block_extension, extensions)
|
1365
|
-
|
1583
|
+
if block_extension
|
1584
|
+
extension_module_name = "#{self.to_s.demodulize}#{association_id.to_s.camelize}AssociationExtension"
|
1366
1585
|
|
1367
|
-
|
1368
|
-
|
1586
|
+
silence_warnings do
|
1587
|
+
self.parent.const_set(extension_module_name, Module.new(&block_extension))
|
1588
|
+
end
|
1589
|
+
Array(extensions).push("#{self.parent}::#{extension_module_name}".constantize)
|
1590
|
+
else
|
1591
|
+
Array(extensions)
|
1369
1592
|
end
|
1370
|
-
|
1371
|
-
Array(extensions).push(extension_module_name.constantize)
|
1372
1593
|
end
|
1373
1594
|
|
1374
1595
|
class JoinDependency # :nodoc:
|
@@ -1422,8 +1643,10 @@ module ActiveRecord
|
|
1422
1643
|
is_collection = [:has_many, :has_and_belongs_to_many].include?(reflection.macro)
|
1423
1644
|
|
1424
1645
|
parent_records = records.map do |record|
|
1425
|
-
|
1426
|
-
|
1646
|
+
descendant = record.send(reflection.name)
|
1647
|
+
next unless descendant
|
1648
|
+
descendant.target.uniq! if is_collection
|
1649
|
+
descendant
|
1427
1650
|
end.flatten.compact
|
1428
1651
|
|
1429
1652
|
remove_duplicate_results!(reflection.class_name.constantize, parent_records, associations[name]) unless parent_records.empty?
|
@@ -1431,6 +1654,25 @@ module ActiveRecord
|
|
1431
1654
|
end
|
1432
1655
|
end
|
1433
1656
|
|
1657
|
+
def join_for_table_name(table_name)
|
1658
|
+
join = (@joins.select{|j|j.aliased_table_name == table_name.gsub(/^\"(.*)\"$/){$1} }.first) rescue nil
|
1659
|
+
return join unless join.nil?
|
1660
|
+
@joins.select{|j|j.is_a?(JoinAssociation) && j.aliased_join_table_name == table_name.gsub(/^\"(.*)\"$/){$1} }.first rescue nil
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
def joins_for_table_name(table_name)
|
1664
|
+
join = join_for_table_name(table_name)
|
1665
|
+
result = nil
|
1666
|
+
if join && join.is_a?(JoinAssociation)
|
1667
|
+
result = [join]
|
1668
|
+
if join.parent && join.parent.is_a?(JoinAssociation)
|
1669
|
+
result = joins_for_table_name(join.parent.aliased_table_name) +
|
1670
|
+
result
|
1671
|
+
end
|
1672
|
+
end
|
1673
|
+
result
|
1674
|
+
end
|
1675
|
+
|
1434
1676
|
protected
|
1435
1677
|
def build(associations, parent = nil)
|
1436
1678
|
parent ||= @joins.last
|
@@ -1491,6 +1733,7 @@ module ActiveRecord
|
|
1491
1733
|
collection.target.push(association)
|
1492
1734
|
when :has_one
|
1493
1735
|
return if record.id.to_s != join.parent.record_id(row).to_s
|
1736
|
+
return if record.instance_variable_defined?("@#{join.reflection.name}")
|
1494
1737
|
association = join.instantiate(row) unless row[join.aliased_primary_key].nil?
|
1495
1738
|
record.send("set_#{join.reflection.name}_target", association)
|
1496
1739
|
when :belongs_to
|
@@ -1526,13 +1769,15 @@ module ActiveRecord
|
|
1526
1769
|
end
|
1527
1770
|
|
1528
1771
|
def column_names_with_alias
|
1529
|
-
unless @column_names_with_alias
|
1772
|
+
unless defined?(@column_names_with_alias)
|
1530
1773
|
@column_names_with_alias = []
|
1774
|
+
|
1531
1775
|
([primary_key] + (column_names - [primary_key])).each_with_index do |column_name, i|
|
1532
1776
|
@column_names_with_alias << [column_name, "#{ aliased_prefix }_r#{ i }"]
|
1533
1777
|
end
|
1534
1778
|
end
|
1535
|
-
|
1779
|
+
|
1780
|
+
@column_names_with_alias
|
1536
1781
|
end
|
1537
1782
|
|
1538
1783
|
def extract_record(row)
|
@@ -1559,36 +1804,19 @@ module ActiveRecord
|
|
1559
1804
|
end
|
1560
1805
|
|
1561
1806
|
super(reflection.klass)
|
1807
|
+
@join_dependency = join_dependency
|
1562
1808
|
@parent = parent
|
1563
1809
|
@reflection = reflection
|
1564
1810
|
@aliased_prefix = "t#{ join_dependency.joins.size }"
|
1565
|
-
@aliased_table_name = table_name #.tr('.', '_') # start with the table name, sub out any .'s
|
1566
1811
|
@parent_table_name = parent.active_record.table_name
|
1567
|
-
|
1568
|
-
if !parent.table_joins.blank? && parent.table_joins.to_s.downcase =~ %r{join(\s+\w+)?\s+#{aliased_table_name.downcase}\son}
|
1569
|
-
join_dependency.table_aliases[aliased_table_name] += 1
|
1570
|
-
end
|
1812
|
+
@aliased_table_name = aliased_table_name_for(table_name)
|
1571
1813
|
|
1572
|
-
|
1573
|
-
|
1574
|
-
@aliased_table_name = active_record.connection.table_alias_for "#{pluralize(reflection.name)}_#{parent_table_name}"
|
1575
|
-
table_index = join_dependency.table_aliases[aliased_table_name]
|
1576
|
-
join_dependency.table_aliases[aliased_table_name] += 1
|
1577
|
-
@aliased_table_name = @aliased_table_name[0..active_record.connection.table_alias_length-3] + "_#{table_index+1}" if table_index > 0
|
1578
|
-
else
|
1579
|
-
join_dependency.table_aliases[aliased_table_name] += 1
|
1814
|
+
if reflection.macro == :has_and_belongs_to_many
|
1815
|
+
@aliased_join_table_name = aliased_table_name_for(reflection.options[:join_table], "_join")
|
1580
1816
|
end
|
1581
|
-
|
1582
|
-
if
|
1583
|
-
@aliased_join_table_name = reflection.
|
1584
|
-
unless join_dependency.table_aliases[aliased_join_table_name].zero?
|
1585
|
-
@aliased_join_table_name = active_record.connection.table_alias_for "#{pluralize(reflection.name)}_#{parent_table_name}_join"
|
1586
|
-
table_index = join_dependency.table_aliases[aliased_join_table_name]
|
1587
|
-
join_dependency.table_aliases[aliased_join_table_name] += 1
|
1588
|
-
@aliased_join_table_name = @aliased_join_table_name[0..active_record.connection.table_alias_length-3] + "_#{table_index+1}" if table_index > 0
|
1589
|
-
else
|
1590
|
-
join_dependency.table_aliases[aliased_join_table_name] += 1
|
1591
|
-
end
|
1817
|
+
|
1818
|
+
if [:has_many, :has_one].include?(reflection.macro) && reflection.options[:through]
|
1819
|
+
@aliased_join_table_name = aliased_table_name_for(reflection.through_reflection.klass.table_name, "_join")
|
1592
1820
|
end
|
1593
1821
|
end
|
1594
1822
|
|
@@ -1601,22 +1829,22 @@ module ActiveRecord
|
|
1601
1829
|
connection.quote_table_name(aliased_join_table_name),
|
1602
1830
|
options[:foreign_key] || reflection.active_record.to_s.foreign_key,
|
1603
1831
|
connection.quote_table_name(parent.aliased_table_name),
|
1604
|
-
|
1832
|
+
reflection.active_record.primary_key] +
|
1605
1833
|
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1606
1834
|
table_name_and_alias,
|
1607
|
-
|
1608
|
-
|
1835
|
+
connection.quote_table_name(aliased_table_name),
|
1836
|
+
klass.primary_key,
|
1609
1837
|
connection.quote_table_name(aliased_join_table_name),
|
1610
|
-
|
1838
|
+
options[:association_foreign_key] || klass.to_s.foreign_key
|
1611
1839
|
]
|
1612
1840
|
when :has_many, :has_one
|
1613
1841
|
case
|
1614
|
-
when reflection.
|
1842
|
+
when reflection.options[:through]
|
1615
1843
|
through_conditions = through_reflection.options[:conditions] ? "AND #{interpolate_sql(sanitize_sql(through_reflection.options[:conditions]))}" : ''
|
1616
|
-
|
1617
|
-
jt_foreign_key = jt_as_extra = jt_source_extra = jt_sti_extra = nil
|
1618
|
-
first_key = second_key = as_extra = nil
|
1619
|
-
|
1844
|
+
|
1845
|
+
jt_foreign_key = jt_as_extra = jt_source_extra = jt_sti_extra = nil
|
1846
|
+
first_key = second_key = as_extra = nil
|
1847
|
+
|
1620
1848
|
if through_reflection.options[:as] # has_many :through against a polymorphic join
|
1621
1849
|
jt_foreign_key = through_reflection.options[:as].to_s + '_id'
|
1622
1850
|
jt_as_extra = " AND %s.%s = %s" % [
|
@@ -1625,29 +1853,29 @@ module ActiveRecord
|
|
1625
1853
|
klass.quote_value(parent.active_record.base_class.name)
|
1626
1854
|
]
|
1627
1855
|
else
|
1628
|
-
jt_foreign_key = through_reflection.primary_key_name
|
1856
|
+
jt_foreign_key = through_reflection.primary_key_name
|
1629
1857
|
end
|
1630
|
-
|
1858
|
+
|
1631
1859
|
case source_reflection.macro
|
1632
1860
|
when :has_many
|
1633
|
-
if source_reflection.options[:as]
|
1634
|
-
first_key = "#{source_reflection.options[:as]}_id"
|
1635
|
-
second_key = options[:foreign_key] || primary_key
|
1861
|
+
if source_reflection.options[:as]
|
1862
|
+
first_key = "#{source_reflection.options[:as]}_id"
|
1863
|
+
second_key = options[:foreign_key] || primary_key
|
1636
1864
|
as_extra = " AND %s.%s = %s" % [
|
1637
1865
|
connection.quote_table_name(aliased_table_name),
|
1638
1866
|
connection.quote_column_name("#{source_reflection.options[:as]}_type"),
|
1639
|
-
klass.quote_value(source_reflection.active_record.base_class.name)
|
1867
|
+
klass.quote_value(source_reflection.active_record.base_class.name)
|
1640
1868
|
]
|
1641
1869
|
else
|
1642
1870
|
first_key = through_reflection.klass.base_class.to_s.foreign_key
|
1643
1871
|
second_key = options[:foreign_key] || primary_key
|
1644
1872
|
end
|
1645
|
-
|
1873
|
+
|
1646
1874
|
unless through_reflection.klass.descends_from_active_record?
|
1647
1875
|
jt_sti_extra = " AND %s.%s = %s" % [
|
1648
1876
|
connection.quote_table_name(aliased_join_table_name),
|
1649
1877
|
connection.quote_column_name(through_reflection.active_record.inheritance_column),
|
1650
|
-
through_reflection.klass.quote_value(through_reflection.klass.
|
1878
|
+
through_reflection.klass.quote_value(through_reflection.klass.sti_name)]
|
1651
1879
|
end
|
1652
1880
|
when :belongs_to
|
1653
1881
|
first_key = primary_key
|
@@ -1666,17 +1894,17 @@ module ActiveRecord
|
|
1666
1894
|
" #{join_type} %s ON (%s.%s = %s.%s%s%s%s) " % [
|
1667
1895
|
table_alias_for(through_reflection.klass.table_name, aliased_join_table_name),
|
1668
1896
|
connection.quote_table_name(parent.aliased_table_name),
|
1669
|
-
|
1897
|
+
connection.quote_column_name(parent.primary_key),
|
1670
1898
|
connection.quote_table_name(aliased_join_table_name),
|
1671
|
-
|
1899
|
+
connection.quote_column_name(jt_foreign_key),
|
1672
1900
|
jt_as_extra, jt_source_extra, jt_sti_extra
|
1673
1901
|
] +
|
1674
1902
|
" #{join_type} %s ON (%s.%s = %s.%s%s) " % [
|
1675
|
-
table_name_and_alias,
|
1903
|
+
table_name_and_alias,
|
1676
1904
|
connection.quote_table_name(aliased_table_name),
|
1677
|
-
|
1905
|
+
connection.quote_column_name(first_key),
|
1678
1906
|
connection.quote_table_name(aliased_join_table_name),
|
1679
|
-
|
1907
|
+
connection.quote_column_name(second_key),
|
1680
1908
|
as_extra
|
1681
1909
|
]
|
1682
1910
|
|
@@ -1684,11 +1912,11 @@ module ActiveRecord
|
|
1684
1912
|
" #{join_type} %s ON %s.%s = %s.%s AND %s.%s = %s" % [
|
1685
1913
|
table_name_and_alias,
|
1686
1914
|
connection.quote_table_name(aliased_table_name),
|
1687
|
-
|
1915
|
+
"#{reflection.options[:as]}_id",
|
1688
1916
|
connection.quote_table_name(parent.aliased_table_name),
|
1689
|
-
|
1917
|
+
parent.primary_key,
|
1690
1918
|
connection.quote_table_name(aliased_table_name),
|
1691
|
-
|
1919
|
+
"#{reflection.options[:as]}_type",
|
1692
1920
|
klass.quote_value(parent.active_record.base_class.name)
|
1693
1921
|
]
|
1694
1922
|
else
|
@@ -1696,26 +1924,24 @@ module ActiveRecord
|
|
1696
1924
|
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1697
1925
|
table_name_and_alias,
|
1698
1926
|
aliased_table_name,
|
1699
|
-
|
1927
|
+
foreign_key,
|
1700
1928
|
parent.aliased_table_name,
|
1701
|
-
|
1929
|
+
parent.primary_key
|
1702
1930
|
]
|
1703
1931
|
end
|
1704
1932
|
when :belongs_to
|
1705
1933
|
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1706
1934
|
table_name_and_alias,
|
1707
|
-
|
1708
|
-
|
1935
|
+
connection.quote_table_name(aliased_table_name),
|
1936
|
+
reflection.klass.primary_key,
|
1709
1937
|
connection.quote_table_name(parent.aliased_table_name),
|
1710
|
-
|
1938
|
+
options[:foreign_key] || reflection.primary_key_name
|
1711
1939
|
]
|
1712
1940
|
else
|
1713
1941
|
""
|
1714
1942
|
end || ''
|
1715
|
-
join << %(AND %s
|
1716
|
-
|
1717
|
-
connection.quote_column_name(klass.inheritance_column),
|
1718
|
-
klass.quote_value(klass.name.demodulize)] unless klass.descends_from_active_record?
|
1943
|
+
join << %(AND %s) % [
|
1944
|
+
klass.send(:type_condition, aliased_table_name)] unless klass.descends_from_active_record?
|
1719
1945
|
|
1720
1946
|
[through_reflection, reflection].each do |ref|
|
1721
1947
|
join << "AND #{interpolate_sql(sanitize_sql(ref.options[:conditions]))} " if ref && ref.options[:conditions]
|
@@ -1723,15 +1949,33 @@ module ActiveRecord
|
|
1723
1949
|
|
1724
1950
|
join
|
1725
1951
|
end
|
1726
|
-
|
1952
|
+
|
1727
1953
|
protected
|
1954
|
+
|
1955
|
+
def aliased_table_name_for(name, suffix = nil)
|
1956
|
+
if !parent.table_joins.blank? && parent.table_joins.to_s.downcase =~ %r{join(\s+\w+)?\s+#{name.downcase}\son}
|
1957
|
+
@join_dependency.table_aliases[name] += 1
|
1958
|
+
end
|
1959
|
+
|
1960
|
+
unless @join_dependency.table_aliases[name].zero?
|
1961
|
+
# if the table name has been used, then use an alias
|
1962
|
+
name = active_record.connection.table_alias_for "#{pluralize(reflection.name)}_#{parent_table_name}#{suffix}"
|
1963
|
+
table_index = @join_dependency.table_aliases[name]
|
1964
|
+
@join_dependency.table_aliases[name] += 1
|
1965
|
+
name = name[0..active_record.connection.table_alias_length-3] + "_#{table_index+1}" if table_index > 0
|
1966
|
+
else
|
1967
|
+
@join_dependency.table_aliases[name] += 1
|
1968
|
+
end
|
1728
1969
|
|
1970
|
+
name
|
1971
|
+
end
|
1972
|
+
|
1729
1973
|
def pluralize(table_name)
|
1730
1974
|
ActiveRecord::Base.pluralize_table_names ? table_name.to_s.pluralize : table_name
|
1731
1975
|
end
|
1732
|
-
|
1976
|
+
|
1733
1977
|
def table_alias_for(table_name, table_alias)
|
1734
|
-
|
1978
|
+
"#{reflection.active_record.connection.quote_table_name(table_name)} #{table_alias if table_name != table_alias}".strip
|
1735
1979
|
end
|
1736
1980
|
|
1737
1981
|
def table_name_and_alias
|
@@ -1739,11 +1983,10 @@ module ActiveRecord
|
|
1739
1983
|
end
|
1740
1984
|
|
1741
1985
|
def interpolate_sql(sql)
|
1742
|
-
instance_eval("%@#{sql.gsub('@', '\@')}@")
|
1743
|
-
end
|
1986
|
+
instance_eval("%@#{sql.gsub('@', '\@')}@")
|
1987
|
+
end
|
1744
1988
|
|
1745
1989
|
private
|
1746
|
-
|
1747
1990
|
def join_type
|
1748
1991
|
"LEFT OUTER JOIN"
|
1749
1992
|
end
|