radiant 0.6.4 → 0.6.5
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 +188 -35
- data/CONTRIBUTORS +25 -2
- data/INSTALL +1 -1
- data/app/controllers/admin/abstract_model_controller.rb +13 -13
- data/app/controllers/admin/export_controller.rb +1 -2
- data/app/controllers/admin/extension_controller.rb +0 -5
- data/app/controllers/admin/page_controller.rb +2 -0
- data/app/controllers/application.rb +1 -1
- data/app/controllers/site_controller.rb +8 -1
- data/app/helpers/admin/node_helper.rb +21 -18
- data/app/helpers/application_helper.rb +4 -13
- data/app/models/layout.rb +2 -2
- data/app/models/page.rb +25 -21
- data/app/models/page_context.rb +3 -5
- data/app/models/response_cache.rb +19 -27
- data/app/models/snippet.rb +2 -2
- data/app/models/standard_tags.rb +148 -26
- data/app/models/user.rb +2 -2
- data/app/views/admin/extension/index.html.erb +40 -0
- data/app/views/admin/layout/edit.html.erb +39 -0
- data/app/views/admin/layout/{index.rhtml → index.html.erb} +0 -0
- data/app/views/admin/layout/{remove.rhtml → remove.html.erb} +0 -0
- data/app/views/admin/page/_meta_row.html.erb +4 -0
- data/app/views/admin/page/{_node.rhtml → _node.html.erb} +0 -0
- data/app/views/admin/page/{_part.rhtml → _part.html.erb} +0 -0
- data/app/views/admin/page/_tag_reference.html.erb +4 -0
- data/app/views/admin/page/{children.rhtml → children.html.erb} +0 -0
- data/app/views/admin/page/edit.html.erb +140 -0
- data/app/views/admin/page/index.html.erb +31 -0
- data/app/views/admin/page/{remove.rhtml → remove.html.erb} +0 -0
- data/app/views/admin/snippet/{edit.rhtml → edit.html.erb} +0 -0
- data/app/views/admin/snippet/{index.rhtml → index.html.erb} +0 -0
- data/app/views/admin/snippet/{remove.rhtml → remove.html.erb} +0 -0
- data/app/views/admin/user/edit.html.erb +54 -0
- data/app/views/admin/user/{index.rhtml → index.html.erb} +0 -0
- data/app/views/admin/user/preferences.html.erb +29 -0
- data/app/views/admin/user/{remove.rhtml → remove.html.erb} +0 -0
- data/app/views/admin/welcome/{login.rhtml → login.html.erb} +0 -0
- data/app/views/layouts/{application.rhtml → application.html.erb} +0 -0
- data/app/views/site/{not_found.rhtml → not_found.html.erb} +0 -0
- data/bin/radiant +0 -0
- data/config/boot.rb +136 -26
- data/config/environment.rb +61 -53
- data/config/environments/development.rb +2 -3
- data/config/environments/test.rb +14 -7
- data/db/migrate/015_add_optimistic_locking.rb +6 -6
- data/db/migrate/017_rename_created_by_updated_by_columns.rb +15 -0
- data/db/migrate/018_add_description_and_keywords_to_pages.rb +11 -0
- data/db/schema.rb +66 -59
- data/db/templates/styled-blog.yml +3 -3
- data/lib/annotatable.rb +16 -0
- data/lib/autotest/discover.rb +3 -0
- data/lib/autotest/radiant_rails_rspec.rb +111 -0
- data/lib/generators/extension/USAGE +16 -14
- data/lib/generators/extension/extension_generator.rb +29 -7
- data/lib/generators/extension/templates/RSpecRakefile +120 -0
- data/lib/generators/extension/templates/Rakefile +0 -0
- data/lib/generators/extension/templates/spec.opts +6 -0
- data/lib/generators/extension/templates/spec_helper.rb +37 -0
- data/lib/generators/extension/templates/test_helper.rb +9 -2
- data/lib/generators/extension_controller/USAGE +4 -2
- data/lib/generators/extension_controller/extension_controller_generator.rb +50 -0
- data/lib/generators/extension_controller/templates/controller_spec.rb +23 -0
- data/lib/generators/extension_controller/templates/helper_spec.rb +11 -0
- data/lib/generators/extension_controller/templates/view_spec.rb +12 -0
- data/lib/generators/extension_model/USAGE +3 -2
- data/lib/generators/extension_model/extension_model_generator.rb +34 -0
- data/lib/generators/extension_model/templates/model_spec.rb +11 -0
- data/lib/generators/instance/templates/instance_boot.rb +136 -33
- data/lib/generators/instance/templates/instance_environment.rb +85 -4
- data/lib/login_system.rb +16 -0
- data/lib/plugins/dependencies_fix/init.rb +5 -5
- data/lib/plugins/extension_patches/init.rb +0 -1
- data/lib/plugins/extension_patches/lib/fixture_loading_extension.rb +76 -75
- data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +19 -14
- data/lib/plugins/string_extensions/lib/string_extensions.rb +4 -0
- data/lib/plugins/symbol_extensions/init.rb +1 -0
- data/lib/plugins/symbol_extensions/lib/symbol_extensions.rb +7 -0
- data/lib/radiant.rb +2 -8
- data/lib/radiant/extension.rb +11 -43
- data/lib/radiant/extension_loader.rb +144 -135
- data/lib/radiant/initializer.rb +126 -33
- data/lib/radiant/setup.rb +1 -0
- data/lib/tasks/database.rake +44 -3
- data/lib/tasks/extensions.rake +29 -11
- data/lib/tasks/framework.rake +20 -6
- data/lib/tasks/instance.rake +5 -2
- data/lib/tasks/release.rake +1 -0
- data/public/dispatch.cgi +0 -0
- data/public/dispatch.fcgi +0 -0
- data/public/dispatch.rb +0 -0
- data/public/images/admin/brown-bottom-line.gif +0 -0
- data/public/images/admin/view-site.gif +0 -0
- data/public/javascripts/admin/admin.js +142 -0
- data/public/javascripts/{ruledtable.js → admin/ruledtable.js} +0 -0
- data/public/javascripts/admin/sitemap.js +131 -0
- data/public/javascripts/admin/tabcontrol.js +127 -0
- data/public/javascripts/pngfix.js +1 -1
- data/public/stylesheets/admin/main.css +11 -6
- data/script/about +0 -0
- data/script/breakpointer +0 -0
- data/script/console +0 -0
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/script/performance/benchmarker +0 -0
- data/script/performance/profiler +0 -0
- data/script/plugin +0 -0
- data/script/process/inspector +0 -0
- data/script/process/reaper +0 -0
- data/script/process/spawner +0 -0
- data/script/process/spinner +0 -0
- data/script/runner +0 -0
- data/script/server +0 -0
- data/script/spec +12 -0
- data/script/spec_server +99 -0
- data/script/version +0 -0
- data/spec/controllers/admin/abstract_model_controller_spec.rb +263 -0
- data/spec/controllers/admin/export_controller_spec.rb +16 -0
- data/spec/controllers/admin/extension_controller_spec.rb +21 -0
- data/spec/controllers/admin/layout_controller_spec.rb +42 -0
- data/spec/controllers/admin/page_controller_spec.rb +312 -0
- data/spec/controllers/admin/snippet_controller_spec.rb +27 -0
- data/spec/controllers/admin/user_controller_spec.rb +72 -0
- data/spec/controllers/admin/welcome_controller_spec.rb +37 -0
- data/spec/controllers/application_controller_spec.rb +41 -0
- data/spec/controllers/site_controller_spec.rb +109 -0
- data/spec/fixtures/sample.txt +1 -0
- data/spec/helpers/admin/abstract_model_helper_spec.rb +4 -0
- data/spec/helpers/admin/export_helper_spec.rb +4 -0
- data/spec/helpers/admin/extension_helper_spec.rb +4 -0
- data/spec/helpers/admin/layout_helper_spec.rb +4 -0
- data/spec/helpers/admin/node_helper_spec.rb +97 -0
- data/spec/helpers/admin/page_helper_spec.rb +41 -0
- data/spec/helpers/admin/snippet_helper_spec.rb +4 -0
- data/spec/helpers/admin/user_helper_spec.rb +4 -0
- data/spec/helpers/admin/welcome_helper_spec.rb +4 -0
- data/spec/helpers/application_helper_spec.rb +166 -0
- data/spec/helpers/site_helper_spec.rb +4 -0
- data/spec/lib/annotatable_spec.rb +86 -0
- data/spec/lib/autotest_spec.rb +81 -0
- data/spec/lib/inheritable_class_attributes_spec.rb +90 -0
- data/spec/lib/local_time_spec.rb +40 -0
- data/spec/lib/login_system_spec.rb +142 -0
- data/spec/lib/method_observer_spec.rb +48 -0
- data/spec/lib/radiant/admin_ui_spec.rb +133 -0
- data/spec/lib/radiant/extension_loader_spec.rb +179 -0
- data/spec/lib/radiant/extension_migrator_spec.rb +17 -0
- data/spec/lib/radiant/extension_spec.rb +69 -0
- data/spec/lib/radiant/initializer_spec.rb +80 -0
- data/spec/lib/radiant/taggable_spec.rb +150 -0
- data/spec/lib/radiant_spec.rb +26 -0
- data/spec/lib/simpleton_spec.rb +45 -0
- data/spec/matchers/login_system_matcher.rb +79 -0
- data/spec/matchers/render_matcher.rb +115 -0
- data/spec/models/env_dump_page_spec.rb +18 -0
- data/spec/models/file_not_found_page_spec.rb +31 -0
- data/spec/models/layout_spec.rb +29 -0
- data/spec/models/page_context_spec.rb +68 -0
- data/spec/models/page_part_spec.rb +47 -0
- data/spec/models/page_spec.rb +500 -0
- data/spec/models/radiant/config_spec.rb +57 -0
- data/spec/models/radiant/exporter_spec.rb +25 -0
- data/spec/models/response_cache_spec.rb +259 -0
- data/spec/models/snippet_spec.rb +41 -0
- data/spec/models/standard_tags_spec.rb +774 -0
- data/spec/models/status_spec.rb +53 -0
- data/spec/models/text_filter_spec.rb +40 -0
- data/spec/models/user_action_observer_spec.rb +34 -0
- data/spec/models/user_spec.rb +135 -0
- data/spec/rcov.opts +2 -0
- data/spec/scenarios/file_not_found_scenario.rb +13 -0
- data/spec/scenarios/home_page_scenario.rb +64 -0
- data/spec/scenarios/layouts_scenario.rb +58 -0
- data/spec/scenarios/markup_pages_scenario.rb +13 -0
- data/spec/scenarios/pages_scenario.rb +50 -0
- data/spec/scenarios/pages_with_layouts_scenario.rb +10 -0
- data/spec/scenarios/snippets_scenario.rb +34 -0
- data/spec/scenarios/users_and_pages_scenario.rb +9 -0
- data/spec/scenarios/users_scenario.rb +43 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +64 -0
- data/stories/all.rb +4 -0
- data/stories/helper.rb +3 -0
- data/test/fixtures/extensions/01_basic/app/views/basic_extension/{index.rhtml → index.html.erb} +0 -0
- data/test/fixtures/extensions/01_basic/app/views/basic_extension/{override.rhtml → override.html.erb} +0 -0
- data/test/fixtures/extensions/01_basic/app/views/basic_extension_mailer/{message.rhtml → message.text.html.erb} +0 -0
- data/test/fixtures/extensions/02_overriding/app/views/basic_extension/{override.rhtml → override.html.erb} +0 -0
- data/test/fixtures/page_parts.yml +6 -1
- data/test/fixtures/pages.yml +33 -19
- data/test/helpers/caching_test_helper.rb +39 -38
- data/test/helpers/extension_fixture_test_helper.rb +39 -39
- data/test/helpers/extension_tag_test_helper.rb +16 -16
- data/test/helpers/logging_test_helper.rb +10 -0
- data/test/helpers/render_test_helper.rb +3 -3
- data/test/helpers/validation_test_helper.rb +42 -42
- data/test/test_helper.rb +6 -4
- data/vendor/extensions/archive/Rakefile +105 -10
- data/vendor/extensions/archive/app/models/archive_day_index_page.rb +0 -0
- data/vendor/extensions/archive/app/models/archive_month_index_page.rb +0 -0
- data/vendor/extensions/archive/app/models/archive_page.rb +0 -0
- data/vendor/extensions/archive/app/models/archive_year_index_page.rb +0 -0
- data/vendor/extensions/archive/lib/archive_index_tags_and_methods.rb +0 -0
- data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +20 -0
- data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +20 -0
- data/vendor/extensions/archive/spec/models/archive_page_spec.rb +33 -0
- data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +20 -0
- data/vendor/extensions/archive/spec/scenarios/archive_scenario.rb +51 -0
- data/vendor/extensions/archive/spec/spec.opts +6 -0
- data/vendor/extensions/archive/spec/spec_helper.rb +37 -0
- data/vendor/extensions/archive/test/functional/archive_extension_test.rb +1 -1
- data/vendor/extensions/archive/test/helpers/archive_index_test_helper.rb +0 -0
- data/vendor/extensions/archive/test/test_helper.rb +11 -4
- data/vendor/extensions/archive/test/unit/archive_day_index_page_test.rb +0 -0
- data/vendor/extensions/archive/test/unit/archive_month_index_page_test.rb +0 -0
- data/vendor/extensions/archive/test/unit/archive_page_test.rb +0 -0
- data/vendor/extensions/archive/test/unit/archive_year_index_page_test.rb +0 -0
- data/vendor/extensions/markdown_filter/Rakefile +105 -10
- data/vendor/extensions/markdown_filter/lib/tasks/markdown_filter_extension_tasks.rake +28 -0
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +15 -0
- data/vendor/extensions/markdown_filter/spec/models/smarty_pants_filter_spec.rb +12 -0
- data/vendor/extensions/markdown_filter/spec/spec.opts +6 -0
- data/vendor/extensions/markdown_filter/spec/spec_helper.rb +37 -0
- data/vendor/extensions/markdown_filter/test/test_helper.rb +11 -2
- data/vendor/extensions/textile_filter/Rakefile +105 -10
- data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +11 -0
- data/vendor/extensions/textile_filter/spec/spec.opts +6 -0
- data/vendor/extensions/textile_filter/spec/spec_helper.rb +37 -0
- data/vendor/extensions/textile_filter/test/test_helper.rb +11 -2
- data/vendor/plugins/acts_as_tree/README +26 -0
- data/vendor/plugins/acts_as_tree/Rakefile +22 -0
- data/vendor/plugins/acts_as_tree/init.rb +1 -0
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
- data/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
- data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
- data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
- data/vendor/plugins/rspec/CHANGES +1079 -0
- data/vendor/plugins/rspec/MIT-LICENSE +20 -0
- data/vendor/plugins/rspec/README +71 -0
- data/vendor/plugins/rspec/Rakefile +279 -0
- data/vendor/plugins/rspec/TODO +2 -0
- data/vendor/plugins/rspec/UPGRADE +31 -0
- data/vendor/plugins/rspec/bin/spec +4 -0
- data/vendor/plugins/rspec/bin/spec_translator +8 -0
- data/vendor/plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +19 -0
- data/vendor/plugins/rspec/examples/pure/before_and_after_example.rb +40 -0
- data/vendor/plugins/rspec/examples/pure/behave_as_example.rb +45 -0
- data/vendor/plugins/rspec/examples/pure/custom_expectation_matchers.rb +54 -0
- data/vendor/plugins/rspec/examples/pure/custom_formatter.rb +12 -0
- data/vendor/plugins/rspec/examples/pure/dynamic_spec.rb +9 -0
- data/vendor/plugins/rspec/examples/pure/file_accessor.rb +19 -0
- data/vendor/plugins/rspec/examples/pure/file_accessor_spec.rb +38 -0
- data/vendor/plugins/rspec/examples/pure/greeter_spec.rb +31 -0
- data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +14 -0
- data/vendor/plugins/rspec/examples/pure/io_processor.rb +8 -0
- data/vendor/plugins/rspec/examples/pure/io_processor_spec.rb +21 -0
- data/vendor/plugins/rspec/examples/pure/legacy_spec.rb +11 -0
- data/vendor/plugins/rspec/examples/pure/mocking_example.rb +27 -0
- data/vendor/plugins/rspec/examples/pure/multi_threaded_behaviour_runner.rb +28 -0
- data/vendor/plugins/rspec/examples/pure/nested_classes_example.rb +36 -0
- data/vendor/plugins/rspec/examples/pure/partial_mock_example.rb +28 -0
- data/vendor/plugins/rspec/examples/pure/pending_example.rb +20 -0
- data/vendor/plugins/rspec/examples/pure/predicate_example.rb +27 -0
- data/vendor/plugins/rspec/examples/pure/priority.txt +1 -0
- data/vendor/plugins/rspec/examples/pure/shared_example_group_example.rb +81 -0
- data/vendor/plugins/rspec/examples/pure/shared_stack_examples.rb +38 -0
- data/vendor/plugins/rspec/examples/pure/spec_helper.rb +3 -0
- data/vendor/plugins/rspec/examples/pure/stack.rb +36 -0
- data/vendor/plugins/rspec/examples/pure/stack_spec.rb +63 -0
- data/vendor/plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +67 -0
- data/vendor/plugins/rspec/examples/pure/stubbing_example.rb +69 -0
- data/vendor/plugins/rspec/examples/stories/adder.rb +13 -0
- data/vendor/plugins/rspec/examples/stories/addition +34 -0
- data/vendor/plugins/rspec/examples/stories/addition.rb +9 -0
- data/vendor/plugins/rspec/examples/stories/calculator.rb +65 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/README.txt +21 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/everything.rb +6 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/examples.rb +3 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +35 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +66 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +21 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +21 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +42 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +42 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +17 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +53 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +52 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/helper.rb +6 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +26 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/steps.rb +5 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.rb +3 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.txt +22 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/life.rb +3 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/game.rb +23 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/grid.rb +43 -0
- data/vendor/plugins/rspec/examples/stories/helper.rb +9 -0
- data/vendor/plugins/rspec/examples/stories/steps/addition_steps.rb +18 -0
- data/vendor/plugins/rspec/failing_examples/README.txt +7 -0
- data/vendor/plugins/rspec/failing_examples/diffing_spec.rb +36 -0
- data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +19 -0
- data/vendor/plugins/rspec/failing_examples/failure_in_setup.rb +10 -0
- data/vendor/plugins/rspec/failing_examples/failure_in_teardown.rb +10 -0
- data/vendor/plugins/rspec/failing_examples/mocking_example.rb +40 -0
- data/vendor/plugins/rspec/failing_examples/mocking_with_flexmock.rb +26 -0
- data/vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb +25 -0
- data/vendor/plugins/rspec/failing_examples/mocking_with_rr.rb +27 -0
- data/vendor/plugins/rspec/failing_examples/partial_mock_example.rb +20 -0
- data/vendor/plugins/rspec/failing_examples/predicate_example.rb +29 -0
- data/vendor/plugins/rspec/failing_examples/raising_example.rb +47 -0
- data/vendor/plugins/rspec/failing_examples/spec_helper.rb +3 -0
- data/vendor/plugins/rspec/failing_examples/syntax_error_example.rb +7 -0
- data/vendor/plugins/rspec/failing_examples/team_spec.rb +44 -0
- data/vendor/plugins/rspec/failing_examples/timeout_behaviour.rb +7 -0
- data/vendor/plugins/rspec/init.rb +9 -0
- data/vendor/plugins/rspec/lib/autotest/discover.rb +3 -0
- data/vendor/plugins/rspec/lib/autotest/rspec.rb +72 -0
- data/vendor/plugins/rspec/lib/spec.rb +30 -0
- data/vendor/plugins/rspec/lib/spec/example.rb +12 -0
- data/vendor/plugins/rspec/lib/spec/example/configuration.rb +144 -0
- data/vendor/plugins/rspec/lib/spec/example/errors.rb +9 -0
- data/vendor/plugins/rspec/lib/spec/example/example_group.rb +16 -0
- data/vendor/plugins/rspec/lib/spec/example/example_group_factory.rb +58 -0
- data/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb +433 -0
- data/vendor/plugins/rspec/lib/spec/example/example_matcher.rb +42 -0
- data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +110 -0
- data/vendor/plugins/rspec/lib/spec/example/module_reopening_fix.rb +21 -0
- data/vendor/plugins/rspec/lib/spec/example/pending.rb +18 -0
- data/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb +58 -0
- data/vendor/plugins/rspec/lib/spec/expectations.rb +56 -0
- data/vendor/plugins/rspec/lib/spec/expectations/differs/default.rb +66 -0
- data/vendor/plugins/rspec/lib/spec/expectations/errors.rb +12 -0
- data/vendor/plugins/rspec/lib/spec/expectations/extensions.rb +2 -0
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb +71 -0
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/string_and_symbol.rb +17 -0
- data/vendor/plugins/rspec/lib/spec/expectations/handler.rb +52 -0
- data/vendor/plugins/rspec/lib/spec/extensions.rb +4 -0
- data/vendor/plugins/rspec/lib/spec/extensions/class.rb +24 -0
- data/vendor/plugins/rspec/lib/spec/extensions/main.rb +102 -0
- data/vendor/plugins/rspec/lib/spec/extensions/metaclass.rb +7 -0
- data/vendor/plugins/rspec/lib/spec/extensions/object.rb +6 -0
- data/vendor/plugins/rspec/lib/spec/interop/test.rb +12 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +6 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +61 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +6 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +34 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +61 -0
- data/vendor/plugins/rspec/lib/spec/matchers.rb +156 -0
- data/vendor/plugins/rspec/lib/spec/matchers/be.rb +224 -0
- data/vendor/plugins/rspec/lib/spec/matchers/be_close.rb +37 -0
- data/vendor/plugins/rspec/lib/spec/matchers/change.rb +144 -0
- data/vendor/plugins/rspec/lib/spec/matchers/eql.rb +43 -0
- data/vendor/plugins/rspec/lib/spec/matchers/equal.rb +43 -0
- data/vendor/plugins/rspec/lib/spec/matchers/exist.rb +17 -0
- data/vendor/plugins/rspec/lib/spec/matchers/has.rb +34 -0
- data/vendor/plugins/rspec/lib/spec/matchers/have.rb +145 -0
- data/vendor/plugins/rspec/lib/spec/matchers/include.rb +70 -0
- data/vendor/plugins/rspec/lib/spec/matchers/match.rb +41 -0
- data/vendor/plugins/rspec/lib/spec/matchers/operator_matcher.rb +73 -0
- data/vendor/plugins/rspec/lib/spec/matchers/raise_error.rb +132 -0
- data/vendor/plugins/rspec/lib/spec/matchers/respond_to.rb +45 -0
- data/vendor/plugins/rspec/lib/spec/matchers/satisfy.rb +47 -0
- data/vendor/plugins/rspec/lib/spec/matchers/simple_matcher.rb +29 -0
- data/vendor/plugins/rspec/lib/spec/matchers/throw_symbol.rb +74 -0
- data/vendor/plugins/rspec/lib/spec/mocks.rb +211 -0
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +31 -0
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb.orig +27 -0
- data/vendor/plugins/rspec/lib/spec/mocks/argument_expectation.rb +209 -0
- data/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb +84 -0
- data/vendor/plugins/rspec/lib/spec/mocks/errors.rb +10 -0
- data/vendor/plugins/rspec/lib/spec/mocks/extensions/object.rb +3 -0
- data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +269 -0
- data/vendor/plugins/rspec/lib/spec/mocks/methods.rb +39 -0
- data/vendor/plugins/rspec/lib/spec/mocks/mock.rb +50 -0
- data/vendor/plugins/rspec/lib/spec/mocks/order_group.rb +29 -0
- data/vendor/plugins/rspec/lib/spec/mocks/proxy.rb +166 -0
- data/vendor/plugins/rspec/lib/spec/mocks/space.rb +28 -0
- data/vendor/plugins/rspec/lib/spec/mocks/spec_methods.rb +38 -0
- data/vendor/plugins/rspec/lib/spec/rake/spectask.rb +235 -0
- data/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +52 -0
- data/vendor/plugins/rspec/lib/spec/runner.rb +202 -0
- data/vendor/plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +57 -0
- data/vendor/plugins/rspec/lib/spec/runner/class_and_arguments_parser.rb +16 -0
- data/vendor/plugins/rspec/lib/spec/runner/command_line.rb +28 -0
- data/vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb +20 -0
- data/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb +59 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +77 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +130 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +33 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +20 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +333 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +47 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +30 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +52 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +39 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +128 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +131 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +16 -0
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner.rb +72 -0
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner_unsupported.rb +10 -0
- data/vendor/plugins/rspec/lib/spec/runner/option_parser.rb +205 -0
- data/vendor/plugins/rspec/lib/spec/runner/options.rb +288 -0
- data/vendor/plugins/rspec/lib/spec/runner/reporter.rb +147 -0
- data/vendor/plugins/rspec/lib/spec/runner/spec_parser.rb +71 -0
- data/vendor/plugins/rspec/lib/spec/story.rb +10 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions.rb +3 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions/main.rb +86 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions/regexp.rb +9 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions/string.rb +9 -0
- data/vendor/plugins/rspec/lib/spec/story/given_scenario.rb +14 -0
- data/vendor/plugins/rspec/lib/spec/story/runner.rb +56 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +48 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_collector.rb +18 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb +48 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb +123 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +227 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +70 -0
- data/vendor/plugins/rspec/lib/spec/story/scenario.rb +14 -0
- data/vendor/plugins/rspec/lib/spec/story/step.rb +58 -0
- data/vendor/plugins/rspec/lib/spec/story/step_group.rb +89 -0
- data/vendor/plugins/rspec/lib/spec/story/step_mother.rb +37 -0
- data/vendor/plugins/rspec/lib/spec/story/story.rb +39 -0
- data/vendor/plugins/rspec/lib/spec/story/world.rb +124 -0
- data/vendor/plugins/rspec/lib/spec/translator.rb +114 -0
- data/vendor/plugins/rspec/lib/spec/version.rb +22 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/flexmock.rb +23 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/mocha.rb +19 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/rr.rb +21 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/rspec.rb +18 -0
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit.rb +4 -0
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb +50 -0
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +54 -0
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +111 -0
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +314 -0
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +15 -0
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +51 -0
- data/vendor/plugins/rspec/pre_commit/spec/spec_helper.rb +3 -0
- data/vendor/plugins/rspec/pre_commit/spec/spec_suite.rb +11 -0
- data/vendor/plugins/rspec/rake_tasks/examples.rake +7 -0
- data/vendor/plugins/rspec/rake_tasks/examples_with_rcov.rake +9 -0
- data/vendor/plugins/rspec/rake_tasks/failing_examples_with_html.rake +9 -0
- data/vendor/plugins/rspec/rake_tasks/verify_rcov.rake +7 -0
- data/vendor/plugins/rspec/spec/README.jruby +15 -0
- data/vendor/plugins/rspec/spec/autotest/discover_spec.rb +19 -0
- data/vendor/plugins/rspec/spec/autotest/rspec_spec.rb +197 -0
- data/vendor/plugins/rspec/spec/autotest_helper.rb +6 -0
- data/vendor/plugins/rspec/spec/autotest_matchers.rb +47 -0
- data/vendor/plugins/rspec/spec/rspec_suite.rb +7 -0
- data/vendor/plugins/rspec/spec/ruby_forker.rb +13 -0
- data/vendor/plugins/rspec/spec/spec.opts +6 -0
- data/vendor/plugins/rspec/spec/spec/example/configuration_spec.rb +282 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb +48 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_factory_spec.rb +135 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_methods_spec.rb +523 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_spec.rb +711 -0
- data/vendor/plugins/rspec/spec/spec/example/example_matcher_spec.rb +96 -0
- data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +115 -0
- data/vendor/plugins/rspec/spec/spec/example/example_runner_spec.rb +194 -0
- data/vendor/plugins/rspec/spec/spec/example/example_spec.rb +53 -0
- data/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb +71 -0
- data/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb +31 -0
- data/vendor/plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +21 -0
- data/vendor/plugins/rspec/spec/spec/example/shared_example_group_spec.rb +265 -0
- data/vendor/plugins/rspec/spec/spec/example/subclassing_example_group_spec.rb +25 -0
- data/vendor/plugins/rspec/spec/spec/expectations/differs/default_spec.rb +127 -0
- data/vendor/plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +107 -0
- data/vendor/plugins/rspec/spec/spec/expectations/fail_with_spec.rb +71 -0
- data/vendor/plugins/rspec/spec/spec/extensions/main_spec.rb +76 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +38 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +14 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +9 -0
- data/vendor/plugins/rspec/spec/spec/matchers/be_close_spec.rb +39 -0
- data/vendor/plugins/rspec/spec/spec/matchers/be_spec.rb +248 -0
- data/vendor/plugins/rspec/spec/spec/matchers/change_spec.rb +319 -0
- data/vendor/plugins/rspec/spec/spec/matchers/description_generation_spec.rb +153 -0
- data/vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb +28 -0
- data/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb +28 -0
- data/vendor/plugins/rspec/spec/spec/matchers/exist_spec.rb +57 -0
- data/vendor/plugins/rspec/spec/spec/matchers/handler_spec.rb +129 -0
- data/vendor/plugins/rspec/spec/spec/matchers/has_spec.rb +53 -0
- data/vendor/plugins/rspec/spec/spec/matchers/have_spec.rb +291 -0
- data/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +37 -0
- data/vendor/plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +78 -0
- data/vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb +24 -0
- data/vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +158 -0
- data/vendor/plugins/rspec/spec/spec/matchers/raise_error_spec.rb +315 -0
- data/vendor/plugins/rspec/spec/spec/matchers/respond_to_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb +36 -0
- data/vendor/plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +31 -0
- data/vendor/plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +29 -0
- data/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb +23 -0
- data/vendor/plugins/rspec/spec/spec/mocks/at_least_spec.rb +97 -0
- data/vendor/plugins/rspec/spec/spec/mocks/at_most_spec.rb +93 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10260_spec.rb +8 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb +24 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +33 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +30 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +19 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb +22 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8165_spec.rb +31 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +26 -0
- data/vendor/plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +123 -0
- data/vendor/plugins/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +32 -0
- data/vendor/plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +84 -0
- data/vendor/plugins/rspec/spec/spec/mocks/mock_space_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb +481 -0
- data/vendor/plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +113 -0
- data/vendor/plugins/rspec/spec/spec/mocks/null_object_mock_spec.rb +40 -0
- data/vendor/plugins/rspec/spec/spec/mocks/once_counts_spec.rb +53 -0
- data/vendor/plugins/rspec/spec/spec/mocks/options_hash_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +106 -0
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +66 -0
- data/vendor/plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +160 -0
- data/vendor/plugins/rspec/spec/spec/mocks/precise_counts_spec.rb +52 -0
- data/vendor/plugins/rspec/spec/spec/mocks/record_messages_spec.rb +26 -0
- data/vendor/plugins/rspec/spec/spec/mocks/stub_spec.rb +181 -0
- data/vendor/plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +67 -0
- data/vendor/plugins/rspec/spec/spec/package/bin_spec_spec.rb +14 -0
- data/vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +23 -0
- data/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb +147 -0
- data/vendor/plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +92 -0
- data/vendor/plugins/rspec/spec/spec/runner/empty_file.txt +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/examples.txt +2 -0
- data/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb +37 -0
- data/vendor/plugins/rspec/spec/spec/runner/failed.txt +3 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +33 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +365 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +387 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +371 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +381 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +371 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +66 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +65 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +137 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +18 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +103 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +129 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +61 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +335 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +365 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +371 -0
- data/vendor/plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +78 -0
- data/vendor/plugins/rspec/spec/spec/runner/heckler_spec.rb +13 -0
- data/vendor/plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/runner/option_parser_spec.rb +384 -0
- data/vendor/plugins/rspec/spec/spec/runner/options_spec.rb +386 -0
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture.rb +7 -0
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +8 -0
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_spec.rb +16 -0
- data/vendor/plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +56 -0
- data/vendor/plugins/rspec/spec/spec/runner/reporter_spec.rb +192 -0
- 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 +1 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec.opts +2 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_drb.opts +1 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser/spec_parser_fixture.rb +70 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser_spec.rb +79 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_spaced.opts +2 -0
- data/vendor/plugins/rspec/spec/spec/runner_spec.rb +11 -0
- data/vendor/plugins/rspec/spec/spec/spec_classes.rb +133 -0
- data/vendor/plugins/rspec/spec/spec/story/builders.rb +46 -0
- data/vendor/plugins/rspec/spec/spec/story/extensions/main_spec.rb +161 -0
- data/vendor/plugins/rspec/spec/spec/story/extensions_spec.rb +14 -0
- data/vendor/plugins/rspec/spec/spec/story/given_scenario_spec.rb +27 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +92 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +27 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +191 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +133 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +384 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +294 -0
- data/vendor/plugins/rspec/spec/spec/story/runner_spec.rb +106 -0
- data/vendor/plugins/rspec/spec/spec/story/scenario_spec.rb +20 -0
- data/vendor/plugins/rspec/spec/spec/story/step_group_spec.rb +157 -0
- data/vendor/plugins/rspec/spec/spec/story/step_mother_spec.rb +72 -0
- data/vendor/plugins/rspec/spec/spec/story/step_spec.rb +200 -0
- data/vendor/plugins/rspec/spec/spec/story/story_helper.rb +2 -0
- data/vendor/plugins/rspec/spec/spec/story/story_spec.rb +86 -0
- data/vendor/plugins/rspec/spec/spec/story/world_spec.rb +423 -0
- data/vendor/plugins/rspec/spec/spec/translator_spec.rb +265 -0
- data/vendor/plugins/rspec/spec/spec_helper.rb +103 -0
- data/vendor/plugins/rspec/stories/all.rb +5 -0
- data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +45 -0
- data/vendor/plugins/rspec/stories/example_groups/example_group_with_should_methods +17 -0
- data/vendor/plugins/rspec/stories/example_groups/nested_groups +17 -0
- data/vendor/plugins/rspec/stories/example_groups/output +25 -0
- data/vendor/plugins/rspec/stories/example_groups/stories.rb +7 -0
- data/vendor/plugins/rspec/stories/helper.rb +6 -0
- data/vendor/plugins/rspec/stories/interop/examples_and_tests_together +30 -0
- data/vendor/plugins/rspec/stories/interop/stories.rb +7 -0
- data/vendor/plugins/rspec/stories/interop/test_case_with_should_methods +17 -0
- data/vendor/plugins/rspec/stories/pending_stories/README +3 -0
- data/vendor/plugins/rspec/stories/resources/helpers/cmdline.rb +9 -0
- data/vendor/plugins/rspec/stories/resources/helpers/story_helper.rb +16 -0
- data/vendor/plugins/rspec/stories/resources/matchers/smart_match.rb +37 -0
- data/vendor/plugins/rspec/stories/resources/spec/example_group_with_should_methods.rb +12 -0
- data/vendor/plugins/rspec/stories/resources/spec/simple_spec.rb +8 -0
- data/vendor/plugins/rspec/stories/resources/steps/running_rspec.rb +50 -0
- data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +15 -0
- data/vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb +57 -0
- data/vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +30 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/builder.js +136 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/controls.js +972 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/dragdrop.js +976 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/effects.js +1117 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/prototype.js +4140 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/rspec.js +149 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +58 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/slider.js +276 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/sound.js +55 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/unittest.js +568 -0
- data/vendor/plugins/rspec/story_server/prototype/lib/server.rb +24 -0
- data/vendor/plugins/rspec/story_server/prototype/stories.html +176 -0
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/rspec.css +136 -0
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/test.css +90 -0
- data/vendor/plugins/rspec_on_rails/MIT-LICENSE +31 -0
- data/vendor/plugins/rspec_on_rails/README +3 -0
- data/vendor/plugins/rspec_on_rails/Rakefile +9 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/CHANGES +1 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb +35 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/all_stories.rb +4 -0
- 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 +2 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec +4 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +102 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts +4 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb +39 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/stories_helper.rb +3 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/USAGE +33 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/rspec_controller_generator.rb +49 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb +25 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +11 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +12 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/USAGE +18 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb +30 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb +11 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +167 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +313 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +25 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +11 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +22 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +26 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +61 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +22 -0
- data/vendor/plugins/rspec_on_rails/init.rb +9 -0
- data/vendor/plugins/rspec_on_rails/lib/autotest/discover.rb +1 -0
- data/vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +81 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails.rb +51 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb +46 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb +43 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +269 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb +59 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +130 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/model_example_group.rb +14 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +98 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +90 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +178 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb +12 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +14 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/rescue.rb +21 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb +11 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb +27 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb +30 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/object.rb +5 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb +66 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +21 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb +29 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +130 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +55 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb +113 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +70 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +71 -0
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +23 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +36 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb +8 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb +60 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/configuration_spec.rb +83 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +43 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +195 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/example_group_factory_spec.rb +112 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +133 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/model_spec_spec.rb +18 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +16 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +33 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +264 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +54 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +48 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +14 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +783 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +37 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb +13 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +62 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +209 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +169 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/ar_classes.rb +10 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +55 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/stub_model_spec.rb +54 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb +7 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb +89 -0
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_spec.rb +11 -0
- data/vendor/plugins/rspec_on_rails/spec/rails_suite.rb +7 -0
- data/vendor/plugins/rspec_on_rails/spec/spec_helper.rb +46 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/action_view_base_spec_controller.rb +2 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +68 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +59 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +26 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +58 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +10 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/more_explicit_helper.rb +5 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/plugin_application_helper.rb +6 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/view_spec_helper.rb +13 -0
- 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 +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +1 -0
- 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 +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_template.rhtml +1 -0
- 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 +1 -0
- 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 +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_div.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_page_element.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/insert_html.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_effect.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/no_tags.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial.rhtml +2 -0
- 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 +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_spacer.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml +3 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/entry_form.rhtml +2 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/explicit_helper.rhtml +2 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/foo/show.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/implicit_helper.rhtml +2 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/multiple_helpers.rhtml +3 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial.rhtml +5 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +3 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +1 -0
- data/vendor/plugins/rspec_on_rails/stories/all.rb +10 -0
- data/vendor/plugins/rspec_on_rails/stories/helper.rb +5 -0
- data/vendor/plugins/rspec_on_rails/stories/steps/people.rb +8 -0
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback +15 -0
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb +25 -0
- data/vendor/plugins/rspec_on_rails/tasks/rspec.rake +137 -0
- data/vendor/plugins/scenarios/LICENSE +19 -0
- data/vendor/plugins/scenarios/README +262 -0
- data/vendor/plugins/scenarios/Rakefile +66 -0
- data/vendor/plugins/scenarios/TODO +1 -0
- data/vendor/plugins/scenarios/lib/scenarios.rb +34 -0
- data/vendor/plugins/scenarios/lib/scenarios/base.rb +73 -0
- data/vendor/plugins/scenarios/lib/scenarios/builtin/blank_scenario.rb +18 -0
- data/vendor/plugins/scenarios/lib/scenarios/configuration.rb +55 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions.rb +5 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions/active_record.rb +14 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions/delegating_attributes.rb +40 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions/object.rb +5 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions/string.rb +22 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions/symbol.rb +14 -0
- data/vendor/plugins/scenarios/lib/scenarios/extensions/test_case.rb +76 -0
- data/vendor/plugins/scenarios/lib/scenarios/loading.rb +51 -0
- data/vendor/plugins/scenarios/lib/scenarios/table_blasting.rb +20 -0
- data/vendor/plugins/scenarios/lib/scenarios/table_methods.rb +205 -0
- data/vendor/plugins/scenarios/spec/scenarios/complex_composite_scenario.rb +9 -0
- data/vendor/plugins/scenarios/spec/scenarios/composite_scenario.rb +9 -0
- data/vendor/plugins/scenarios/spec/scenarios/empty_scenario.rb +4 -0
- data/vendor/plugins/scenarios/spec/scenarios/people_scenario.rb +26 -0
- data/vendor/plugins/scenarios/spec/scenarios/places_scenario.rb +22 -0
- data/vendor/plugins/scenarios/spec/scenarios/things_scenario.rb +22 -0
- data/vendor/plugins/scenarios/spec/scenarios_spec.rb +189 -0
- data/vendor/plugins/scenarios/spec/spec.opts +7 -0
- data/vendor/plugins/scenarios/spec/spec_helper.rb +6 -0
- data/vendor/plugins/scenarios/tasks/scenario.rake +21 -0
- data/vendor/plugins/scenarios/test/scenarios_test.rb +39 -0
- data/vendor/plugins/scenarios/test/test_helper.rb +5 -0
- data/vendor/plugins/scenarios/testing/application.rb +2 -0
- data/vendor/plugins/scenarios/testing/database.yml +9 -0
- data/vendor/plugins/scenarios/testing/environment.rb +68 -0
- data/vendor/plugins/scenarios/testing/library.rb +128 -0
- data/vendor/plugins/scenarios/testing/models.rb +14 -0
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3014.patch +52 -0
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3119.patch +53 -0
- data/vendor/plugins/scenarios/testing/schema.rb +31 -0
- data/vendor/rails/Rakefile +21 -0
- data/vendor/rails/actionmailer/CHANGELOG +44 -26
- data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
- data/vendor/rails/actionmailer/README +2 -2
- data/vendor/rails/actionmailer/Rakefile +4 -3
- data/vendor/rails/actionmailer/install.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer.rb +5 -3
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +57 -36
- data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +4 -4
- data/vendor/rails/actionmailer/lib/action_mailer/part.rb +2 -5
- data/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +59 -0
- data/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +14 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{text → text-format-0.6.3/text}/format.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb +4 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile +19 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb +245 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb +47 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb +52 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb +39 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb +71 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb +481 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/facade.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb +931 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/info.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb +540 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/loader.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb +462 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb +435 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/mbox.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb +282 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb +137 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb +1475 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y +381 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/port.rb +379 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb +142 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb +43 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb +263 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb +279 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/tmail.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb +281 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb +38 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +3 -3
- data/vendor/rails/actionmailer/lib/actionmailer.rb +1 -0
- data/vendor/rails/actionmailer/test/abstract_unit.rb +19 -0
- data/vendor/rails/actionmailer/test/delivery_method_test.rb +51 -0
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +1 -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.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +5 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -5
- data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +5 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string +1 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type +104 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +100 -0
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +3 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -3
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml +6 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml +6 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +10 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -10
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +2 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -2
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder +2 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml +2 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb +3 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -3
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +5 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -3
- data/vendor/rails/actionmailer/test/mail_helper_test.rb +10 -6
- data/vendor/rails/actionmailer/test/mail_render_test.rb +45 -2
- data/vendor/rails/actionmailer/test/mail_service_test.rb +150 -27
- data/vendor/rails/actionmailer/test/quoting_test.rb +57 -3
- data/vendor/rails/actionmailer/test/test_helper_test.rb +117 -0
- data/vendor/rails/actionmailer/test/tmail_test.rb +9 -0
- data/vendor/rails/actionmailer/test/url_test.rb +10 -2
- data/vendor/rails/actionpack/CHANGELOG +1439 -20
- data/vendor/rails/actionpack/MIT-LICENSE +1 -1
- data/vendor/rails/actionpack/README +5 -5
- data/vendor/rails/actionpack/RUNNING_UNIT_TESTS +4 -5
- data/vendor/rails/actionpack/Rakefile +5 -6
- data/vendor/rails/actionpack/install.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller.rb +11 -15
- data/vendor/rails/actionpack/lib/action_controller/assertions.rb +12 -25
- data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +18 -4
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +8 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +35 -12
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +56 -12
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +105 -38
- data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +28 -15
- data/vendor/rails/actionpack/lib/action_controller/base.rb +320 -262
- data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +36 -31
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +132 -66
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +16 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +106 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +22 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +73 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +23 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +36 -55
- data/vendor/rails/actionpack/lib/action_controller/components.rb +19 -36
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +13 -9
- data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +195 -0
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +35 -34
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +30 -35
- data/vendor/rails/actionpack/lib/action_controller/helpers.rb +123 -50
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +126 -0
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +127 -108
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +61 -48
- data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +57 -68
- data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +43 -80
- data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +20 -0
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +88 -0
- data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +91 -0
- data/vendor/rails/actionpack/lib/action_controller/request.rb +553 -88
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +132 -0
- data/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +138 -0
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +185 -69
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +211 -172
- data/vendor/rails/actionpack/lib/action_controller/response.rb +49 -8
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +368 -242
- data/vendor/rails/actionpack/lib/action_controller/routing_optimisation.rb +119 -0
- data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +3 -2
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +164 -0
- data/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +9 -16
- data/vendor/rails/actionpack/lib/action_controller/session_management.rb +17 -8
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +6 -3
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +24 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{_trace.rhtml → _trace.erb} +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +11 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{layout.rhtml → layout.erb} +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{missing_template.rhtml → missing_template.erb} +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{routing_error.rhtml → routing_error.erb} +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +21 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{unknown_action.rhtml → unknown_action.erb} +0 -0
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +53 -0
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +59 -46
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +48 -24
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +7 -4
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +173 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +11 -6
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +27 -21
- data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +4 -4
- data/vendor/rails/actionpack/lib/action_view.rb +8 -3
- data/vendor/rails/actionpack/lib/action_view/base.rb +238 -140
- data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +1 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +35 -17
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +417 -87
- data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +111 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +12 -5
- data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +29 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +97 -63
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +295 -35
- data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +6 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +354 -111
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +171 -109
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +332 -76
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +35 -11
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +484 -354
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +88 -58
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +396 -364
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +2817 -1107
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +84 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +419 -43
- data/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +20 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +59 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +223 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +63 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +69 -39
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +221 -148
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +283 -165
- data/vendor/rails/actionpack/lib/action_view/partials.rb +134 -62
- data/vendor/rails/actionpack/lib/action_view/template_error.rb +4 -12
- data/vendor/rails/actionpack/lib/action_view/template_handler.rb +17 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +19 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +21 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +14 -0
- data/vendor/rails/actionpack/lib/actionpack.rb +1 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +21 -1
- data/vendor/rails/actionpack/test/action_view_test.rb +44 -0
- data/vendor/rails/actionpack/test/active_record_unit.rb +12 -20
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +2 -2
- data/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +74 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +21 -152
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +2 -7
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +120 -14
- data/vendor/rails/actionpack/test/controller/base_test.rb +11 -13
- data/vendor/rails/actionpack/test/controller/caching_test.rb +125 -5
- data/vendor/rails/actionpack/test/controller/capture_test.rb +23 -16
- data/vendor/rails/actionpack/test/controller/cgi_test.rb +70 -395
- data/vendor/rails/actionpack/test/controller/components_test.rb +31 -42
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +51 -15
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +1 -42
- data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +123 -0
- data/vendor/rails/actionpack/test/controller/fake_models.rb +5 -0
- data/vendor/rails/actionpack/test/controller/filters_test.rb +45 -7
- data/vendor/rails/actionpack/test/controller/flash_test.rb +46 -2
- data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +10 -8
- data/vendor/rails/actionpack/test/controller/helper_test.rb +23 -4
- data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +124 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +69 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +250 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +239 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +51 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +125 -0
- data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +54 -0
- data/vendor/rails/actionpack/test/controller/integration_test.rb +47 -31
- data/vendor/rails/actionpack/test/controller/layout_test.rb +64 -12
- data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +193 -38
- data/vendor/rails/actionpack/test/controller/mime_type_test.rb +30 -8
- data/vendor/rails/actionpack/test/controller/new_render_test.rb +104 -22
- data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +98 -0
- data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +103 -0
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +120 -18
- data/vendor/rails/actionpack/test/controller/render_test.rb +226 -55
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +217 -0
- data/vendor/rails/actionpack/test/controller/request_test.rb +546 -27
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +501 -0
- data/vendor/rails/actionpack/test/controller/resources_test.rb +258 -132
- data/vendor/rails/actionpack/test/controller/routing_test.rb +508 -106
- data/vendor/rails/actionpack/test/controller/selector_test.rb +5 -5
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +17 -7
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +246 -0
- data/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +182 -0
- data/vendor/rails/actionpack/test/controller/session_fixation_test.rb +89 -0
- data/vendor/rails/actionpack/test/controller/session_management_test.rb +7 -7
- data/vendor/rails/actionpack/test/controller/test_test.rb +150 -38
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +87 -12
- data/vendor/rails/actionpack/test/controller/verification_test.rb +11 -0
- data/vendor/rails/actionpack/test/controller/view_paths_test.rb +137 -0
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +11 -75
- data/vendor/rails/actionpack/test/fixtures/addresses/{list.rhtml → list.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +2 -1
- data/vendor/rails/actionpack/test/fixtures/developer.rb +2 -0
- data/vendor/rails/actionpack/test/fixtures/fun/games/{hello_world.rhtml → hello_world.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +1 -1
- data/vendor/rails/actionpack/test/fixtures/layout_tests/alt/hello.rhtml +1 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/{builder.rxml → builder.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/{standard.rhtml → standard.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/{talk_from_action.rhtml → talk_from_action.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/{yield.rhtml → yield.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +5 -0
- data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/override2/layouts/test/sub.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/404.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/500.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +0 -1
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/replies.yml +2 -0
- data/vendor/rails/actionpack/test/fixtures/reply.rb +2 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/{all_types_with_layout.rhtml → all_types_with_layout.html.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{all_types_with_layout.rjs → all_types_with_layout.js.rjs} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults.rhtml → using_defaults.html.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults.rjs → using_defaults.js.rjs} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults.rxml → using_defaults.xml.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults_with_type_list.rhtml → using_defaults_with_type_list.html.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults_with_type_list.rjs → using_defaults_with_type_list.js.rjs} +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults_with_type_list.rxml → using_defaults_with_type_list.xml.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/scope/test/{modgreet.rhtml → modgreet.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{_customer.rhtml → _customer.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{_customer_greeting.rhtml → _customer_greeting.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hash_greeting.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/{_hello.rxml → _hello.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_layout_for_partial.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/{_partial_only.rhtml → _partial_only.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{_person.rhtml → _person.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{action_talk_to_layout.rhtml → action_talk_to_layout.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{block_content_for.rhtml → block_content_for.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/{capturing.rhtml → capturing.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{content_for.rhtml → content_for.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for_concatenated.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for_with_parameter.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/dot.directory/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{erb_content_for.rhtml → erb_content_for.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/{greeting.rhtml → greeting.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{hello.rxml → hello.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{hello_world.rhtml → hello_world.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{hello_world_container.rxml → hello_world_container.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{hello_world.rxml → hello_world_from_rxml.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{hello_world_with_layout_false.rhtml → hello_world_with_layout_false.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{hello_xml_world.rxml → hello_xml_world.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/list.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/{non_erb_block_content_for.rxml → non_erb_block_content_for.builder} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{potential_conflicts.rhtml → potential_conflicts.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{render_file_with_locals.rhtml → render_file_with_locals.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{render_to_string_test.rhtml → render_to_string_test.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/{update_element_with_capture.rhtml → update_element_with_capture.erb} +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/using_layout_around_block.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/topic.rb +1 -1
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +67 -20
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +255 -54
- data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +101 -0
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +2 -2
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +88 -42
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +125 -9
- data/vendor/rails/actionpack/test/template/erb_util_test.rb +56 -0
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +326 -33
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +822 -15
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +96 -30
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +61 -13
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +12 -11
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +185 -24
- data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +49 -0
- data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +9 -3
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +13 -2
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +38 -52
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +216 -46
- data/vendor/rails/activemodel/CHANGES +12 -0
- data/vendor/rails/activemodel/README +21 -0
- data/vendor/rails/activemodel/Rakefile +4 -0
- data/vendor/rails/activemodel/lib/active_model.rb +17 -0
- data/vendor/rails/activemodel/lib/active_model/base.rb +4 -0
- data/vendor/rails/activemodel/lib/active_model/callbacks.rb +5 -0
- data/vendor/rails/activemodel/lib/active_model/observing.rb +100 -0
- data/vendor/rails/activemodel/lib/active_model/validations.rb +4 -0
- data/vendor/rails/activemodel/spec/observing_spec.rb +120 -0
- data/vendor/rails/activemodel/spec/spec_helper.rb +17 -0
- data/vendor/rails/activerecord/CHANGELOG +2484 -34
- data/vendor/rails/activerecord/MIT-LICENSE +1 -1
- data/vendor/rails/activerecord/README +1 -15
- data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +3 -34
- data/vendor/rails/activerecord/Rakefile +98 -77
- data/vendor/rails/activerecord/install.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record.rb +13 -22
- data/vendor/rails/activerecord/lib/active_record/aggregations.rb +38 -49
- data/vendor/rails/activerecord/lib/active_record/associations.rb +465 -338
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +66 -20
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +24 -22
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +46 -51
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +21 -57
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +52 -25
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +30 -14
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +253 -0
- data/vendor/rails/activerecord/lib/active_record/base.rb +830 -532
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +60 -63
- data/vendor/rails/activerecord/lib/active_record/callbacks.rb +57 -83
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +38 -9
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +56 -15
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +87 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +23 -12
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +191 -62
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +37 -34
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +28 -17
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +119 -37
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +473 -210
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +34 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +91 -107
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +522 -116
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +72 -34
- data/vendor/rails/activerecord/lib/active_record/migration.rb +80 -57
- data/vendor/rails/activerecord/lib/active_record/observer.rb +13 -10
- data/vendor/rails/activerecord/lib/active_record/query_cache.rb +14 -57
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +35 -38
- data/vendor/rails/activerecord/lib/active_record/schema.rb +5 -5
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +35 -13
- data/vendor/rails/activerecord/lib/active_record/serialization.rb +98 -0
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +71 -0
- data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +315 -0
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +20 -21
- data/vendor/rails/activerecord/lib/active_record/transactions.rb +39 -43
- data/vendor/rails/activerecord/lib/active_record/validations.rb +290 -108
- data/vendor/rails/activerecord/lib/active_record/version.rb +3 -3
- data/vendor/rails/activerecord/lib/activerecord.rb +1 -0
- data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +15 -2
- data/vendor/rails/activerecord/test/abstract_unit.rb +24 -17
- data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +20 -8
- data/vendor/rails/activerecord/test/adapter_test.rb +23 -5
- data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +15 -1
- data/vendor/rails/activerecord/test/aggregations_test.rb +34 -1
- data/vendor/rails/activerecord/test/all.sh +2 -2
- data/vendor/rails/activerecord/test/associations/callbacks_test.rb +51 -30
- data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +1 -29
- data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +145 -0
- data/vendor/rails/activerecord/test/associations/eager_test.rb +42 -6
- data/vendor/rails/activerecord/test/associations/extension_test.rb +6 -1
- data/vendor/rails/activerecord/test/associations/inner_join_association_test.rb +88 -0
- data/vendor/rails/activerecord/test/associations/join_model_test.rb +66 -13
- data/vendor/rails/activerecord/test/associations_test.rb +531 -226
- data/vendor/rails/activerecord/test/attribute_methods_test.rb +97 -0
- data/vendor/rails/activerecord/test/base_test.rb +251 -105
- data/vendor/rails/activerecord/test/binary_test.rb +22 -27
- data/vendor/rails/activerecord/test/calculations_test.rb +37 -5
- data/vendor/rails/activerecord/test/callbacks_test.rb +23 -0
- data/vendor/rails/activerecord/test/connection_test_firebird.rb +2 -2
- data/vendor/rails/activerecord/test/connection_test_mysql.rb +30 -0
- data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +3 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +5 -14
- data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +5 -14
- data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +1 -1
- data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +69 -0
- data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +178 -27
- data/vendor/rails/activerecord/test/date_time_test.rb +37 -0
- data/vendor/rails/activerecord/test/defaults_test.rb +6 -14
- data/vendor/rails/activerecord/test/deprecated_finder_test.rb +7 -128
- data/vendor/rails/activerecord/test/finder_test.rb +201 -55
- data/vendor/rails/activerecord/test/fixtures/all/developers.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/all/people.csv +0 -0
- data/vendor/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/author.rb +14 -5
- data/vendor/rails/activerecord/test/fixtures/binaries.yml +130 -435
- data/vendor/rails/activerecord/test/fixtures/book.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/books.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/category.rb +6 -0
- data/vendor/rails/activerecord/test/fixtures/citation.rb +6 -0
- data/vendor/rails/activerecord/test/fixtures/company.rb +8 -1
- data/vendor/rails/activerecord/test/fixtures/computer.rb +1 -0
- data/vendor/rails/activerecord/test/fixtures/contact.rb +16 -0
- data/vendor/rails/activerecord/test/fixtures/customer.rb +2 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +1 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +4 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +3 -1
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +6 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +1 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +41 -25
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +2 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +5 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +7 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +87 -58
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +1 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +289 -8
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema2.rb +11 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +1 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +4 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +1 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +4 -0
- data/vendor/rails/activerecord/test/fixtures/developer.rb +10 -0
- data/vendor/rails/activerecord/test/fixtures/example.log +1 -0
- data/vendor/rails/activerecord/test/fixtures/flowers.jpg +0 -0
- data/vendor/rails/activerecord/test/fixtures/item.rb +7 -0
- data/vendor/rails/activerecord/test/fixtures/items.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/joke.rb +0 -3
- data/vendor/rails/activerecord/test/fixtures/matey.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/mateys.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/minimalistic.rb +2 -0
- data/vendor/rails/activerecord/test/fixtures/minimalistics.yml +2 -0
- data/vendor/rails/activerecord/test/fixtures/mixins.yml +2 -100
- data/vendor/rails/activerecord/test/fixtures/parrot.rb +13 -0
- data/vendor/rails/activerecord/test/fixtures/parrots.yml +27 -0
- data/vendor/rails/activerecord/test/fixtures/parrots_pirates.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/pirate.rb +5 -0
- data/vendor/rails/activerecord/test/fixtures/pirates.yml +9 -0
- data/vendor/rails/activerecord/test/fixtures/post.rb +1 -0
- data/vendor/rails/activerecord/test/fixtures/project.rb +3 -2
- data/vendor/rails/activerecord/test/fixtures/reply.rb +0 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/distinct.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/distincts_selects.yml +11 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/group.yml +14 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/select.yml +8 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/values.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/ship.rb +3 -0
- data/vendor/rails/activerecord/test/fixtures/ships.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/tagging.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/taggings.yml +8 -1
- data/vendor/rails/activerecord/test/fixtures/topic.rb +13 -1
- data/vendor/rails/activerecord/test/fixtures/treasure.rb +4 -0
- data/vendor/rails/activerecord/test/fixtures/treasures.yml +10 -0
- data/vendor/rails/activerecord/test/fixtures_test.rb +220 -23
- data/vendor/rails/activerecord/test/inheritance_test.rb +7 -1
- data/vendor/rails/activerecord/test/json_serialization_test.rb +180 -0
- data/vendor/rails/activerecord/test/lifecycle_test.rb +1 -1
- data/vendor/rails/activerecord/test/locking_test.rb +94 -2
- data/vendor/rails/activerecord/test/migration_test.rb +206 -40
- data/vendor/rails/activerecord/test/mixin_test.rb +13 -515
- data/vendor/rails/activerecord/test/pk_test.rb +3 -6
- data/vendor/rails/activerecord/test/query_cache_test.rb +104 -0
- data/vendor/rails/activerecord/test/readonly_test.rb +0 -0
- data/vendor/rails/activerecord/test/reflection_test.rb +16 -0
- data/vendor/rails/activerecord/test/reserved_word_test_mysql.rb +177 -0
- data/vendor/rails/activerecord/test/schema_dumper_test.rb +38 -3
- data/vendor/rails/activerecord/test/serialization_test.rb +47 -0
- data/vendor/rails/activerecord/test/transactions_test.rb +74 -23
- data/vendor/rails/activerecord/test/unconnected_test.rb +1 -1
- data/vendor/rails/activerecord/test/validations_test.rb +330 -32
- data/vendor/rails/activerecord/test/xml_serialization_test.rb +121 -44
- data/vendor/rails/activeresource/CHANGELOG +223 -0
- data/vendor/rails/activeresource/MIT-LICENSE +20 -0
- data/vendor/rails/activeresource/README +165 -0
- data/vendor/rails/activeresource/Rakefile +133 -0
- data/vendor/rails/activeresource/lib/active_resource.rb +47 -0
- data/vendor/rails/activeresource/lib/active_resource/base.rb +872 -0
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +172 -0
- data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +105 -0
- data/vendor/rails/activeresource/lib/active_resource/formats.rb +14 -0
- data/vendor/rails/activeresource/lib/active_resource/formats/json_format.rb +23 -0
- data/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +34 -0
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +147 -0
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +288 -0
- data/vendor/rails/activeresource/lib/active_resource/version.rb +9 -0
- data/vendor/rails/activeresource/lib/activeresource.rb +1 -0
- data/vendor/rails/activeresource/test/abstract_unit.rb +10 -0
- data/vendor/rails/activeresource/test/authorization_test.rb +82 -0
- data/vendor/rails/activeresource/test/base/custom_methods_test.rb +96 -0
- data/vendor/rails/activeresource/test/base/equality_test.rb +43 -0
- data/vendor/rails/activeresource/test/base/load_test.rb +111 -0
- data/vendor/rails/activeresource/test/base_errors_test.rb +48 -0
- data/vendor/rails/activeresource/test/base_test.rb +454 -0
- data/vendor/rails/activeresource/test/connection_test.rb +170 -0
- data/vendor/rails/activeresource/test/fixtures/beast.rb +14 -0
- data/vendor/rails/activeresource/test/fixtures/person.rb +3 -0
- data/vendor/rails/activeresource/test/fixtures/street_address.rb +4 -0
- data/vendor/rails/activeresource/test/format_test.rb +42 -0
- data/vendor/rails/activeresource/test/setter_trap.rb +27 -0
- data/vendor/rails/activesupport/CHANGELOG +274 -7
- data/vendor/rails/activesupport/MIT-LICENSE +1 -1
- data/vendor/rails/activesupport/Rakefile +2 -1
- data/vendor/rails/activesupport/install.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support.rb +9 -4
- data/vendor/rails/activesupport/lib/active_support/basic_object.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +107 -0
- data/vendor/rails/activesupport/lib/active_support/clean_logger.rb +94 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext.rb +4 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +8 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +40 -18
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +20 -7
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +1 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +6 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +2 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +3 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +5 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +188 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +72 -13
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +77 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +74 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb +37 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +21 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/float.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/float/rounding.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +5 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +91 -49
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +16 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +9 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +5 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +8 -7
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +17 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +21 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +30 -11
- data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb +14 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +40 -29
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +29 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +11 -9
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +16 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +7 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/xchar.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +12 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +62 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +87 -54
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +71 -10
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +32 -31
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +4 -2
- data/vendor/rails/activesupport/lib/active_support/duration.rb +96 -0
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +13 -6
- data/vendor/rails/activesupport/lib/active_support/json.rb +22 -39
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +60 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +50 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +6 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/json/variable.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte.rb +7 -5
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +14 -2
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +115 -5
- data/vendor/rails/activesupport/lib/active_support/option_merger.rb +7 -7
- data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +22 -17
- data/vendor/rails/activesupport/lib/active_support/test_case.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/testing.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/testing/default.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +8 -7
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +14 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb +113 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{builder.rb → builder-2.1.2/builder.rb} +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb +250 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +115 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +139 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +63 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +328 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb +1021 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +3 -3
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +12 -12
- data/vendor/rails/activesupport/lib/activesupport.rb +1 -0
- data/vendor/rails/activesupport/test/abstract_unit.rb +13 -0
- data/vendor/rails/activesupport/test/buffered_logger_test.rb +107 -0
- data/vendor/rails/activesupport/test/clean_logger_test.rb +12 -35
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +74 -6
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +12 -4
- data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +16 -0
- data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +105 -0
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +10 -0
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +180 -4
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +230 -0
- data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +22 -0
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +21 -0
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +10 -10
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +29 -0
- data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +25 -0
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +262 -28
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +30 -0
- data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +11 -11
- data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +7 -7
- data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +29 -2
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +92 -28
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +91 -1
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +98 -7
- data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +50 -0
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +40 -12
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +107 -22
- data/vendor/rails/activesupport/test/dependencies_test.rb +30 -31
- data/vendor/rails/activesupport/test/inflector_test.rb +49 -205
- data/vendor/rails/activesupport/test/inflector_test_cases.rb +208 -0
- data/vendor/rails/activesupport/test/json/decoding_test.rb +41 -0
- data/vendor/rails/activesupport/test/json/encoding_test.rb +111 -0
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +10 -1
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +2 -2
- data/vendor/rails/activesupport/test/multibyte_handler_test.rb +95 -2
- data/vendor/rails/activesupport/test/ordered_options_test.rb +5 -1
- data/vendor/rails/activesupport/test/test_test.rb +73 -0
- data/vendor/rails/activesupport/test/time_zone_test.rb +10 -3
- data/vendor/rails/cleanlogs.sh +0 -0
- data/vendor/rails/pushgems.rb +2 -2
- data/vendor/rails/railties/CHANGELOG +518 -9
- data/vendor/rails/railties/MIT-LICENSE +1 -1
- data/vendor/rails/railties/README +17 -25
- data/vendor/rails/railties/Rakefile +41 -18
- data/vendor/rails/railties/bin/about +1 -1
- data/vendor/rails/railties/bin/console +1 -1
- data/vendor/rails/railties/bin/destroy +1 -1
- data/vendor/rails/railties/bin/generate +1 -1
- data/vendor/rails/railties/bin/performance/request +3 -0
- data/vendor/rails/railties/bin/plugin +1 -1
- data/vendor/rails/railties/bin/rails +0 -0
- data/vendor/rails/railties/bin/runner +1 -1
- data/vendor/rails/railties/bin/server +1 -1
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +3 -3
- data/vendor/rails/railties/configs/apache.conf +1 -1
- data/vendor/rails/railties/configs/databases/mysql.yml +10 -4
- data/vendor/rails/railties/configs/databases/postgresql.yml +16 -12
- data/vendor/rails/railties/configs/databases/sqlite3.yml +1 -1
- data/vendor/rails/railties/configs/initializers/inflections.rb +10 -0
- data/vendor/rails/railties/configs/initializers/mime_types.rb +5 -0
- data/vendor/rails/railties/configs/routes.rb +23 -11
- data/vendor/rails/railties/dispatches/dispatch.fcgi +0 -0
- data/vendor/rails/railties/dispatches/dispatch.rb +0 -0
- data/vendor/rails/railties/doc/README_FOR_APP +1 -1
- data/vendor/rails/railties/environments/boot.rb +96 -26
- data/vendor/rails/railties/environments/development.rb +2 -5
- data/vendor/rails/railties/environments/environment.rb +24 -25
- data/vendor/rails/railties/environments/production.rb +1 -0
- data/vendor/rails/railties/environments/test.rb +4 -1
- data/vendor/rails/railties/fresh_rakefile +0 -0
- data/vendor/rails/railties/helpers/application.rb +5 -2
- data/vendor/rails/railties/helpers/test_helper.rb +10 -0
- data/vendor/rails/railties/html/422.html +30 -0
- data/vendor/rails/railties/html/500.html +1 -1
- data/vendor/rails/railties/html/index.html +2 -2
- data/vendor/rails/railties/html/javascripts/controls.js +484 -354
- data/vendor/rails/railties/html/javascripts/dragdrop.js +88 -58
- data/vendor/rails/railties/html/javascripts/effects.js +396 -364
- data/vendor/rails/railties/html/javascripts/prototype.js +2817 -1107
- data/vendor/rails/railties/html/robots.txt +5 -1
- data/vendor/rails/railties/lib/commands/console.rb +12 -5
- data/vendor/rails/railties/lib/commands/generate.rb +0 -0
- data/vendor/rails/railties/lib/commands/performance/request.rb +6 -0
- data/vendor/rails/railties/lib/commands/plugin.rb +17 -12
- data/vendor/rails/railties/lib/commands/process/spawner.rb +14 -4
- data/vendor/rails/railties/lib/commands/runner.rb +1 -1
- data/vendor/rails/railties/lib/commands/servers/base.rb +12 -0
- data/vendor/rails/railties/lib/commands/servers/mongrel.rb +5 -1
- data/vendor/rails/railties/lib/commands/servers/webrick.rb +14 -7
- data/vendor/rails/railties/lib/console_app.rb +5 -2
- data/vendor/rails/railties/lib/console_with_helpers.rb +5 -2
- data/vendor/rails/railties/lib/dispatcher.rb +3 -151
- data/vendor/rails/railties/lib/fcgi_handler.rb +79 -81
- data/vendor/rails/railties/lib/initializer.rb +125 -169
- data/vendor/rails/railties/lib/rails/plugin.rb +84 -0
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +150 -0
- data/vendor/rails/railties/lib/rails/plugin/locator.rb +78 -0
- data/vendor/rails/railties/lib/rails/version.rb +3 -3
- data/vendor/rails/railties/lib/rails_generator/base.rb +11 -9
- data/vendor/rails/railties/lib/rails_generator/commands.rb +24 -14
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +0 -7
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +26 -7
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +11 -12
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/{view.rhtml → view.html.erb} +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +5 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +8 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +3 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +8 -24
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +23 -8
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +15 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +6 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +15 -14
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +10 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +11 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +4 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +5 -7
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +0 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +8 -18
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +1 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +20 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +10 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +23 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +13 -15
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +2 -14
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +24 -31
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +45 -146
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +64 -37
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +23 -80
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/{layout.rhtml → layout.html.erb} +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +19 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +24 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +18 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +10 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +6 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +3 -3
- data/vendor/rails/railties/lib/rails_generator/lookup.rb +45 -10
- data/vendor/rails/railties/lib/rails_generator/scripts.rb +6 -3
- data/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +23 -0
- data/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +160 -0
- data/vendor/rails/railties/lib/rails_generator/spec.rb +1 -1
- data/vendor/rails/railties/lib/source_annotation_extractor.rb +62 -0
- data/vendor/rails/railties/lib/tasks/annotations.rake +23 -0
- data/vendor/rails/railties/lib/tasks/databases.rake +260 -84
- data/vendor/rails/railties/lib/tasks/documentation.rake +11 -13
- data/vendor/rails/railties/lib/tasks/framework.rake +14 -8
- data/vendor/rails/railties/lib/tasks/misc.rake +7 -1
- data/vendor/rails/railties/lib/tasks/rails.rb +1 -1
- data/vendor/rails/railties/lib/tasks/testing.rake +5 -7
- data/vendor/rails/railties/lib/test_help.rb +4 -3
- data/vendor/rails/railties/lib/webrick_server.rb +3 -4
- data/vendor/rails/railties/test/abstract_unit.rb +11 -7
- data/vendor/rails/railties/test/boot_test.rb +179 -0
- data/vendor/rails/railties/test/console_app_test.rb +29 -0
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +147 -176
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +1 -1
- data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/vendor/rails/railties/test/generators/generator_test_helper.rb +195 -0
- data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +109 -0
- data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +106 -0
- data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +185 -0
- data/vendor/rails/railties/test/initializer_test.rb +204 -19
- data/vendor/rails/railties/test/plugin_loader_test.rb +140 -0
- data/vendor/rails/railties/test/plugin_locator_test.rb +69 -0
- data/vendor/rails/railties/test/plugin_test.rb +130 -100
- data/vendor/rails/railties/test/plugin_test_helper.rb +29 -0
- data/vendor/rails/railties/test/rails_generator_test.rb +25 -15
- data/vendor/rails/railties/test/rails_info_test.rb +7 -0
- data/vendor/rails/railties/test/secret_key_generation_test.rb +35 -0
- data/vendor/rails/release.rb +4 -4
- metadata +1355 -486
- data/app/views/admin/extension/index.rhtml +0 -45
- data/app/views/admin/layout/edit.rhtml +0 -39
- data/app/views/admin/page/_meta_row.rhtml +0 -4
- data/app/views/admin/page/_tag_reference.rhtml +0 -4
- data/app/views/admin/page/edit.rhtml +0 -140
- data/app/views/admin/page/index.rhtml +0 -31
- data/app/views/admin/user/edit.rhtml +0 -54
- data/app/views/admin/user/preferences.rhtml +0 -29
- data/lib/console_utils.rb +0 -167
- data/lib/plugins/extension_patches/lib/view_paths_extension.rb +0 -23
- data/public/javascripts/admin.js +0 -89
- data/public/javascripts/sitemap.js +0 -131
- data/public/javascripts/tabcontrol.js +0 -125
- data/public/javascripts/tag_reference_search.js +0 -23
- data/test/functional/admin/abstract_model_controller_test.rb +0 -125
- data/test/functional/admin/export_controller_test.rb +0 -23
- data/test/functional/admin/extension_controller_test.rb +0 -41
- data/test/functional/admin/layout_controller_test.rb +0 -42
- data/test/functional/admin/page_controller_test.rb +0 -300
- data/test/functional/admin/snippet_controller_test.rb +0 -11
- data/test/functional/admin/user_controller_test.rb +0 -90
- data/test/functional/admin/welcome_controller_test.rb +0 -51
- data/test/functional/application_controller_test.rb +0 -45
- data/test/functional/extension_initialization_test.rb +0 -131
- data/test/functional/extension_load_order_test.rb +0 -49
- data/test/functional/login_system_test.rb +0 -138
- data/test/functional/site_controller_test.rb +0 -203
- data/test/unit/admin_ui_test.rb +0 -93
- data/test/unit/annotatable_test.rb +0 -76
- data/test/unit/extension_migrator_test.rb +0 -17
- data/test/unit/extension_test.rb +0 -42
- data/test/unit/file_not_found_page_test.rb +0 -31
- data/test/unit/inheritable_class_attributes_test.rb +0 -47
- data/test/unit/layout_test.rb +0 -29
- data/test/unit/local_time_test.rb +0 -45
- data/test/unit/method_observer_test.rb +0 -53
- data/test/unit/page_context_test.rb +0 -60
- data/test/unit/page_part_test.rb +0 -44
- data/test/unit/page_test.rb +0 -449
- data/test/unit/radiant/config_test.rb +0 -57
- data/test/unit/radiant/exporter_test.rb +0 -26
- data/test/unit/radiant/taggable_test.rb +0 -105
- data/test/unit/response_cache_test.rb +0 -233
- data/test/unit/simpleton_test.rb +0 -42
- data/test/unit/snippet_test.rb +0 -47
- data/test/unit/standard_tags_test.rb +0 -472
- data/test/unit/status_test.rb +0 -43
- data/test/unit/text_filter_test.rb +0 -42
- data/test/unit/user_action_observer_test.rb +0 -40
- data/test/unit/user_test.rb +0 -137
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +0 -3
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb +0 -242
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb +0 -39
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb +0 -71
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb +0 -69
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb +0 -467
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb +0 -914
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +0 -447
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb +0 -433
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb +0 -280
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb +0 -135
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb +0 -1522
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb +0 -377
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +0 -131
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb +0 -41
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb +0 -263
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb +0 -277
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb +0 -238
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_test_helper.rhtml +0 -1
- data/vendor/rails/actionmailer/test/fixtures/helpers/test_helper.rb +0 -5
- data/vendor/rails/actionmailer/test/fixtures/raw_email11 +0 -34
- data/vendor/rails/actionpack/examples/address_book/index.rhtml +0 -33
- data/vendor/rails/actionpack/examples/address_book/layout.rhtml +0 -8
- data/vendor/rails/actionpack/examples/address_book_controller.cgi +0 -9
- data/vendor/rails/actionpack/examples/address_book_controller.fcgi +0 -6
- data/vendor/rails/actionpack/examples/address_book_controller.rb +0 -52
- data/vendor/rails/actionpack/examples/address_book_controller.rbx +0 -4
- data/vendor/rails/actionpack/examples/benchmark.rb +0 -52
- data/vendor/rails/actionpack/examples/benchmark_with_ar.fcgi +0 -89
- data/vendor/rails/actionpack/examples/blog_controller.cgi +0 -53
- data/vendor/rails/actionpack/examples/debate/index.rhtml +0 -14
- data/vendor/rails/actionpack/examples/debate/new_topic.rhtml +0 -22
- data/vendor/rails/actionpack/examples/debate/topic.rhtml +0 -32
- data/vendor/rails/actionpack/examples/debate_controller.cgi +0 -57
- data/vendor/rails/actionpack/lib/action_controller/assertions/deprecated_assertions.rb +0 -228
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb +0 -36
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +0 -211
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb +0 -125
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/pstore_performance_fix.rb +0 -30
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb +0 -95
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session_performance_fix.rb +0 -30
- data/vendor/rails/actionpack/lib/action_controller/deprecated_dependencies.rb +0 -65
- data/vendor/rails/actionpack/lib/action_controller/deprecated_redirects.rb +0 -17
- data/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb +0 -34
- data/vendor/rails/actionpack/lib/action_controller/macros/auto_complete.rb +0 -53
- data/vendor/rails/actionpack/lib/action_controller/macros/in_place_editing.rb +0 -33
- data/vendor/rails/actionpack/lib/action_controller/pagination.rb +0 -408
- data/vendor/rails/actionpack/lib/action_controller/scaffolding.rb +0 -189
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml +0 -44
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +0 -11
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.rhtml +0 -21
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml +0 -7
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml +0 -69
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/list.rhtml +0 -27
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/new.rhtml +0 -6
- data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/show.rhtml +0 -9
- data/vendor/rails/actionpack/lib/action_controller/vendor/xml_node.rb +0 -97
- data/vendor/rails/actionpack/lib/action_view/helpers/deprecated_helper.rb +0 -37
- data/vendor/rails/actionpack/lib/action_view/helpers/java_script_macros_helper.rb +0 -233
- data/vendor/rails/actionpack/lib/action_view/helpers/pagination_helper.rb +0 -86
- data/vendor/rails/actionpack/test/activerecord/active_record_assertions_test.rb +0 -92
- data/vendor/rails/actionpack/test/activerecord/pagination_test.rb +0 -165
- data/vendor/rails/actionpack/test/controller/deprecated_instance_variables_test.rb +0 -48
- data/vendor/rails/actionpack/test/controller/raw_post_test.rb +0 -68
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_params_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_request_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_response_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_session_method.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/_hash_object.rhtml +0 -1
- data/vendor/rails/actionpack/test/fixtures/test/list.rhtml +0 -1
- data/vendor/rails/actionpack/test/template/deprecated_helper_test.rb +0 -36
- data/vendor/rails/actionpack/test/template/deprecated_instance_variables_test.rb +0 -43
- data/vendor/rails/actionpack/test/template/java_script_macros_helper_test.rb +0 -109
- data/vendor/rails/actionwebservice/CHANGELOG +0 -293
- data/vendor/rails/actionwebservice/MIT-LICENSE +0 -21
- data/vendor/rails/actionwebservice/README +0 -364
- data/vendor/rails/actionwebservice/Rakefile +0 -171
- data/vendor/rails/actionwebservice/TODO +0 -32
- data/vendor/rails/actionwebservice/examples/googlesearch/README +0 -143
- data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb +0 -50
- data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb +0 -57
- data/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb +0 -108
- data/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb +0 -7
- data/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb +0 -50
- data/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb +0 -58
- data/vendor/rails/actionwebservice/examples/metaWeblog/README +0 -17
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb +0 -60
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb +0 -34
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb +0 -67
- data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb +0 -48
- data/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb +0 -16
- data/vendor/rails/actionwebservice/install.rb +0 -30
- data/vendor/rails/actionwebservice/lib/action_web_service.rb +0 -66
- data/vendor/rails/actionwebservice/lib/action_web_service/api.rb +0 -249
- data/vendor/rails/actionwebservice/lib/action_web_service/base.rb +0 -42
- data/vendor/rails/actionwebservice/lib/action_web_service/casting.rb +0 -136
- data/vendor/rails/actionwebservice/lib/action_web_service/client.rb +0 -3
- data/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb +0 -28
- data/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb +0 -113
- data/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb +0 -58
- data/vendor/rails/actionwebservice/lib/action_web_service/container.rb +0 -3
- data/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb +0 -93
- data/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb +0 -86
- data/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb +0 -69
- data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb +0 -2
- data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +0 -203
- data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +0 -376
- data/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb +0 -202
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb +0 -4
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb +0 -112
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb +0 -37
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb +0 -176
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +0 -241
- data/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +0 -110
- data/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb +0 -283
- data/vendor/rails/actionwebservice/lib/action_web_service/struct.rb +0 -68
- data/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb +0 -26
- data/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb +0 -222
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml +0 -65
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml +0 -6
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml +0 -29
- data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml +0 -30
- data/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb +0 -110
- data/vendor/rails/actionwebservice/lib/action_web_service/version.rb +0 -9
- data/vendor/rails/actionwebservice/setup.rb +0 -1379
- data/vendor/rails/actionwebservice/test/abstract_client.rb +0 -183
- data/vendor/rails/actionwebservice/test/abstract_dispatcher.rb +0 -505
- data/vendor/rails/actionwebservice/test/abstract_unit.rb +0 -45
- data/vendor/rails/actionwebservice/test/api_test.rb +0 -102
- data/vendor/rails/actionwebservice/test/apis/auto_load_api.rb +0 -3
- data/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb +0 -2
- data/vendor/rails/actionwebservice/test/base_test.rb +0 -42
- data/vendor/rails/actionwebservice/test/casting_test.rb +0 -86
- data/vendor/rails/actionwebservice/test/client_soap_test.rb +0 -152
- data/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb +0 -151
- data/vendor/rails/actionwebservice/test/container_test.rb +0 -73
- data/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb +0 -137
- data/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb +0 -59
- data/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql +0 -7
- data/vendor/rails/actionwebservice/test/fixtures/users.yml +0 -10
- data/vendor/rails/actionwebservice/test/gencov +0 -3
- data/vendor/rails/actionwebservice/test/invocation_test.rb +0 -185
- data/vendor/rails/actionwebservice/test/run +0 -6
- data/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb +0 -146
- data/vendor/rails/actionwebservice/test/struct_test.rb +0 -52
- data/vendor/rails/actionwebservice/test/test_invoke_test.rb +0 -112
- data/vendor/rails/activerecord/benchmarks/benchmark.rb +0 -26
- data/vendor/rails/activerecord/benchmarks/mysql_benchmark.rb +0 -19
- data/vendor/rails/activerecord/examples/associations.rb +0 -87
- data/vendor/rails/activerecord/examples/shared_setup.rb +0 -15
- data/vendor/rails/activerecord/examples/validation.rb +0 -85
- data/vendor/rails/activerecord/lib/active_record/acts/list.rb +0 -256
- data/vendor/rails/activerecord/lib/active_record/acts/nested_set.rb +0 -211
- data/vendor/rails/activerecord/lib/active_record/acts/tree.rb +0 -96
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/db2_adapter.rb +0 -228
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/firebird_adapter.rb +0 -728
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb +0 -861
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/openbase_adapter.rb +0 -350
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +0 -690
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +0 -607
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb +0 -662
- data/vendor/rails/activerecord/lib/active_record/deprecated_associations.rb +0 -104
- data/vendor/rails/activerecord/lib/active_record/deprecated_finders.rb +0 -44
- data/vendor/rails/activerecord/lib/active_record/vendor/simple.rb +0 -693
- data/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb +0 -15
- data/vendor/rails/activerecord/lib/active_record/wrappings.rb +0 -58
- data/vendor/rails/activerecord/lib/active_record/xml_serialization.rb +0 -308
- data/vendor/rails/activerecord/test/connections/native_sqlserver/connection.rb +0 -23
- data/vendor/rails/activerecord/test/connections/native_sqlserver_odbc/connection.rb +0 -25
- data/vendor/rails/activerecord/test/copy_table_sqlite.rb +0 -64
- data/vendor/rails/activerecord/test/deprecated_associations_test.rb +0 -396
- data/vendor/rails/activerecord/test/empty_date_time_test.rb +0 -25
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.drop.sql +0 -32
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.sql +0 -234
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql +0 -34
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.sql +0 -243
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/mixin.rb +0 -63
- data/vendor/rails/activerecord/test/mixin_nested_set_test.rb +0 -196
- data/vendor/rails/activesupport/lib/active_support/binding_of_caller.rb +0 -84
- data/vendor/rails/activesupport/lib/active_support/breakpoint.rb +0 -528
- data/vendor/rails/activesupport/lib/active_support/caching_tools.rb +0 -62
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb +0 -7
- data/vendor/rails/activesupport/lib/active_support/json/encoders.rb +0 -25
- data/vendor/rails/activesupport/lib/active_support/json/encoders/core.rb +0 -70
- data/vendor/rails/activesupport/lib/active_support/reloadable.rb +0 -60
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/blankslate.rb +0 -63
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xchar.rb +0 -112
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlbase.rb +0 -145
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlevents.rb +0 -63
- data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlmarkup.rb +0 -327
- data/vendor/rails/activesupport/lib/active_support/vendor/xml_simple.rb +0 -1021
- data/vendor/rails/activesupport/test/caching_tools_test.rb +0 -79
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default.rb +0 -30
- data/vendor/rails/activesupport/test/json_test.rb +0 -97
- data/vendor/rails/activesupport/test/reloadable_test.rb +0 -123
- data/vendor/rails/railties/bin/breakpointer +0 -3
- data/vendor/rails/railties/lib/binding_of_caller.rb +0 -85
- data/vendor/rails/railties/lib/breakpoint.rb +0 -553
- data/vendor/rails/railties/lib/breakpoint_client.rb +0 -196
- data/vendor/rails/railties/lib/commands/breakpointer.rb +0 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/USAGE +0 -18
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/fixtures.yml +0 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/migration.rb +0 -13
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/model.rb +0 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/unit_test.rb +0 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml +0 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml +0 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +0 -9
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +0 -27
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +0 -8
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml +0 -8
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/USAGE +0 -29
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb +0 -93
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb +0 -79
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/fixtures.yml +0 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/functional_test.rb +0 -57
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/helper.rb +0 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml +0 -17
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb +0 -13
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/model.rb +0 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/style.css +0 -74
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/unit_test.rb +0 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml +0 -19
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml +0 -24
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml +0 -18
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml +0 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/USAGE +0 -28
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb +0 -5
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb +0 -8
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb +0 -19
- data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb +0 -29
- data/vendor/rails/railties/lib/tasks/pre_namespace_aliases.rake +0 -53
- data/vendor/rails/railties/test/dispatcher_test.rb +0 -141
- data/vendor/rails/railties/test/mocks/dispatcher.rb +0 -13
- data/vendor/rails/railties/test/mocks/fcgi.rb +0 -15
- data/vendor/rails/railties/test/mocks/stubbed_breakpoint.rb +0 -2
- data/vendor/rails/railties/test/mocks/stubbed_kernel.rb +0 -5
@@ -6,7 +6,6 @@ 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/deprecated_associations'
|
10
9
|
|
11
10
|
module ActiveRecord
|
12
11
|
class HasManyThroughAssociationNotFoundError < ActiveRecordError #:nodoc:
|
@@ -50,6 +49,12 @@ module ActiveRecord
|
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
52
|
+
class HasManyThroughCantDissociateNewRecords < ActiveRecordError #:nodoc:
|
53
|
+
def initialize(owner, reflection)
|
54
|
+
super("Cannot dissociate 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 delete the has_many :through record associating them.")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
53
58
|
class EagerLoadPolymorphicError < ActiveRecordError #:nodoc:
|
54
59
|
def initialize(reflection)
|
55
60
|
super("Can not eagerly load the polymorphic association #{reflection.name.inspect}")
|
@@ -76,7 +81,7 @@ module ActiveRecord
|
|
76
81
|
|
77
82
|
# Associations are a set of macro-like class methods for tying objects together through foreign keys. They express relationships like
|
78
83
|
# "Project has one Project Manager" or "Project belongs to a Portfolio". Each macro adds a number of methods to the class which are
|
79
|
-
# specialized according to the collection or association symbol and the options hash. It works much the same way as Ruby's own attr
|
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>
|
80
85
|
# methods. Example:
|
81
86
|
#
|
82
87
|
# class Project < ActiveRecord::Base
|
@@ -95,14 +100,121 @@ module ActiveRecord
|
|
95
100
|
# * <tt>Project#categories.empty?, Project#categories.size, Project#categories, Project#categories<<(category1),</tt>
|
96
101
|
# <tt>Project#categories.delete(category1)</tt>
|
97
102
|
#
|
98
|
-
#
|
103
|
+
# === A word of warning
|
104
|
+
#
|
105
|
+
# Don't create associations that have the same name as instance methods of ActiveRecord::Base. Since the association
|
106
|
+
# adds a method with that name to its model, it will override the inherited method and break things.
|
107
|
+
# For instance, #attributes and #connection would be bad choices for association names.
|
108
|
+
#
|
109
|
+
# == Auto-generated methods
|
110
|
+
#
|
111
|
+
# ===Singular associations (one-to-one)
|
112
|
+
# | | belongs_to |
|
113
|
+
# generated methods | belongs_to | :polymorphic | has_one
|
114
|
+
# ----------------------------------+------------+--------------+---------
|
115
|
+
# #other | X | X | X
|
116
|
+
# #other=(other) | X | X | X
|
117
|
+
# #build_other(attributes={}) | X | | X
|
118
|
+
# #create_other(attributes={}) | X | | X
|
119
|
+
# #other.create!(attributes={}) | | | X
|
120
|
+
# #other.nil? | X | X |
|
121
|
+
#
|
122
|
+
# ===Collection associations (one-to-many / many-to-many)
|
123
|
+
# | | | has_many
|
124
|
+
# generated methods | habtm | has_many | :through
|
125
|
+
# ----------------------------------+-------+----------+----------
|
126
|
+
# #others | X | X | X
|
127
|
+
# #others=(other,other,...) | X | X |
|
128
|
+
# #other_ids | X | X | X
|
129
|
+
# #other_ids=(id,id,...) | X | X |
|
130
|
+
# #others<< | X | X | X
|
131
|
+
# #others.push | X | X | X
|
132
|
+
# #others.concat | X | X | X
|
133
|
+
# #others.build(attributes={}) | X | X | X
|
134
|
+
# #others.create(attributes={}) | X | X |
|
135
|
+
# #others.create!(attributes={}) | X | X | X
|
136
|
+
# #others.size | X | X | X
|
137
|
+
# #others.length | X | X | X
|
138
|
+
# #others.count | | X | X
|
139
|
+
# #others.sum(args*,&block) | X | X | X
|
140
|
+
# #others.empty? | X | X | X
|
141
|
+
# #others.clear | X | X |
|
142
|
+
# #others.delete(other,other,...) | X | X | X
|
143
|
+
# #others.delete_all | X | X |
|
144
|
+
# #others.destroy_all | X | X | X
|
145
|
+
# #others.find(*args) | X | X | X
|
146
|
+
# #others.find_first | X | |
|
147
|
+
# #others.uniq | X | X |
|
148
|
+
# #others.reset | X | X | X
|
149
|
+
#
|
150
|
+
# == Cardinality and associations
|
151
|
+
#
|
152
|
+
# ActiveRecord associations can be used to describe relations with one-to-one, one-to-many
|
153
|
+
# and many-to-many cardinality. Each model uses an association to describe its role in
|
154
|
+
# the relation. In each case, the +belongs_to+ association is used in the model that has
|
155
|
+
# the foreign key.
|
156
|
+
#
|
157
|
+
# === One-to-one
|
158
|
+
#
|
159
|
+
# Use +has_one+ in the base, and +belongs_to+ in the associated model.
|
99
160
|
#
|
100
|
-
#
|
161
|
+
# class Employee < ActiveRecord::Base
|
162
|
+
# has_one :office
|
163
|
+
# end
|
164
|
+
# class Office < ActiveRecord::Base
|
165
|
+
# belongs_to :employee # foreign key - employee_id
|
166
|
+
# end
|
167
|
+
#
|
168
|
+
# === One-to-many
|
169
|
+
#
|
170
|
+
# Use +has_many+ in the base, and +belongs_to+ in the associated model.
|
171
|
+
#
|
172
|
+
# class Manager < ActiveRecord::Base
|
173
|
+
# has_many :employees
|
174
|
+
# end
|
175
|
+
# class Employee < ActiveRecord::Base
|
176
|
+
# belongs_to :manager # foreign key - manager_id
|
177
|
+
# end
|
178
|
+
#
|
179
|
+
# === Many-to-many
|
180
|
+
#
|
181
|
+
# There are two ways to build a many-to-many relationship.
|
182
|
+
#
|
183
|
+
# The first way uses a +has_many+ association with the <tt>:through</tt> option and a join model, so
|
184
|
+
# there are two stages of associations.
|
185
|
+
#
|
186
|
+
# class Assignment < ActiveRecord::Base
|
187
|
+
# belongs_to :programmer # foreign key - programmer_id
|
188
|
+
# belongs_to :project # foreign key - project_id
|
189
|
+
# end
|
190
|
+
# class Programmer < ActiveRecord::Base
|
191
|
+
# has_many :assignments
|
192
|
+
# has_many :projects, :through => :assignments
|
193
|
+
# end
|
194
|
+
# class Project < ActiveRecord::Base
|
195
|
+
# has_many :assignments
|
196
|
+
# has_many :programmers, :through => :assignments
|
197
|
+
# end
|
198
|
+
#
|
199
|
+
# For the second way, use +has_and_belongs_to_many+ in both models. This requires a join table
|
200
|
+
# that has no corresponding model or primary key.
|
201
|
+
#
|
202
|
+
# class Programmer < ActiveRecord::Base
|
203
|
+
# has_and_belongs_to_many :projects # foreign keys in the join table
|
204
|
+
# end
|
205
|
+
# class Project < ActiveRecord::Base
|
206
|
+
# has_and_belongs_to_many :programmers # foreign keys in the join table
|
207
|
+
# end
|
101
208
|
#
|
102
|
-
#
|
209
|
+
# 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,
|
211
|
+
# use <tt>has_many :through</tt>. Use +has_and_belongs_to_many+ when working with legacy schemas or when
|
212
|
+
# you never work directly with the relationship itself.
|
103
213
|
#
|
104
|
-
#
|
105
|
-
#
|
214
|
+
# == Is it a +belongs_to+ or +has_one+ association?
|
215
|
+
#
|
216
|
+
# Both express a 1-1 relationship. The difference is mostly where to place the foreign key, which goes on the table for the class
|
217
|
+
# declaring the +belongs_to+ relationship. Example:
|
106
218
|
#
|
107
219
|
# class User < ActiveRecord::Base
|
108
220
|
# # I reference an account.
|
@@ -131,31 +243,31 @@ module ActiveRecord
|
|
131
243
|
#
|
132
244
|
# == Unsaved objects and associations
|
133
245
|
#
|
134
|
-
# You can manipulate objects and associations before they are saved to the database, but there is some special
|
246
|
+
# You can manipulate objects and associations before they are saved to the database, but there is some special behavior you should be
|
135
247
|
# aware of, mostly involving the saving of associated objects.
|
136
248
|
#
|
137
249
|
# === One-to-one associations
|
138
250
|
#
|
139
|
-
# * Assigning an object to a has_one association automatically saves that object and the object being replaced (if there is one), in
|
140
|
-
# order to update their primary keys - except if the parent object is unsaved (new_record? == true).
|
141
|
-
# * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns false and the assignment
|
251
|
+
# * Assigning an object to a +has_one+ association automatically saves that object and the object being replaced (if there is one), in
|
252
|
+
# order to update their primary keys - except if the parent object is unsaved (<tt>new_record? == true</tt>).
|
253
|
+
# * If either of these saves fail (due to one of the objects being invalid) the assignment statement returns +false+ and the assignment
|
142
254
|
# is cancelled.
|
143
|
-
# * If you wish to assign an object to a has_one association without saving it, use the
|
144
|
-
# * Assigning an object to a belongs_to association does not save the object, since the foreign key field belongs on the parent. It
|
145
|
-
# not save the parent either.
|
255
|
+
# * If you wish to assign an object to a +has_one+ association without saving it, use the <tt>#association.build</tt> method (documented below).
|
256
|
+
# * Assigning an object to a +belongs_to+ association does not save the object, since the foreign key field belongs on the parent. It
|
257
|
+
# does not save the parent either.
|
146
258
|
#
|
147
259
|
# === Collections
|
148
260
|
#
|
149
|
-
# * Adding an object to a collection (has_many or has_and_belongs_to_many) automatically saves that object, except if the parent object
|
261
|
+
# * Adding an object to a collection (+has_many+ or +has_and_belongs_to_many+) automatically saves that object, except if the parent object
|
150
262
|
# (the owner of the collection) is not yet stored in the database.
|
151
|
-
# * If saving any of the objects being added to a collection (via
|
152
|
-
# * You can add an object to a collection without automatically saving it by using the
|
153
|
-
# * All unsaved (new_record? == true) members of the collection are automatically saved when the parent is saved.
|
263
|
+
# * If saving any of the objects being added to a collection (via <tt>#push</tt> or similar) fails, then <tt>#push</tt> returns +false+.
|
264
|
+
# * You can add an object to a collection without automatically saving it by using the <tt>#collection.build</tt> method (documented below).
|
265
|
+
# * All unsaved (<tt>new_record? == true</tt>) members of the collection are automatically saved when the parent is saved.
|
154
266
|
#
|
155
267
|
# === Association callbacks
|
156
268
|
#
|
157
|
-
#
|
158
|
-
#
|
269
|
+
# Similar to the normal callbacks that hook into the lifecycle of an Active Record object, you can also define callbacks that get
|
270
|
+
# triggered when you add an object to or remove an object from an association collection. Example:
|
159
271
|
#
|
160
272
|
# class Project
|
161
273
|
# has_and_belongs_to_many :developers, :after_add => :evaluate_velocity
|
@@ -171,14 +283,14 @@ module ActiveRecord
|
|
171
283
|
# has_and_belongs_to_many :developers, :after_add => [:evaluate_velocity, Proc.new { |p, d| p.shipping_date = Time.now}]
|
172
284
|
# end
|
173
285
|
#
|
174
|
-
# Possible callbacks are: before_add
|
286
|
+
# Possible callbacks are: +before_add+, +after_add+, +before_remove+ and +after_remove+.
|
175
287
|
#
|
176
|
-
# Should any of the before_add callbacks throw an exception, the object does not get added to the collection. Same with
|
177
|
-
# the before_remove callbacks
|
288
|
+
# Should any of the +before_add+ callbacks throw an exception, the object does not get added to the collection. Same with
|
289
|
+
# the +before_remove+ callbacks; if an exception is thrown the object doesn't get removed.
|
178
290
|
#
|
179
291
|
# === Association extensions
|
180
292
|
#
|
181
|
-
# The proxy objects that
|
293
|
+
# The proxy objects that control the access to associations can be extended through anonymous modules. This is especially
|
182
294
|
# beneficial for adding new finders, creators, and other factory-type methods that are only used as part of this association.
|
183
295
|
# Example:
|
184
296
|
#
|
@@ -212,7 +324,7 @@ module ActiveRecord
|
|
212
324
|
# has_many :people, :extend => FindOrCreateByNameExtension
|
213
325
|
# end
|
214
326
|
#
|
215
|
-
# If you need to use multiple named extension modules, you can specify an array of modules with the
|
327
|
+
# If you need to use multiple named extension modules, you can specify an array of modules with the <tt>:extend</tt> option.
|
216
328
|
# In the case of name conflicts between methods in the modules, methods in modules later in the array supercede
|
217
329
|
# those earlier in the array. Example:
|
218
330
|
#
|
@@ -225,12 +337,12 @@ module ActiveRecord
|
|
225
337
|
#
|
226
338
|
# * +proxy_owner+ - Returns the object the association is part of.
|
227
339
|
# * +proxy_reflection+ - Returns the reflection object that describes the association.
|
228
|
-
# * +proxy_target+ - Returns the associated object for belongs_to and has_one
|
340
|
+
# * +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+.
|
229
341
|
#
|
230
342
|
# === Association Join Models
|
231
343
|
#
|
232
|
-
# Has Many associations can be configured with the
|
233
|
-
# operates similarly to a
|
344
|
+
# Has Many associations can be configured with the <tt>:through</tt> option to use an explicit join model to retrieve the data. This
|
345
|
+
# operates similarly to a +has_and_belongs_to_many+ association. The advantage is that you're able to add validations,
|
234
346
|
# callbacks, and extra attributes on the join model. Consider the following schema:
|
235
347
|
#
|
236
348
|
# class Author < ActiveRecord::Base
|
@@ -247,7 +359,7 @@ module ActiveRecord
|
|
247
359
|
# @author.authorships.collect { |a| a.book } # selects all books that the author's authorships belong to.
|
248
360
|
# @author.books # selects all books by using the Authorship join model
|
249
361
|
#
|
250
|
-
# You can also go through a has_many association on the join model:
|
362
|
+
# You can also go through a +has_many+ association on the join model:
|
251
363
|
#
|
252
364
|
# class Firm < ActiveRecord::Base
|
253
365
|
# has_many :clients
|
@@ -270,25 +382,25 @@ module ActiveRecord
|
|
270
382
|
# === Polymorphic Associations
|
271
383
|
#
|
272
384
|
# Polymorphic associations on models are not restricted on what types of models they can be associated with. Rather, they
|
273
|
-
# specify an interface that a has_many association must adhere to.
|
385
|
+
# specify an interface that a +has_many+ association must adhere to.
|
274
386
|
#
|
275
387
|
# class Asset < ActiveRecord::Base
|
276
388
|
# belongs_to :attachable, :polymorphic => true
|
277
389
|
# end
|
278
390
|
#
|
279
391
|
# class Post < ActiveRecord::Base
|
280
|
-
# has_many :assets, :as => :attachable # The
|
392
|
+
# has_many :assets, :as => :attachable # The :as option specifies the polymorphic interface to use.
|
281
393
|
# end
|
282
394
|
#
|
283
395
|
# @asset.attachable = @post
|
284
396
|
#
|
285
397
|
# 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
|
286
|
-
# an attachable_id integer column and an attachable_type string column.
|
398
|
+
# an +attachable_id+ integer column and an +attachable_type+ string column.
|
287
399
|
#
|
288
400
|
# Using polymorphic associations in combination with single table inheritance (STI) is a little tricky. In order
|
289
401
|
# for the associations to work as expected, ensure that you store the base model for the STI models in the
|
290
402
|
# type column of the polymorphic association. To continue with the asset example above, suppose there are guest posts
|
291
|
-
# and member posts that use the posts table for STI.
|
403
|
+
# and member posts that use the posts table for STI. In this case, there must be a +type+ column in the posts table.
|
292
404
|
#
|
293
405
|
# class Asset < ActiveRecord::Base
|
294
406
|
# belongs_to :attachable, :polymorphic => true
|
@@ -303,10 +415,10 @@ module ActiveRecord
|
|
303
415
|
# has_many :assets, :as => :attachable, :dependent => :destroy
|
304
416
|
# end
|
305
417
|
#
|
306
|
-
# class GuestPost <
|
418
|
+
# class GuestPost < Post
|
307
419
|
# end
|
308
420
|
#
|
309
|
-
# class MemberPost <
|
421
|
+
# class MemberPost < Post
|
310
422
|
# end
|
311
423
|
#
|
312
424
|
# == Caching
|
@@ -324,7 +436,7 @@ module ActiveRecord
|
|
324
436
|
# == Eager loading of associations
|
325
437
|
#
|
326
438
|
# Eager loading is a way to find objects of a certain class and a number of named associations along with it in a single SQL call. This is
|
327
|
-
# one of the easiest ways of to prevent the dreaded 1+N problem in which fetching 100 posts that each
|
439
|
+
# 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
|
328
440
|
# triggers 101 database queries. Through the use of eager loading, the 101 queries can be reduced to 1. Example:
|
329
441
|
#
|
330
442
|
# class Post < ActiveRecord::Base
|
@@ -344,16 +456,16 @@ module ActiveRecord
|
|
344
456
|
#
|
345
457
|
# for post in Post.find(:all, :include => :author)
|
346
458
|
#
|
347
|
-
# This references the name of the belongs_to association that also used the
|
348
|
-
# like this: LEFT OUTER JOIN authors ON authors.id = posts.author_id
|
459
|
+
# This references the name of the +belongs_to+ association that also used the <tt>:author</tt> symbol, so the find will now weave in a join something
|
460
|
+
# like this: <tt>LEFT OUTER JOIN authors ON authors.id = posts.author_id</tt>. Doing so will cut down the number of queries from 201 to 101.
|
349
461
|
#
|
350
462
|
# We can improve upon the situation further by referencing both associations in the finder with:
|
351
463
|
#
|
352
464
|
# for post in Post.find(:all, :include => [ :author, :comments ])
|
353
465
|
#
|
354
|
-
# That'll add another join along the lines of: LEFT OUTER JOIN comments ON comments.post_id = posts.id
|
466
|
+
# That'll add another join along the lines of: <tt>LEFT OUTER JOIN comments ON comments.post_id = posts.id</tt>. And we'll be down to 1 query.
|
355
467
|
#
|
356
|
-
# To include a deep hierarchy of associations,
|
468
|
+
# To include a deep hierarchy of associations, use a hash:
|
357
469
|
#
|
358
470
|
# for post in Post.find(:all, :include => [ :author, { :comments => { :author => :gravatar } } ])
|
359
471
|
#
|
@@ -365,12 +477,12 @@ module ActiveRecord
|
|
365
477
|
# 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.
|
366
478
|
#
|
367
479
|
# Since the eager loading pulls from multiple tables, you'll have to disambiguate any column references in both conditions and orders. So
|
368
|
-
#
|
369
|
-
#
|
480
|
+
# <tt>:order => "posts.id DESC"</tt> will work while <tt>:order => "id DESC"</tt> will not. Because eager loading generates the +SELECT+ statement too, the
|
481
|
+
# <tt>:select</tt> option is ignored.
|
370
482
|
#
|
371
483
|
# You can use eager loading on multiple associations from the same table, but you cannot use those associations in orders and conditions
|
372
484
|
# as there is currently not any way to disambiguate them. Eager loading will not pull additional attributes on join tables, so "rich
|
373
|
-
# associations" with has_and_belongs_to_many are not a good fit for eager loading.
|
485
|
+
# associations" with +has_and_belongs_to_many+ are not a good fit for eager loading.
|
374
486
|
#
|
375
487
|
# When eager loaded, conditions are interpolated in the context of the model class, not the model instance. Conditions are lazily interpolated
|
376
488
|
# before the actual model exists.
|
@@ -378,7 +490,7 @@ module ActiveRecord
|
|
378
490
|
# == Table Aliasing
|
379
491
|
#
|
380
492
|
# ActiveRecord uses table aliasing in the case that a table is referenced multiple times in a join. If a table is referenced only once,
|
381
|
-
# the standard table name is used. The second time, the table is aliased as
|
493
|
+
# the standard table name is used. The second time, the table is aliased as <tt>#{reflection_name}_#{parent_table_name}</tt>. Indexes are appended
|
382
494
|
# for any more successive uses of the table name.
|
383
495
|
#
|
384
496
|
# Post.find :all, :include => :comments
|
@@ -398,9 +510,9 @@ module ActiveRecord
|
|
398
510
|
# TreeMixin.find :all, :include => {:children => {:parent => :children}}
|
399
511
|
# # => SELECT ... FROM mixins LEFT OUTER JOIN mixins childrens_mixins ...
|
400
512
|
# LEFT OUTER JOIN parents_mixins ...
|
401
|
-
#
|
513
|
+
# LEFT OUTER JOIN mixins childrens_mixins_2
|
402
514
|
#
|
403
|
-
# Has and Belongs to Many join tables use the same idea, but add a _join suffix:
|
515
|
+
# Has and Belongs to Many join tables use the same idea, but add a <tt>_join</tt> suffix:
|
404
516
|
#
|
405
517
|
# Post.find :all, :include => :categories
|
406
518
|
# # => SELECT ... FROM posts LEFT OUTER JOIN categories_posts ... LEFT OUTER JOIN categories ...
|
@@ -412,7 +524,7 @@ module ActiveRecord
|
|
412
524
|
# LEFT OUTER JOIN categories_posts posts_categories_join LEFT OUTER JOIN posts posts_categories
|
413
525
|
# LEFT OUTER JOIN categories_posts categories_posts_join LEFT OUTER JOIN categories categories_posts
|
414
526
|
#
|
415
|
-
# If you wish to specify your own custom joins using a
|
527
|
+
# 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:
|
416
528
|
#
|
417
529
|
# Post.find :all, :include => :comments, :joins => "inner join comments ..."
|
418
530
|
# # => SELECT ... FROM posts LEFT OUTER JOIN comments_posts ON ... INNER JOIN comments ...
|
@@ -437,8 +549,8 @@ module ActiveRecord
|
|
437
549
|
# end
|
438
550
|
# end
|
439
551
|
#
|
440
|
-
# When Firm#clients is called, it
|
441
|
-
# with a class in another module scope this can be done by specifying the complete class name
|
552
|
+
# When <tt>Firm#clients</tt> is called, it will in turn call <tt>MyApplication::Business::Company.find(firm.id)</tt>. If you want to associate
|
553
|
+
# with a class in another module scope, this can be done by specifying the complete class name. Example:
|
442
554
|
#
|
443
555
|
# module MyApplication
|
444
556
|
# module Business
|
@@ -452,41 +564,41 @@ module ActiveRecord
|
|
452
564
|
# end
|
453
565
|
# end
|
454
566
|
#
|
455
|
-
# == Type safety with ActiveRecord::AssociationTypeMismatch
|
567
|
+
# == Type safety with <tt>ActiveRecord::AssociationTypeMismatch</tt>
|
456
568
|
#
|
457
569
|
# If you attempt to assign an object to an association that doesn't match the inferred or specified <tt>:class_name</tt>, you'll
|
458
|
-
# get
|
570
|
+
# get an <tt>ActiveRecord::AssociationTypeMismatch</tt>.
|
459
571
|
#
|
460
572
|
# == Options
|
461
573
|
#
|
462
|
-
# All of the association macros can be specialized through options
|
574
|
+
# All of the association macros can be specialized through options. This makes cases more complex than the simple and guessable ones
|
463
575
|
# possible.
|
464
576
|
module ClassMethods
|
465
|
-
# Adds the following methods for retrieval and query of collections of associated objects
|
577
|
+
# Adds the following methods for retrieval and query of collections of associated objects:
|
466
578
|
# +collection+ is replaced with the symbol passed as the first argument, so
|
467
579
|
# <tt>has_many :clients</tt> would add among others <tt>clients.empty?</tt>.
|
468
580
|
# * <tt>collection(force_reload = false)</tt> - returns an array of all the associated objects.
|
469
581
|
# An empty array is returned if none are found.
|
470
582
|
# * <tt>collection<<(object, ...)</tt> - adds one or more objects to the collection by setting their foreign keys to the collection's primary key.
|
471
583
|
# * <tt>collection.delete(object, ...)</tt> - removes one or more objects from the collection by setting their foreign keys to NULL.
|
472
|
-
# This will also destroy the objects if they're declared as belongs_to and dependent on this model.
|
584
|
+
# This will also destroy the objects if they're declared as +belongs_to+ and dependent on this model.
|
473
585
|
# * <tt>collection=objects</tt> - replaces the collections content by deleting and adding objects as appropriate.
|
474
|
-
# * <tt>collection_singular_ids</tt> - returns an array of the associated objects ids
|
475
|
-
# * <tt>collection_singular_ids=ids</tt> - replace the collection
|
586
|
+
# * <tt>collection_singular_ids</tt> - returns an array of the associated objects' ids
|
587
|
+
# * <tt>collection_singular_ids=ids</tt> - replace the collection with the objects identified by the primary keys in +ids+
|
476
588
|
# * <tt>collection.clear</tt> - removes every object from the collection. This destroys the associated objects if they
|
477
|
-
# are <tt>:dependent</tt>, deletes them directly from the database if
|
478
|
-
#
|
479
|
-
# * <tt>collection.empty?</tt> - returns true if there are no associated objects.
|
589
|
+
# 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> - returns +true+ if there are no associated objects.
|
480
592
|
# * <tt>collection.size</tt> - returns the number of associated objects.
|
481
593
|
# * <tt>collection.find</tt> - finds an associated object according to the same rules as Base.find.
|
482
|
-
# * <tt>collection.build(attributes = {})</tt> - returns
|
483
|
-
# with +attributes+ and linked to this object through a foreign key but
|
484
|
-
# associated object already exists, not if it's nil
|
594
|
+
# * <tt>collection.build(attributes = {}, ...)</tt> - returns one or more new objects of the collection type that have been instantiated
|
595
|
+
# with +attributes+ and linked to this object through a foreign key, but have not yet been saved. *Note:* This only works if an
|
596
|
+
# associated object already exists, not if it's +nil+!
|
485
597
|
# * <tt>collection.create(attributes = {})</tt> - returns a new object of the collection type that has been instantiated
|
486
|
-
# with +attributes
|
487
|
-
# *Note:* This only works if an associated object already exists, not if it's nil
|
598
|
+
# with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
|
599
|
+
# *Note:* This only works if an associated object already exists, not if it's +nil+!
|
488
600
|
#
|
489
|
-
# Example: A Firm class declares <tt>has_many :clients</tt>, which will add:
|
601
|
+
# Example: A +Firm+ class declares <tt>has_many :clients</tt>, which will add:
|
490
602
|
# * <tt>Firm#clients</tt> (similar to <tt>Clients.find :all, :conditions => "firm_id = #{id}"</tt>)
|
491
603
|
# * <tt>Firm#clients<<</tt>
|
492
604
|
# * <tt>Firm#clients.delete</tt>
|
@@ -505,47 +617,38 @@ module ActiveRecord
|
|
505
617
|
# * <tt>:class_name</tt> - specify the class name of the association. Use it only if that name can't be inferred
|
506
618
|
# from the association name. So <tt>has_many :products</tt> will by default be linked to the +Product+ class, but
|
507
619
|
# if the real class name is +SpecialProduct+, you'll have to specify it with this option.
|
508
|
-
# * <tt>:conditions</tt> - specify the conditions that the associated objects must meet in order to be included as a
|
509
|
-
#
|
510
|
-
# * <tt>:order</tt> - specify the order in which the associated objects are returned as
|
511
|
-
# such as
|
512
|
-
# * <tt>:group</tt> - specify the attribute by which the associated objects are returned as a "GROUP BY" sql fragment,
|
513
|
-
# such as "category"
|
620
|
+
# * <tt>:conditions</tt> - specify the conditions that the associated objects must meet in order to be included as a +WHERE+
|
621
|
+
# SQL fragment, such as <tt>price > 5 AND name LIKE 'B%'</tt>.
|
622
|
+
# * <tt>:order</tt> - specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
623
|
+
# such as <tt>last_name, first_name DESC</tt>
|
514
624
|
# * <tt>:foreign_key</tt> - specify the foreign key used for the association. By default this is guessed to be the name
|
515
|
-
# of this class in lower-case and
|
516
|
-
# as the default foreign_key
|
517
|
-
# * <tt>:dependent</tt> - if set to
|
518
|
-
# alongside this object by calling their destroy method. If set to
|
519
|
-
# objects are deleted *without* calling their destroy method. If set to
|
520
|
-
# objects' foreign keys are set to NULL *without* calling their save callbacks.
|
521
|
-
# NOTE: :dependent => true is deprecated and has been replaced with :dependent => :destroy.
|
522
|
-
# May not be set if :exclusively_dependent is also set.
|
523
|
-
# * <tt>:exclusively_dependent</tt> - Deprecated; equivalent to :dependent => :delete_all. If set to true all
|
524
|
-
# the associated object are deleted in one SQL statement without having their
|
525
|
-
# before_destroy callback run. This should only be used on associations that depend solely on this class and don't need to do any
|
526
|
-
# clean-up in before_destroy. The upside is that it's much faster, especially if there's a counter_cache involved.
|
527
|
-
# May not be set if :dependent is also set.
|
625
|
+
# of this class in lower-case and +_id+ suffixed. So a +Person+ class that makes a +has_many+ association will use +person_id+
|
626
|
+
# as the default +foreign_key+.
|
627
|
+
# * <tt>:dependent</tt> - if set to <tt>:destroy</tt> all the associated objects are destroyed
|
628
|
+
# alongside this object by calling their destroy method. If set to <tt>:delete_all</tt> all associated
|
629
|
+
# objects are deleted *without* calling their destroy method. If set to <tt>:nullify</tt> all associated
|
630
|
+
# objects' foreign keys are set to +NULL+ *without* calling their save callbacks.
|
528
631
|
# * <tt>:finder_sql</tt> - specify a complete SQL statement to fetch the association. This is a good way to go for complex
|
529
632
|
# associations that depend on multiple tables. Note: When this option is used, +find_in_collection+ is _not_ added.
|
530
|
-
# * <tt>:counter_sql</tt> - specify a complete SQL statement to fetch the size of the association. If
|
531
|
-
# specified but
|
532
|
-
# * <tt>:extend</tt> - specify a named module for extending the proxy
|
633
|
+
# * <tt>:counter_sql</tt> - specify a complete SQL statement to fetch the size of the association. If <tt>:finder_sql</tt> is
|
634
|
+
# 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> - specify a named module for extending the proxy. See "Association extensions".
|
533
636
|
# * <tt>:include</tt> - specify second-order associations that should be eager loaded when the collection is loaded.
|
534
|
-
# * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
|
637
|
+
# * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
|
535
638
|
# * <tt>:limit</tt>: An integer determining the limit on the number of rows that should be returned.
|
536
639
|
# * <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.
|
537
|
-
# * <tt>:select</tt>: By default, this is
|
538
|
-
# include the joined columns.
|
539
|
-
# * <tt>:as</tt>: Specifies a polymorphic interface (See
|
540
|
-
# * <tt>:through</tt>: Specifies a Join Model to perform the query
|
541
|
-
# are ignored, as the association uses the source reflection.
|
542
|
-
# or <tt>has_many</tt> association.
|
640
|
+
# * <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
|
641
|
+
# but not include the joined columns.
|
642
|
+
# * <tt>:as</tt>: Specifies a polymorphic interface (See <tt>#belongs_to</tt>).
|
643
|
+
# * <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
|
+
# 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
|
+
# or <tt>has_many</tt> association on the join model.
|
543
646
|
# * <tt>:source</tt>: Specifies the source association name used by <tt>has_many :through</tt> queries. Only use it if the name cannot be
|
544
|
-
# inferred from the association. <tt>has_many :subscribers, :through => :subscriptions</tt> will look for either
|
545
|
-
#
|
546
|
-
# * <tt>:source_type</tt>: Specifies type of the source association used by <tt>has_many :through</tt> queries where the source
|
547
|
-
# is a polymorphic belongs_to
|
548
|
-
# * <tt>:uniq</tt> - if set to true
|
647
|
+
# inferred from the association. <tt>has_many :subscribers, :through => :subscriptions</tt> will look for either <tt>:subscribers</tt> or
|
648
|
+
# <tt>:subscriber</tt> on +Subscription+, unless a <tt>:source</tt> is given.
|
649
|
+
# * <tt>:source_type</tt>: Specifies type of the source association used by <tt>has_many :through</tt> queries where the source
|
650
|
+
# association is a polymorphic +belongs_to+.
|
651
|
+
# * <tt>:uniq</tt> - if set to +true+, duplicates will be omitted from the collection. Useful in conjunction with <tt>:through</tt>.
|
549
652
|
#
|
550
653
|
# Option examples:
|
551
654
|
# has_many :comments, :order => "posted_on"
|
@@ -567,27 +670,26 @@ module ActiveRecord
|
|
567
670
|
|
568
671
|
if options[:through]
|
569
672
|
collection_reader_method(reflection, HasManyThroughAssociation)
|
673
|
+
collection_accessor_methods(reflection, HasManyThroughAssociation, false)
|
570
674
|
else
|
571
675
|
add_multiple_associated_save_callbacks(reflection.name)
|
572
676
|
add_association_callbacks(reflection.name, reflection.options)
|
573
677
|
collection_accessor_methods(reflection, HasManyAssociation)
|
574
678
|
end
|
575
|
-
|
576
|
-
add_deprecated_api_for_has_many(reflection.name)
|
577
679
|
end
|
578
680
|
|
579
|
-
# Adds the following methods for retrieval and query of a single associated object
|
681
|
+
# Adds the following methods for retrieval and query of a single associated object:
|
580
682
|
# +association+ is replaced with the symbol passed as the first argument, so
|
581
683
|
# <tt>has_one :manager</tt> would add among others <tt>manager.nil?</tt>.
|
582
|
-
# * <tt>association(force_reload = false)</tt> - returns the associated object.
|
684
|
+
# * <tt>association(force_reload = false)</tt> - returns the associated object. +nil+ is returned if none is found.
|
583
685
|
# * <tt>association=(associate)</tt> - assigns the associate object, extracts the primary key, sets it as the foreign key,
|
584
686
|
# and saves the associate object.
|
585
|
-
# * <tt>association.nil?</tt> - returns true if there is no associated object.
|
687
|
+
# * <tt>association.nil?</tt> - returns +true+ if there is no associated object.
|
586
688
|
# * <tt>build_association(attributes = {})</tt> - returns a new object of the associated type that has been instantiated
|
587
|
-
# with +attributes+ and linked to this object through a foreign key but has not yet been saved. Note: This ONLY works if
|
588
|
-
# an association already exists. It will NOT work if the association is nil
|
689
|
+
# with +attributes+ and linked to this object through a foreign key, but has not yet been saved. Note: This ONLY works if
|
690
|
+
# an association already exists. It will NOT work if the association is +nil+.
|
589
691
|
# * <tt>create_association(attributes = {})</tt> - returns a new object of the associated type that has been instantiated
|
590
|
-
# with +attributes
|
692
|
+
# with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
|
591
693
|
#
|
592
694
|
# Example: An Account class declares <tt>has_one :beneficiary</tt>, which will add:
|
593
695
|
# * <tt>Account#beneficiary</tt> (similar to <tt>Beneficiary.find(:first, :conditions => "account_id = #{id}")</tt>)
|
@@ -602,22 +704,22 @@ module ActiveRecord
|
|
602
704
|
# * <tt>:class_name</tt> - specify the class name of the association. Use it only if that name can't be inferred
|
603
705
|
# from the association name. So <tt>has_one :manager</tt> will by default be linked to the +Manager+ class, but
|
604
706
|
# if the real class name is +Person+, you'll have to specify it with this option.
|
605
|
-
# * <tt>:conditions</tt> - specify the conditions that the associated object must meet in order to be included as a
|
606
|
-
#
|
607
|
-
# * <tt>:order</tt> - specify the order
|
608
|
-
#
|
609
|
-
# * <tt>:dependent</tt> - if set to
|
610
|
-
#
|
611
|
-
# object's foreign key is set to NULL
|
707
|
+
# * <tt>:conditions</tt> - specify the conditions that the associated object must meet in order to be included as a +WHERE+
|
708
|
+
# SQL fragment, such as <tt>rank = 5</tt>.
|
709
|
+
# * <tt>:order</tt> - specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
710
|
+
# such as <tt>last_name, first_name DESC</tt>
|
711
|
+
# * <tt>:dependent</tt> - if set to <tt>:destroy</tt>, the associated object is destroyed when this object is. If set to
|
712
|
+
# <tt>:delete</tt>, the associated object is deleted *without* calling its destroy method. If set to <tt>:nullify</tt>, the associated
|
713
|
+
# object's foreign key is set to +NULL+. Also, association is assigned.
|
612
714
|
# * <tt>:foreign_key</tt> - specify the foreign key used for the association. By default this is guessed to be the name
|
613
|
-
# of this class in lower-case and
|
614
|
-
# as the default foreign_key
|
715
|
+
# of this class in lower-case and +_id+ suffixed. So a +Person+ class that makes a +has_one+ association will use +person_id+
|
716
|
+
# as the default +foreign_key+.
|
615
717
|
# * <tt>:include</tt> - specify second-order associations that should be eager loaded when this object is loaded.
|
616
|
-
# * <tt>:as</tt>: Specifies a polymorphic interface (See
|
718
|
+
# * <tt>:as</tt>: Specifies a polymorphic interface (See <tt>#belongs_to</tt>).
|
617
719
|
#
|
618
720
|
# Option examples:
|
619
721
|
# has_one :credit_card, :dependent => :destroy # destroys the associated credit card
|
620
|
-
# has_one :credit_card, :dependent => :nullify # updates the associated records
|
722
|
+
# has_one :credit_card, :dependent => :nullify # updates the associated records foreign key value to NULL rather than destroying it
|
621
723
|
# has_one :last_comment, :class_name => "Comment", :order => "posted_on"
|
622
724
|
# has_one :project_manager, :class_name => "Person", :conditions => "role = 'project_manager'"
|
623
725
|
# has_one :attachment, :as => :attachable
|
@@ -639,22 +741,18 @@ module ActiveRecord
|
|
639
741
|
association_constructor_method(:create, reflection, HasOneAssociation)
|
640
742
|
|
641
743
|
configure_dependency_for_has_one(reflection)
|
642
|
-
|
643
|
-
# deprecated api
|
644
|
-
deprecated_has_association_method(reflection.name)
|
645
|
-
deprecated_association_comparison_method(reflection.name, reflection.class_name)
|
646
744
|
end
|
647
745
|
|
648
|
-
# Adds the following methods for retrieval and query for a single associated object
|
746
|
+
# Adds the following methods for retrieval and query for a single associated object for which this object holds an id:
|
649
747
|
# +association+ is replaced with the symbol passed as the first argument, so
|
650
748
|
# <tt>belongs_to :author</tt> would add among others <tt>author.nil?</tt>.
|
651
|
-
# * <tt>association(force_reload = false)</tt> - returns the associated object.
|
749
|
+
# * <tt>association(force_reload = false)</tt> - returns the associated object. +nil+ is returned if none is found.
|
652
750
|
# * <tt>association=(associate)</tt> - assigns the associate object, extracts the primary key, and sets it as the foreign key.
|
653
|
-
# * <tt>association.nil?</tt> - returns true if there is no associated object.
|
751
|
+
# * <tt>association.nil?</tt> - returns +true+ if there is no associated object.
|
654
752
|
# * <tt>build_association(attributes = {})</tt> - returns a new object of the associated type that has been instantiated
|
655
|
-
# with +attributes+ and linked to this object through a foreign key but has not yet been saved.
|
753
|
+
# with +attributes+ and linked to this object through a foreign key, but has not yet been saved.
|
656
754
|
# * <tt>create_association(attributes = {})</tt> - returns a new object of the associated type that has been instantiated
|
657
|
-
# with +attributes
|
755
|
+
# with +attributes+, linked to this object through a foreign key, and that has already been saved (if it passed the validation).
|
658
756
|
#
|
659
757
|
# Example: A Post class declares <tt>belongs_to :author</tt>, which will add:
|
660
758
|
# * <tt>Post#author</tt> (similar to <tt>Author.find(author_id)</tt>)
|
@@ -669,20 +767,23 @@ module ActiveRecord
|
|
669
767
|
# * <tt>:class_name</tt> - specify the class name of the association. Use it only if that name can't be inferred
|
670
768
|
# from the association name. So <tt>has_one :author</tt> will by default be linked to the +Author+ class, but
|
671
769
|
# if the real class name is +Person+, you'll have to specify it with this option.
|
672
|
-
# * <tt>:conditions</tt> - specify the conditions that the associated object must meet in order to be included as a
|
673
|
-
#
|
674
|
-
# * <tt>:order</tt> - specify the order
|
675
|
-
#
|
770
|
+
# * <tt>:conditions</tt> - specify the conditions that the associated object must meet in order to be included as a +WHERE+
|
771
|
+
# SQL fragment, such as <tt>authorized = 1</tt>.
|
772
|
+
# * <tt>:order</tt> - specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
773
|
+
# such as <tt>last_name, first_name DESC</tt>
|
676
774
|
# * <tt>:foreign_key</tt> - specify the foreign key used for the association. By default this is guessed to be the name
|
677
|
-
# of the associated class in lower-case and
|
678
|
-
# +Boss+ class will use
|
679
|
-
# * <tt>:counter_cache</tt> - caches the number of belonging objects on the associate class through use of increment_counter
|
680
|
-
# and decrement_counter
|
681
|
-
# destroyed. This requires that a column named
|
682
|
-
# is used on the associate class (such as a Post class). You can also specify a custom counter cache column by
|
683
|
-
# name instead of a true
|
775
|
+
# of the associated class in lower-case and +_id+ suffixed. So a +Person+ class that makes a +belongs_to+ association to a
|
776
|
+
# +Boss+ class will use +boss_id+ as the default +foreign_key+.
|
777
|
+
# * <tt>:counter_cache</tt> - caches the number of belonging objects on the associate class through the use of +increment_counter+
|
778
|
+
# 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 +Comment+ class)
|
780
|
+
# is used on the associate class (such as a +Post+ class). You can also specify a custom counter cache column by providing
|
781
|
+
# a column name instead of a +true+/+false+ value to this option (e.g., <tt>:counter_cache => :my_custom_counter</tt>.)
|
782
|
+
# Note: Specifying a counter_cache will add it to that model's list of readonly attributes using #attr_readonly.
|
684
783
|
# * <tt>:include</tt> - specify second-order associations that should be eager loaded when this object is loaded.
|
685
|
-
# * <tt>:polymorphic</tt> - specify this association is a polymorphic association by passing true
|
784
|
+
# * <tt>:polymorphic</tt> - specify this association is a polymorphic association by passing +true+.
|
785
|
+
# Note: If you've enabled the counter cache, then you may want to add the counter cache attribute
|
786
|
+
# to the attr_readonly list in the associated classes (e.g. class Post; attr_readonly :comments_count; end).
|
686
787
|
#
|
687
788
|
# Option examples:
|
688
789
|
# belongs_to :firm, :foreign_key => "client_of"
|
@@ -691,12 +792,6 @@ module ActiveRecord
|
|
691
792
|
# :conditions => 'discounts > #{payments_count}'
|
692
793
|
# belongs_to :attachable, :polymorphic => true
|
693
794
|
def belongs_to(association_id, options = {})
|
694
|
-
if options.include?(:class_name) && !options.include?(:foreign_key)
|
695
|
-
::ActiveSupport::Deprecation.warn(
|
696
|
-
"The inferred foreign_key name will change in Rails 2.0 to use the association name instead of its class name when they differ. When using :class_name in belongs_to, use the :foreign_key option to explicitly set the key name to avoid problems in the transition.",
|
697
|
-
caller)
|
698
|
-
end
|
699
|
-
|
700
795
|
reflection = create_belongs_to_reflection(association_id, options)
|
701
796
|
|
702
797
|
if reflection.options[:polymorphic]
|
@@ -736,10 +831,6 @@ module ActiveRecord
|
|
736
831
|
end
|
737
832
|
EOF
|
738
833
|
end
|
739
|
-
|
740
|
-
# deprecated api
|
741
|
-
deprecated_has_association_method(reflection.name)
|
742
|
-
deprecated_association_comparison_method(reflection.name, reflection.class_name)
|
743
834
|
end
|
744
835
|
|
745
836
|
# Create the callbacks to update counter cache
|
@@ -756,13 +847,17 @@ module ActiveRecord
|
|
756
847
|
module_eval(
|
757
848
|
"before_destroy '#{reflection.name}.class.decrement_counter(\"#{cache_column}\", #{reflection.primary_key_name})" +
|
758
849
|
" unless #{reflection.name}.nil?'"
|
759
|
-
)
|
850
|
+
)
|
851
|
+
|
852
|
+
module_eval(
|
853
|
+
"#{reflection.class_name}.send(:attr_readonly,\"#{cache_column}\".intern) if defined?(#{reflection.class_name}) && #{reflection.class_name}.respond_to?(:attr_readonly)"
|
854
|
+
)
|
760
855
|
end
|
761
856
|
end
|
762
857
|
|
763
858
|
# Associates two classes via an intermediate join table. Unless the join table is explicitly specified as
|
764
|
-
# an option, it is guessed using the lexical order of the class names. So a join between Developer and Project
|
765
|
-
# will give the default join table name of
|
859
|
+
# an option, it is guessed using the lexical order of the class names. So a join between +Developer+ and +Project+
|
860
|
+
# will give the default join table name of +developers_projects+ because "D" outranks "P". Note that this precedence
|
766
861
|
# is calculated using the <tt><</tt> operator for <tt>String</tt>. This means that if the strings are of different lengths,
|
767
862
|
# and the strings are equal when compared up to the shortest length, then the longer string is considered of higher
|
768
863
|
# lexical precedence than the shorter one. For example, one would expect the tables <tt>paper_boxes</tt> and <tt>papers</tt>
|
@@ -771,37 +866,33 @@ module ActiveRecord
|
|
771
866
|
# custom <tt>join_table</tt> option if you need to.
|
772
867
|
#
|
773
868
|
# Deprecated: Any additional fields added to the join table will be placed as attributes when pulling records out through
|
774
|
-
# has_and_belongs_to_many associations. Records returned from join tables with additional attributes will be marked as
|
775
|
-
# ReadOnly (because we can't save changes to the additional
|
869
|
+
# +has_and_belongs_to_many+ associations. Records returned from join tables with additional attributes will be marked as
|
870
|
+
# +ReadOnly+ (because we can't save changes to the additional attributes). It's strongly recommended that you upgrade any
|
776
871
|
# associations with attributes to a real join model (see introduction).
|
777
872
|
#
|
778
|
-
# Adds the following methods for retrieval and query
|
873
|
+
# Adds the following methods for retrieval and query:
|
779
874
|
# +collection+ is replaced with the symbol passed as the first argument, so
|
780
875
|
# <tt>has_and_belongs_to_many :categories</tt> would add among others <tt>categories.empty?</tt>.
|
781
876
|
# * <tt>collection(force_reload = false)</tt> - returns an array of all the associated objects.
|
782
|
-
# An empty array is returned if none
|
877
|
+
# An empty array is returned if none are found.
|
783
878
|
# * <tt>collection<<(object, ...)</tt> - adds one or more objects to the collection by creating associations in the join table
|
784
|
-
# (collection.push and collection.concat are aliases to this method).
|
785
|
-
# * <tt>collection.push_with_attributes(object, join_attributes)</tt> - adds one to the collection by creating an association in the join table that
|
786
|
-
# also holds the attributes from <tt>join_attributes</tt> (should be a hash with the column names as keys). This can be used to have additional
|
787
|
-
# attributes on the join, which will be injected into the associated objects when they are retrieved through the collection.
|
788
|
-
# (collection.concat_with_attributes is an alias to this method). This method is now deprecated.
|
879
|
+
# (<tt>collection.push</tt> and <tt>collection.concat</tt> are aliases to this method).
|
789
880
|
# * <tt>collection.delete(object, ...)</tt> - removes one or more objects from the collection by removing their associations from the join table.
|
790
881
|
# This does not destroy the objects.
|
791
|
-
# * <tt>collection=objects</tt> - replaces the
|
792
|
-
# * <tt>collection_singular_ids</tt> - returns an array of the associated objects ids
|
882
|
+
# * <tt>collection=objects</tt> - replaces the collection's content by deleting and adding objects as appropriate.
|
883
|
+
# * <tt>collection_singular_ids</tt> - returns an array of the associated objects' ids
|
793
884
|
# * <tt>collection_singular_ids=ids</tt> - replace the collection by the objects identified by the primary keys in +ids+
|
794
885
|
# * <tt>collection.clear</tt> - removes every object from the collection. This does not destroy the objects.
|
795
|
-
# * <tt>collection.empty?</tt> - returns true if there are no associated objects.
|
886
|
+
# * <tt>collection.empty?</tt> - returns +true+ if there are no associated objects.
|
796
887
|
# * <tt>collection.size</tt> - returns the number of associated objects.
|
797
888
|
# * <tt>collection.find(id)</tt> - finds an associated object responding to the +id+ and that
|
798
889
|
# meets the condition that it has to be associated with this object.
|
799
890
|
# * <tt>collection.build(attributes = {})</tt> - returns a new object of the collection type that has been instantiated
|
800
|
-
# with +attributes+ and linked to this object through the join table but has not yet been saved.
|
891
|
+
# with +attributes+ and linked to this object through the join table, but has not yet been saved.
|
801
892
|
# * <tt>collection.create(attributes = {})</tt> - returns a new object of the collection type that has been instantiated
|
802
|
-
# with +attributes
|
893
|
+
# with +attributes+, linked to this object through the join table, and that has already been saved (if it passed the validation).
|
803
894
|
#
|
804
|
-
# Example:
|
895
|
+
# Example: A Developer class declares <tt>has_and_belongs_to_many :projects</tt>, which will add:
|
805
896
|
# * <tt>Developer#projects</tt>
|
806
897
|
# * <tt>Developer#projects<<</tt>
|
807
898
|
# * <tt>Developer#projects.delete</tt>
|
@@ -821,30 +912,31 @@ module ActiveRecord
|
|
821
912
|
# from the association name. So <tt>has_and_belongs_to_many :projects</tt> will by default be linked to the
|
822
913
|
# +Project+ class, but if the real class name is +SuperProject+, you'll have to specify it with this option.
|
823
914
|
# * <tt>:join_table</tt> - specify the name of the join table if the default based on lexical order isn't what you want.
|
824
|
-
# WARNING: If you're overwriting the table name of either class, the table_name method MUST be declared underneath any
|
825
|
-
# has_and_belongs_to_many declaration in order to work.
|
915
|
+
# WARNING: If you're overwriting the table name of either class, the +table_name+ method MUST be declared underneath any
|
916
|
+
# +has_and_belongs_to_many+ declaration in order to work.
|
826
917
|
# * <tt>:foreign_key</tt> - specify the foreign key used for the association. By default this is guessed to be the name
|
827
|
-
# of this class in lower-case and
|
828
|
-
# will use
|
918
|
+
# of this class in lower-case and +_id+ suffixed. So a +Person+ class that makes a +has_and_belongs_to_many+ association
|
919
|
+
# will use +person_id+ as the default +foreign_key+.
|
829
920
|
# * <tt>:association_foreign_key</tt> - specify the association foreign key used for the association. By default this is
|
830
|
-
# guessed to be the name of the associated class in lower-case and
|
831
|
-
# the has_and_belongs_to_many association will use
|
832
|
-
# * <tt>:conditions</tt> - specify the conditions that the associated object must meet in order to be included as a
|
833
|
-
#
|
834
|
-
# * <tt>:order</tt> - specify the order in which the associated objects are returned as
|
835
|
-
#
|
836
|
-
# * <tt>:
|
837
|
-
# * <tt>:
|
838
|
-
#
|
839
|
-
#
|
840
|
-
#
|
921
|
+
# guessed to be the name of the associated class in lower-case and +_id+ suffixed. So if the associated class is +Project+,
|
922
|
+
# the +has_and_belongs_to_many+ association will use +project_id+ as the default association +foreign_key+.
|
923
|
+
# * <tt>:conditions</tt> - specify the conditions that the associated object must meet in order to be included as a +WHERE+
|
924
|
+
# SQL fragment, such as <tt>authorized = 1</tt>.
|
925
|
+
# * <tt>:order</tt> - specify the order in which the associated objects are returned as an <tt>ORDER BY</tt> SQL fragment,
|
926
|
+
# such as <tt>last_name, first_name DESC</tt>
|
927
|
+
# * <tt>:uniq</tt> - if set to +true+, duplicate associated objects will be ignored by accessors and query methods
|
928
|
+
# * <tt>:finder_sql</tt> - overwrite the default generated SQL statement used to fetch the association with a manual statement
|
929
|
+
# * <tt>:delete_sql</tt> - overwrite the default generated SQL statement used to remove links between the associated
|
930
|
+
# classes with a manual statement
|
931
|
+
# * <tt>:insert_sql</tt> - overwrite the default generated SQL statement used to add links between the associated classes
|
932
|
+
# with a manual statement
|
841
933
|
# * <tt>:extend</tt> - anonymous module for extending the proxy, see "Association extensions".
|
842
934
|
# * <tt>:include</tt> - specify second-order associations that should be eager loaded when the collection is loaded.
|
843
|
-
# * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the GROUP BY SQL-clause.
|
935
|
+
# * <tt>:group</tt>: An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
|
844
936
|
# * <tt>:limit</tt>: An integer determining the limit on the number of rows that should be returned.
|
845
937
|
# * <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.
|
846
|
-
# * <tt>:select</tt>: By default, this is
|
847
|
-
# include the joined columns.
|
938
|
+
# * <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
|
939
|
+
# but not include the joined columns.
|
848
940
|
#
|
849
941
|
# Option examples:
|
850
942
|
# has_and_belongs_to_many :projects
|
@@ -862,7 +954,7 @@ module ActiveRecord
|
|
862
954
|
# Don't use a before_destroy callback since users' before_destroy
|
863
955
|
# callbacks will be executed after the association is wiped out.
|
864
956
|
old_method = "destroy_without_habtm_shim_for_#{reflection.name}"
|
865
|
-
class_eval <<-end_eval
|
957
|
+
class_eval <<-end_eval unless method_defined?(old_method)
|
866
958
|
alias_method :#{old_method}, :destroy_without_callbacks
|
867
959
|
def destroy_without_callbacks
|
868
960
|
#{reflection.name}.clear
|
@@ -871,12 +963,6 @@ module ActiveRecord
|
|
871
963
|
end_eval
|
872
964
|
|
873
965
|
add_association_callbacks(reflection.name, options)
|
874
|
-
|
875
|
-
# deprecated api
|
876
|
-
deprecated_collection_count_method(reflection.name)
|
877
|
-
deprecated_add_association_relation(reflection.name)
|
878
|
-
deprecated_remove_association_relation(reflection.name)
|
879
|
-
deprecated_has_collection_method(reflection.name)
|
880
966
|
end
|
881
967
|
|
882
968
|
private
|
@@ -953,7 +1039,7 @@ module ActiveRecord
|
|
953
1039
|
end
|
954
1040
|
end
|
955
1041
|
|
956
|
-
def collection_accessor_methods(reflection, association_proxy_class)
|
1042
|
+
def collection_accessor_methods(reflection, association_proxy_class, writer = true)
|
957
1043
|
collection_reader_method(reflection, association_proxy_class)
|
958
1044
|
|
959
1045
|
define_method("#{reflection.name}=") do |new_value|
|
@@ -970,7 +1056,7 @@ module ActiveRecord
|
|
970
1056
|
define_method("#{reflection.name.to_s.singularize}_ids=") do |new_value|
|
971
1057
|
ids = (new_value || []).reject { |nid| nid.blank? }
|
972
1058
|
send("#{reflection.name}=", reflection.class_name.constantize.find(ids))
|
973
|
-
end
|
1059
|
+
end if writer
|
974
1060
|
end
|
975
1061
|
|
976
1062
|
def add_multiple_associated_save_callbacks(association_name)
|
@@ -1002,10 +1088,10 @@ module ActiveRecord
|
|
1002
1088
|
[]
|
1003
1089
|
end
|
1004
1090
|
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1091
|
+
records_to_save.each { |record| association.send(:insert_record, record) } unless records_to_save.blank?
|
1092
|
+
|
1093
|
+
# reconstruct the SQL queries now that we know the owner's id
|
1094
|
+
association.send(:construct_sql) if association.respond_to?(:construct_sql)
|
1009
1095
|
end_eval
|
1010
1096
|
|
1011
1097
|
# Doesn't use after_save as that would save associations added in after_create/after_update twice
|
@@ -1041,74 +1127,49 @@ module ActiveRecord
|
|
1041
1127
|
[]
|
1042
1128
|
end
|
1043
1129
|
|
1130
|
+
# See HasManyAssociation#delete_records. Dependent associations
|
1131
|
+
# delete children, otherwise foreign key is set to NULL.
|
1044
1132
|
def configure_dependency_for_has_many(reflection)
|
1045
|
-
if reflection.options
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
if reflection.options[:as]
|
1064
|
-
dependent_conditions += " AND #{reflection.options[:as]}_type = '#{base_class.name}'"
|
1065
|
-
end
|
1066
|
-
|
1067
|
-
case reflection.options[:dependent]
|
1068
|
-
when :destroy, true
|
1069
|
-
module_eval "before_destroy '#{reflection.name}.each { |o| o.destroy }'"
|
1070
|
-
when :delete_all
|
1071
|
-
module_eval "before_destroy { |record| #{reflection.class_name}.delete_all(%(#{dependent_conditions})) }"
|
1072
|
-
when :nullify
|
1073
|
-
module_eval "before_destroy { |record| #{reflection.class_name}.update_all(%(#{reflection.primary_key_name} = NULL), %(#{dependent_conditions})) }"
|
1074
|
-
when nil, false
|
1075
|
-
# pass
|
1076
|
-
else
|
1077
|
-
raise ArgumentError, 'The :dependent option expects either :destroy, :delete_all, or :nullify'
|
1133
|
+
if reflection.options.include?(:dependent)
|
1134
|
+
# Add polymorphic type if the :as option is present
|
1135
|
+
dependent_conditions = []
|
1136
|
+
dependent_conditions << "#{reflection.primary_key_name} = \#{record.quoted_id}"
|
1137
|
+
dependent_conditions << "#{reflection.options[:as]}_type = '#{base_class.name}'" if reflection.options[:as]
|
1138
|
+
dependent_conditions << sanitize_sql(reflection.options[:conditions]) if reflection.options[:conditions]
|
1139
|
+
dependent_conditions = dependent_conditions.collect {|where| "(#{where})" }.join(" AND ")
|
1140
|
+
|
1141
|
+
case reflection.options[:dependent]
|
1142
|
+
when :destroy
|
1143
|
+
module_eval "before_destroy '#{reflection.name}.each { |o| o.destroy }'"
|
1144
|
+
when :delete_all
|
1145
|
+
module_eval "before_destroy { |record| #{reflection.class_name}.delete_all(%(#{dependent_conditions})) }"
|
1146
|
+
when :nullify
|
1147
|
+
module_eval "before_destroy { |record| #{reflection.class_name}.update_all(%(#{reflection.primary_key_name} = NULL), %(#{dependent_conditions})) }"
|
1148
|
+
else
|
1149
|
+
raise ArgumentError, "The :dependent option expects either :destroy, :delete_all, or :nullify (#{reflection.options[:dependent].inspect})"
|
1150
|
+
end
|
1078
1151
|
end
|
1079
1152
|
end
|
1080
1153
|
|
1081
1154
|
def configure_dependency_for_has_one(reflection)
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1155
|
+
if reflection.options.include?(:dependent)
|
1156
|
+
case reflection.options[:dependent]
|
1157
|
+
when :destroy
|
1158
|
+
module_eval "before_destroy '#{reflection.name}.destroy unless #{reflection.name}.nil?'"
|
1159
|
+
when :delete
|
1160
|
+
module_eval "before_destroy '#{reflection.class_name}.delete(#{reflection.name}.id) unless #{reflection.name}.nil?'"
|
1161
|
+
when :nullify
|
1162
|
+
module_eval "before_destroy '#{reflection.name}.update_attribute(\"#{reflection.primary_key_name}\", nil) unless #{reflection.name}.nil?'"
|
1163
|
+
else
|
1164
|
+
raise ArgumentError, "The :dependent option expects either :destroy, :delete or :nullify (#{reflection.options[:dependent].inspect})"
|
1165
|
+
end
|
1093
1166
|
end
|
1094
1167
|
end
|
1095
|
-
|
1096
|
-
|
1097
|
-
def add_deprecated_api_for_has_many(association_name)
|
1098
|
-
deprecated_collection_count_method(association_name)
|
1099
|
-
deprecated_add_association_relation(association_name)
|
1100
|
-
deprecated_remove_association_relation(association_name)
|
1101
|
-
deprecated_has_collection_method(association_name)
|
1102
|
-
deprecated_find_in_collection_method(association_name)
|
1103
|
-
deprecated_find_all_in_collection_method(association_name)
|
1104
|
-
deprecated_collection_create_method(association_name)
|
1105
|
-
deprecated_collection_build_method(association_name)
|
1106
|
-
end
|
1107
1168
|
|
1108
1169
|
def create_has_many_reflection(association_id, options, &extension)
|
1109
1170
|
options.assert_valid_keys(
|
1110
1171
|
:class_name, :table_name, :foreign_key,
|
1111
|
-
:
|
1172
|
+
:dependent,
|
1112
1173
|
:select, :conditions, :include, :order, :group, :limit, :offset,
|
1113
1174
|
:as, :through, :source, :source_type,
|
1114
1175
|
:uniq,
|
@@ -1117,7 +1178,7 @@ module ActiveRecord
|
|
1117
1178
|
:extend
|
1118
1179
|
)
|
1119
1180
|
|
1120
|
-
options[:extend] =
|
1181
|
+
options[:extend] = create_extension_modules(association_id, extension, options[:extend]) if block_given?
|
1121
1182
|
|
1122
1183
|
create_reflection(:has_many, association_id, options, self)
|
1123
1184
|
end
|
@@ -1155,7 +1216,7 @@ module ActiveRecord
|
|
1155
1216
|
:extend
|
1156
1217
|
)
|
1157
1218
|
|
1158
|
-
options[:extend] =
|
1219
|
+
options[:extend] = create_extension_modules(association_id, extension, options[:extend]) if block_given?
|
1159
1220
|
|
1160
1221
|
reflection = create_reflection(:has_and_belongs_to_many, association_id, options, self)
|
1161
1222
|
|
@@ -1186,15 +1247,14 @@ module ActiveRecord
|
|
1186
1247
|
|
1187
1248
|
def construct_finder_sql_with_included_associations(options, join_dependency)
|
1188
1249
|
scope = scope(:find)
|
1189
|
-
sql = "SELECT #{column_aliases(join_dependency)} FROM #{(scope && scope[:from]) || options[:from] ||
|
1250
|
+
sql = "SELECT #{column_aliases(join_dependency)} FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} "
|
1190
1251
|
sql << join_dependency.join_associations.collect{|join| join.association_join }.join
|
1191
1252
|
|
1192
1253
|
add_joins!(sql, options, scope)
|
1193
1254
|
add_conditions!(sql, options[:conditions], scope)
|
1194
1255
|
add_limited_ids_condition!(sql, options, join_dependency) if !using_limitable_reflections?(join_dependency.reflections) && ((scope && scope[:limit]) || options[:limit])
|
1195
1256
|
|
1196
|
-
sql
|
1197
|
-
|
1257
|
+
add_group!(sql, options[:group], scope)
|
1198
1258
|
add_order!(sql, options[:order], scope)
|
1199
1259
|
add_limit!(sql, options, scope) if using_limitable_reflections?(join_dependency.reflections)
|
1200
1260
|
add_lock!(sql, options, scope)
|
@@ -1204,29 +1264,31 @@ module ActiveRecord
|
|
1204
1264
|
|
1205
1265
|
def add_limited_ids_condition!(sql, options, join_dependency)
|
1206
1266
|
unless (id_list = select_limited_ids_list(options, join_dependency)).empty?
|
1207
|
-
sql << "#{condition_word(sql)} #{table_name}.#{primary_key} IN (#{id_list}) "
|
1267
|
+
sql << "#{condition_word(sql)} #{connection.quote_table_name table_name}.#{primary_key} IN (#{id_list}) "
|
1208
1268
|
else
|
1209
1269
|
throw :invalid_query
|
1210
1270
|
end
|
1211
1271
|
end
|
1212
|
-
|
1272
|
+
|
1213
1273
|
def select_limited_ids_list(options, join_dependency)
|
1274
|
+
pk = columns_hash[primary_key]
|
1275
|
+
|
1214
1276
|
connection.select_all(
|
1215
1277
|
construct_finder_sql_for_association_limiting(options, join_dependency),
|
1216
1278
|
"#{name} Load IDs For Limited Eager Loading"
|
1217
|
-
).collect { |row| connection.quote(row[primary_key]) }.join(", ")
|
1279
|
+
).collect { |row| connection.quote(row[primary_key], pk) }.join(", ")
|
1218
1280
|
end
|
1219
1281
|
|
1220
1282
|
def construct_finder_sql_for_association_limiting(options, join_dependency)
|
1221
1283
|
scope = scope(:find)
|
1222
|
-
is_distinct = include_eager_conditions?(options) || include_eager_order?(options)
|
1284
|
+
is_distinct = !options[:joins].blank? || include_eager_conditions?(options) || include_eager_order?(options)
|
1223
1285
|
sql = "SELECT "
|
1224
1286
|
if is_distinct
|
1225
|
-
sql << connection.distinct("#{table_name}.#{primary_key}", options[:order])
|
1287
|
+
sql << connection.distinct("#{connection.quote_table_name table_name}.#{primary_key}", options[:order])
|
1226
1288
|
else
|
1227
1289
|
sql << primary_key
|
1228
1290
|
end
|
1229
|
-
sql << " FROM #{table_name} "
|
1291
|
+
sql << " FROM #{connection.quote_table_name table_name} "
|
1230
1292
|
|
1231
1293
|
if is_distinct
|
1232
1294
|
sql << join_dependency.join_associations.collect(&:association_join).join
|
@@ -1234,14 +1296,16 @@ module ActiveRecord
|
|
1234
1296
|
end
|
1235
1297
|
|
1236
1298
|
add_conditions!(sql, options[:conditions], scope)
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1299
|
+
add_group!(sql, options[:group], scope)
|
1300
|
+
|
1301
|
+
if options[:order] && is_distinct
|
1302
|
+
connection.add_order_by_for_association_limiting!(sql, options)
|
1303
|
+
else
|
1304
|
+
add_order!(sql, options[:order], scope)
|
1243
1305
|
end
|
1306
|
+
|
1244
1307
|
add_limit!(sql, options, scope)
|
1308
|
+
|
1245
1309
|
return sanitize_sql(sql)
|
1246
1310
|
end
|
1247
1311
|
|
@@ -1276,7 +1340,7 @@ module ActiveRecord
|
|
1276
1340
|
|
1277
1341
|
def column_aliases(join_dependency)
|
1278
1342
|
join_dependency.joins.collect{|join| join.column_names_with_alias.collect{|column_name, aliased_name|
|
1279
|
-
"#{join.aliased_table_name}.#{connection.quote_column_name column_name} AS #{aliased_name}"}}.flatten.join(", ")
|
1343
|
+
"#{connection.quote_table_name join.aliased_table_name}.#{connection.quote_column_name column_name} AS #{aliased_name}"}}.flatten.join(", ")
|
1280
1344
|
end
|
1281
1345
|
|
1282
1346
|
def add_association_callbacks(association_name, options)
|
@@ -1286,7 +1350,9 @@ module ActiveRecord
|
|
1286
1350
|
defined_callbacks = options[callback_name.to_sym]
|
1287
1351
|
if options.has_key?(callback_name.to_sym)
|
1288
1352
|
class_inheritable_reader full_callback_name.to_sym
|
1289
|
-
|
1353
|
+
write_inheritable_attribute(full_callback_name.to_sym, [defined_callbacks].flatten)
|
1354
|
+
else
|
1355
|
+
write_inheritable_attribute(full_callback_name.to_sym, [])
|
1290
1356
|
end
|
1291
1357
|
end
|
1292
1358
|
end
|
@@ -1295,14 +1361,14 @@ module ActiveRecord
|
|
1295
1361
|
sql =~ /where/i ? " AND " : "WHERE "
|
1296
1362
|
end
|
1297
1363
|
|
1298
|
-
def
|
1364
|
+
def create_extension_modules(association_id, block_extension, extensions)
|
1299
1365
|
extension_module_name = "#{self.to_s}#{association_id.to_s.camelize}AssociationExtension"
|
1300
1366
|
|
1301
1367
|
silence_warnings do
|
1302
|
-
Object.const_set(extension_module_name, Module.new(&
|
1368
|
+
Object.const_set(extension_module_name, Module.new(&block_extension))
|
1303
1369
|
end
|
1304
|
-
|
1305
|
-
extension_module_name.constantize
|
1370
|
+
|
1371
|
+
Array(extensions).push(extension_module_name.constantize)
|
1306
1372
|
end
|
1307
1373
|
|
1308
1374
|
class JoinDependency # :nodoc:
|
@@ -1335,11 +1401,34 @@ module ActiveRecord
|
|
1335
1401
|
end
|
1336
1402
|
construct(@base_records_hash[primary_id], @associations, join_associations.dup, row)
|
1337
1403
|
end
|
1404
|
+
remove_duplicate_results!(join_base.active_record, @base_records_in_order, @associations)
|
1338
1405
|
return @base_records_in_order
|
1339
1406
|
end
|
1340
1407
|
|
1341
|
-
def
|
1342
|
-
|
1408
|
+
def remove_duplicate_results!(base, records, associations)
|
1409
|
+
case associations
|
1410
|
+
when Symbol, String
|
1411
|
+
reflection = base.reflections[associations]
|
1412
|
+
if reflection && [:has_many, :has_and_belongs_to_many].include?(reflection.macro)
|
1413
|
+
records.each { |record| record.send(reflection.name).target.uniq! }
|
1414
|
+
end
|
1415
|
+
when Array
|
1416
|
+
associations.each do |association|
|
1417
|
+
remove_duplicate_results!(base, records, association)
|
1418
|
+
end
|
1419
|
+
when Hash
|
1420
|
+
associations.keys.each do |name|
|
1421
|
+
reflection = base.reflections[name]
|
1422
|
+
is_collection = [:has_many, :has_and_belongs_to_many].include?(reflection.macro)
|
1423
|
+
|
1424
|
+
parent_records = records.map do |record|
|
1425
|
+
next unless record.send(reflection.name)
|
1426
|
+
is_collection ? record.send(reflection.name).target.uniq! : record.send(reflection.name)
|
1427
|
+
end.flatten.compact
|
1428
|
+
|
1429
|
+
remove_duplicate_results!(reflection.class_name.constantize, parent_records, associations[name]) unless parent_records.empty?
|
1430
|
+
end
|
1431
|
+
end
|
1343
1432
|
end
|
1344
1433
|
|
1345
1434
|
protected
|
@@ -1350,7 +1439,7 @@ module ActiveRecord
|
|
1350
1439
|
reflection = parent.reflections[associations.to_s.intern] or
|
1351
1440
|
raise ConfigurationError, "Association named '#{ associations }' was not found; perhaps you misspelled it?"
|
1352
1441
|
@reflections << reflection
|
1353
|
-
@joins <<
|
1442
|
+
@joins << build_join_association(reflection, parent)
|
1354
1443
|
when Array
|
1355
1444
|
associations.each do |association|
|
1356
1445
|
build(association, parent)
|
@@ -1365,6 +1454,11 @@ module ActiveRecord
|
|
1365
1454
|
end
|
1366
1455
|
end
|
1367
1456
|
|
1457
|
+
# overridden in InnerJoinDependency subclass
|
1458
|
+
def build_join_association(reflection, parent)
|
1459
|
+
JoinAssociation.new(reflection, self, parent)
|
1460
|
+
end
|
1461
|
+
|
1368
1462
|
def construct(parent, associations, joins, row)
|
1369
1463
|
case associations
|
1370
1464
|
when Symbol, String
|
@@ -1394,7 +1488,7 @@ module ActiveRecord
|
|
1394
1488
|
|
1395
1489
|
return nil if record.id.to_s != join.parent.record_id(row).to_s or row[join.aliased_primary_key].nil?
|
1396
1490
|
association = join.instantiate(row)
|
1397
|
-
collection.target.push(association)
|
1491
|
+
collection.target.push(association)
|
1398
1492
|
when :has_one
|
1399
1493
|
return if record.id.to_s != join.parent.record_id(row).to_s
|
1400
1494
|
association = join.instantiate(row) unless row[join.aliased_primary_key].nil?
|
@@ -1450,7 +1544,7 @@ module ActiveRecord
|
|
1450
1544
|
end
|
1451
1545
|
|
1452
1546
|
def instantiate(row)
|
1453
|
-
@cached_record[record_id(row)] ||= active_record.instantiate
|
1547
|
+
@cached_record[record_id(row)] ||= active_record.send(:instantiate, extract_record(row))
|
1454
1548
|
end
|
1455
1549
|
end
|
1456
1550
|
|
@@ -1499,53 +1593,60 @@ module ActiveRecord
|
|
1499
1593
|
end
|
1500
1594
|
|
1501
1595
|
def association_join
|
1596
|
+
connection = reflection.active_record.connection
|
1502
1597
|
join = case reflection.macro
|
1503
1598
|
when :has_and_belongs_to_many
|
1504
|
-
"
|
1599
|
+
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1505
1600
|
table_alias_for(options[:join_table], aliased_join_table_name),
|
1506
|
-
aliased_join_table_name,
|
1507
|
-
options[:foreign_key] || reflection.active_record.to_s.
|
1508
|
-
parent.aliased_table_name,
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1601
|
+
connection.quote_table_name(aliased_join_table_name),
|
1602
|
+
options[:foreign_key] || reflection.active_record.to_s.foreign_key,
|
1603
|
+
connection.quote_table_name(parent.aliased_table_name),
|
1604
|
+
reflection.active_record.primary_key] +
|
1605
|
+
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1606
|
+
table_name_and_alias,
|
1607
|
+
connection.quote_table_name(aliased_table_name),
|
1608
|
+
klass.primary_key,
|
1609
|
+
connection.quote_table_name(aliased_join_table_name),
|
1610
|
+
options[:association_foreign_key] || klass.to_s.foreign_key
|
1512
1611
|
]
|
1513
1612
|
when :has_many, :has_one
|
1514
1613
|
case
|
1515
1614
|
when reflection.macro == :has_many && reflection.options[:through]
|
1516
1615
|
through_conditions = through_reflection.options[:conditions] ? "AND #{interpolate_sql(sanitize_sql(through_reflection.options[:conditions]))}" : ''
|
1517
|
-
|
1518
|
-
jt_foreign_key = jt_as_extra = jt_source_extra = jt_sti_extra = nil
|
1519
|
-
first_key = second_key = as_extra = nil
|
1616
|
+
|
1617
|
+
jt_foreign_key = jt_as_extra = jt_source_extra = jt_sti_extra = nil
|
1618
|
+
first_key = second_key = as_extra = nil
|
1520
1619
|
|
1521
1620
|
if through_reflection.options[:as] # has_many :through against a polymorphic join
|
1522
1621
|
jt_foreign_key = through_reflection.options[:as].to_s + '_id'
|
1523
1622
|
jt_as_extra = " AND %s.%s = %s" % [
|
1524
|
-
|
1525
|
-
|
1623
|
+
connection.quote_table_name(aliased_join_table_name),
|
1624
|
+
connection.quote_column_name(through_reflection.options[:as].to_s + '_type'),
|
1625
|
+
klass.quote_value(parent.active_record.base_class.name)
|
1526
1626
|
]
|
1527
1627
|
else
|
1528
|
-
jt_foreign_key = through_reflection.primary_key_name
|
1628
|
+
jt_foreign_key = through_reflection.primary_key_name
|
1529
1629
|
end
|
1530
|
-
|
1630
|
+
|
1531
1631
|
case source_reflection.macro
|
1532
1632
|
when :has_many
|
1533
|
-
if source_reflection.options[:as]
|
1534
|
-
first_key = "#{source_reflection.options[:as]}_id"
|
1535
|
-
second_key = options[:foreign_key] || primary_key
|
1633
|
+
if source_reflection.options[:as]
|
1634
|
+
first_key = "#{source_reflection.options[:as]}_id"
|
1635
|
+
second_key = options[:foreign_key] || primary_key
|
1536
1636
|
as_extra = " AND %s.%s = %s" % [
|
1537
|
-
|
1538
|
-
|
1637
|
+
connection.quote_table_name(aliased_table_name),
|
1638
|
+
connection.quote_column_name("#{source_reflection.options[:as]}_type"),
|
1639
|
+
klass.quote_value(source_reflection.active_record.base_class.name)
|
1539
1640
|
]
|
1540
1641
|
else
|
1541
|
-
first_key = through_reflection.klass.base_class.to_s.
|
1642
|
+
first_key = through_reflection.klass.base_class.to_s.foreign_key
|
1542
1643
|
second_key = options[:foreign_key] || primary_key
|
1543
1644
|
end
|
1544
1645
|
|
1545
1646
|
unless through_reflection.klass.descends_from_active_record?
|
1546
1647
|
jt_sti_extra = " AND %s.%s = %s" % [
|
1547
|
-
aliased_join_table_name,
|
1548
|
-
|
1648
|
+
connection.quote_table_name(aliased_join_table_name),
|
1649
|
+
connection.quote_column_name(through_reflection.active_record.inheritance_column),
|
1549
1650
|
through_reflection.klass.quote_value(through_reflection.klass.name.demodulize)]
|
1550
1651
|
end
|
1551
1652
|
when :belongs_to
|
@@ -1553,62 +1654,67 @@ module ActiveRecord
|
|
1553
1654
|
if reflection.options[:source_type]
|
1554
1655
|
second_key = source_reflection.association_foreign_key
|
1555
1656
|
jt_source_extra = " AND %s.%s = %s" % [
|
1556
|
-
|
1557
|
-
|
1657
|
+
connection.quote_table_name(aliased_join_table_name),
|
1658
|
+
connection.quote_column_name(reflection.source_reflection.options[:foreign_type]),
|
1659
|
+
klass.quote_value(reflection.options[:source_type])
|
1558
1660
|
]
|
1559
1661
|
else
|
1560
|
-
second_key = source_reflection.
|
1662
|
+
second_key = source_reflection.primary_key_name
|
1561
1663
|
end
|
1562
1664
|
end
|
1563
|
-
|
1564
|
-
"
|
1665
|
+
|
1666
|
+
" #{join_type} %s ON (%s.%s = %s.%s%s%s%s) " % [
|
1565
1667
|
table_alias_for(through_reflection.klass.table_name, aliased_join_table_name),
|
1566
|
-
|
1567
|
-
|
1668
|
+
connection.quote_table_name(parent.aliased_table_name),
|
1669
|
+
connection.quote_column_name(parent.primary_key),
|
1670
|
+
connection.quote_table_name(aliased_join_table_name),
|
1671
|
+
connection.quote_column_name(jt_foreign_key),
|
1568
1672
|
jt_as_extra, jt_source_extra, jt_sti_extra
|
1569
1673
|
] +
|
1570
|
-
"
|
1674
|
+
" #{join_type} %s ON (%s.%s = %s.%s%s) " % [
|
1571
1675
|
table_name_and_alias,
|
1572
|
-
|
1573
|
-
|
1676
|
+
connection.quote_table_name(aliased_table_name),
|
1677
|
+
connection.quote_column_name(first_key),
|
1678
|
+
connection.quote_table_name(aliased_join_table_name),
|
1679
|
+
connection.quote_column_name(second_key),
|
1574
1680
|
as_extra
|
1575
1681
|
]
|
1576
|
-
|
1577
|
-
when reflection.
|
1578
|
-
"
|
1682
|
+
|
1683
|
+
when reflection.options[:as] && [:has_many, :has_one].include?(reflection.macro)
|
1684
|
+
" #{join_type} %s ON %s.%s = %s.%s AND %s.%s = %s" % [
|
1579
1685
|
table_name_and_alias,
|
1580
|
-
aliased_table_name,
|
1581
|
-
|
1582
|
-
aliased_table_name,
|
1686
|
+
connection.quote_table_name(aliased_table_name),
|
1687
|
+
"#{reflection.options[:as]}_id",
|
1688
|
+
connection.quote_table_name(parent.aliased_table_name),
|
1689
|
+
parent.primary_key,
|
1690
|
+
connection.quote_table_name(aliased_table_name),
|
1691
|
+
"#{reflection.options[:as]}_type",
|
1583
1692
|
klass.quote_value(parent.active_record.base_class.name)
|
1584
1693
|
]
|
1585
|
-
when reflection.macro == :has_one && reflection.options[:as]
|
1586
|
-
" LEFT OUTER JOIN %s ON %s.%s = %s.%s AND %s.%s = %s " % [
|
1587
|
-
table_name_and_alias,
|
1588
|
-
aliased_table_name, "#{reflection.options[:as]}_id",
|
1589
|
-
parent.aliased_table_name, parent.primary_key,
|
1590
|
-
aliased_table_name, "#{reflection.options[:as]}_type",
|
1591
|
-
klass.quote_value(reflection.active_record.base_class.name)
|
1592
|
-
]
|
1593
1694
|
else
|
1594
1695
|
foreign_key = options[:foreign_key] || reflection.active_record.name.foreign_key
|
1595
|
-
"
|
1696
|
+
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1596
1697
|
table_name_and_alias,
|
1597
|
-
aliased_table_name,
|
1598
|
-
|
1698
|
+
aliased_table_name,
|
1699
|
+
foreign_key,
|
1700
|
+
parent.aliased_table_name,
|
1701
|
+
parent.primary_key
|
1599
1702
|
]
|
1600
1703
|
end
|
1601
1704
|
when :belongs_to
|
1602
|
-
"
|
1603
|
-
table_name_and_alias,
|
1604
|
-
|
1705
|
+
" #{join_type} %s ON %s.%s = %s.%s " % [
|
1706
|
+
table_name_and_alias,
|
1707
|
+
connection.quote_table_name(aliased_table_name),
|
1708
|
+
reflection.klass.primary_key,
|
1709
|
+
connection.quote_table_name(parent.aliased_table_name),
|
1710
|
+
options[:foreign_key] || klass.to_s.foreign_key
|
1605
1711
|
]
|
1606
1712
|
else
|
1607
1713
|
""
|
1608
1714
|
end || ''
|
1609
1715
|
join << %(AND %s.%s = %s ) % [
|
1610
|
-
aliased_table_name,
|
1611
|
-
|
1716
|
+
connection.quote_table_name(aliased_table_name),
|
1717
|
+
connection.quote_column_name(klass.inheritance_column),
|
1612
1718
|
klass.quote_value(klass.name.demodulize)] unless klass.descends_from_active_record?
|
1613
1719
|
|
1614
1720
|
[through_reflection, reflection].each do |ref|
|
@@ -1625,7 +1731,7 @@ module ActiveRecord
|
|
1625
1731
|
end
|
1626
1732
|
|
1627
1733
|
def table_alias_for(table_name, table_alias)
|
1628
|
-
|
1734
|
+
"#{reflection.active_record.connection.quote_table_name(table_name)} #{table_alias if table_name != table_alias}".strip
|
1629
1735
|
end
|
1630
1736
|
|
1631
1737
|
def table_name_and_alias
|
@@ -1635,8 +1741,29 @@ module ActiveRecord
|
|
1635
1741
|
def interpolate_sql(sql)
|
1636
1742
|
instance_eval("%@#{sql.gsub('@', '\@')}@")
|
1637
1743
|
end
|
1744
|
+
|
1745
|
+
private
|
1746
|
+
|
1747
|
+
def join_type
|
1748
|
+
"LEFT OUTER JOIN"
|
1749
|
+
end
|
1638
1750
|
end
|
1639
1751
|
end
|
1752
|
+
|
1753
|
+
class InnerJoinDependency < JoinDependency # :nodoc:
|
1754
|
+
protected
|
1755
|
+
def build_join_association(reflection, parent)
|
1756
|
+
InnerJoinAssociation.new(reflection, self, parent)
|
1757
|
+
end
|
1758
|
+
|
1759
|
+
class InnerJoinAssociation < JoinAssociation
|
1760
|
+
private
|
1761
|
+
def join_type
|
1762
|
+
"INNER JOIN"
|
1763
|
+
end
|
1764
|
+
end
|
1765
|
+
end
|
1766
|
+
|
1640
1767
|
end
|
1641
1768
|
end
|
1642
1769
|
end
|