radiant 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +295 -195
- data/CONTRIBUTORS +14 -2
- data/INSTALL +0 -0
- data/LICENSE +0 -0
- data/README +0 -0
- data/Rakefile +0 -0
- data/app/controllers/admin/export_controller.rb +0 -0
- data/app/controllers/admin/extensions_controller.rb +6 -0
- data/app/controllers/admin/layouts_controller.rb +4 -0
- data/app/controllers/admin/page_parts_controller.rb +1 -1
- data/app/controllers/admin/pages_controller.rb +13 -5
- data/app/controllers/admin/preferences_controller.rb +1 -1
- data/app/controllers/admin/references_controller.rb +0 -0
- data/app/controllers/admin/resource_controller.rb +12 -14
- data/app/controllers/admin/snippets_controller.rb +3 -0
- data/app/controllers/admin/users_controller.rb +4 -0
- data/app/controllers/admin/welcome_controller.rb +2 -2
- data/app/controllers/{application.rb → application_controller.rb} +13 -1
- data/app/controllers/site_controller.rb +21 -21
- data/app/helpers/admin/abstract_model_helper.rb +0 -0
- data/app/helpers/admin/export_helper.rb +0 -0
- data/app/helpers/admin/extensions_helper.rb +0 -0
- data/app/helpers/admin/layouts_helper.rb +0 -0
- data/app/helpers/admin/node_helper.rb +0 -0
- data/app/helpers/admin/pages_helper.rb +1 -1
- data/app/helpers/admin/preferences_helper.rb +0 -0
- data/app/helpers/admin/references_helper.rb +1 -1
- data/app/helpers/admin/regions_helper.rb +8 -8
- data/app/helpers/admin/snippets_helper.rb +0 -0
- data/app/helpers/admin/users_helper.rb +0 -0
- data/app/helpers/admin/welcome_helper.rb +0 -0
- data/app/helpers/application_helper.rb +1 -1
- data/app/helpers/site_helper.rb +0 -0
- data/app/models/env_dump_page.rb +0 -0
- data/app/models/file_not_found_page.rb +3 -3
- data/app/models/layout.rb +2 -2
- data/app/models/page.rb +59 -78
- data/app/models/page_context.rb +0 -0
- data/app/models/page_part.rb +3 -3
- data/app/models/radiant/config.rb +23 -23
- data/app/models/radiant/exporter.rb +0 -0
- data/app/models/snippet.rb +3 -3
- data/app/models/standard_tags.rb +11 -2
- data/app/models/status.rb +0 -0
- data/app/models/text_filter.rb +0 -0
- data/app/models/user.rb +14 -5
- data/app/models/user_action_observer.rb +0 -0
- data/app/views/admin/extensions/index.html.haml +0 -0
- data/app/views/admin/layouts/_form.html.haml +0 -0
- data/app/views/admin/layouts/edit.html.haml +0 -0
- data/app/views/admin/layouts/index.html.haml +0 -0
- data/app/views/admin/layouts/new.html.haml +0 -0
- data/app/views/admin/layouts/remove.html.haml +0 -0
- data/app/views/admin/page_parts/_page_part.html.haml +5 -3
- data/app/views/admin/pages/_edit_styles.html.haml +0 -0
- data/app/views/admin/pages/_fields.html.haml +0 -0
- data/app/views/admin/pages/_meta_row.html.haml +0 -0
- data/app/views/admin/pages/_node.html.haml +0 -0
- data/app/views/admin/pages/_popups.html.haml +2 -1
- data/app/views/admin/pages/children.html.haml +0 -0
- data/app/views/admin/pages/edit.html.haml +0 -0
- data/app/views/admin/pages/index.html.haml +0 -0
- data/app/views/admin/pages/new.html.haml +0 -0
- data/app/views/admin/pages/remove.html.haml +0 -0
- data/app/views/admin/preferences/edit.html.haml +0 -0
- data/app/views/admin/references/_tag_reference.haml +0 -0
- data/app/views/admin/references/filters.js.erb +0 -0
- data/app/views/admin/references/tags.js.erb +0 -0
- data/app/views/admin/snippets/_form.html.haml +0 -0
- data/app/views/admin/snippets/edit.html.haml +0 -0
- data/app/views/admin/snippets/index.html.haml +0 -0
- data/app/views/admin/snippets/new.html.haml +0 -0
- data/app/views/admin/snippets/remove.html.haml +0 -0
- data/app/views/admin/users/_form.html.haml +0 -0
- data/app/views/admin/users/edit.html.haml +0 -0
- data/app/views/admin/users/index.html.haml +0 -0
- data/app/views/admin/users/new.html.haml +0 -0
- data/app/views/admin/users/remove.html.haml +0 -0
- data/app/views/admin/welcome/login.html.haml +0 -0
- data/app/views/layouts/application.html.haml +0 -0
- data/app/views/site/not_found.html.haml +0 -0
- data/config/boot.rb +5 -4
- data/config/database.mysql.yml +0 -0
- data/config/database.postgresql.yml +0 -0
- data/config/database.sqlite.yml +1 -1
- data/config/database.sqlserver.yml +0 -0
- data/config/environment.rb +30 -43
- data/config/environments/development.rb +1 -2
- data/config/environments/production.rb +0 -1
- data/config/environments/test.rb +6 -2
- data/config/routes.rb +0 -0
- data/db/migrate/001_create_radiant_tables.rb +0 -0
- data/db/migrate/002_insert_initial_data.rb +0 -0
- data/db/migrate/003_rename_behavior_column.rb +0 -0
- data/db/migrate/004_rename_filter_column.rb +0 -0
- data/db/migrate/005_add_virtual_column_to_page.rb +0 -0
- data/db/migrate/006_integer_columns_to_boolean.rb +0 -0
- data/db/migrate/007_remove_virtual_column_from_page.rb +0 -0
- data/db/migrate/008_add_virtual_column_to_page_again.rb +0 -0
- data/db/migrate/009_add_content_type_field_to_layout.rb +0 -0
- data/db/migrate/010_merge_behaviors_and_pages.rb +0 -0
- data/db/migrate/011_rename_type_column_on_page_to_class_name.rb +0 -0
- data/db/migrate/012_create_extension_meta.rb +0 -0
- data/db/migrate/013_add_notes_field_to_user.rb +0 -0
- data/db/migrate/014_rename_config_default_parts_key.rb +0 -0
- data/db/migrate/015_add_optimistic_locking.rb +0 -0
- data/db/migrate/016_add_sessions.rb +0 -0
- data/db/migrate/017_rename_created_by_updated_by_columns.rb +0 -0
- data/db/migrate/018_add_description_and_keywords_to_pages.rb +0 -0
- data/db/migrate/019_add_salt_to_users.rb +0 -0
- data/db/migrate/020_add_session_info_to_users.rb +0 -0
- data/db/migrate/021_remove_session_expire_from_users.rb +0 -0
- data/db/migrate/20081203140407_add_indexes.rb +0 -0
- data/db/schema.rb +1 -1
- data/db/templates/empty.yml +0 -0
- data/db/templates/roasters.yml +0 -0
- data/db/templates/simple-blog.yml +0 -0
- data/db/templates/styled-blog.yml +0 -0
- data/features/admin/content_negotiation.feature +24 -0
- data/features/admin/layouts_management.feature +10 -0
- data/features/admin/pages_management.feature +71 -0
- data/features/admin/snippets_management.feature +54 -0
- data/features/admin/user_permissions.feature +149 -0
- data/features/admin/user_preferences.feature +18 -0
- data/features/admin/users_management.feature +63 -0
- data/features/page_serving.feature +42 -0
- data/features/step_definitions/admin/admin_steps.rb +31 -0
- data/features/step_definitions/admin/content_negotiation_steps.rb +37 -0
- data/features/step_definitions/admin/pages_management_steps.rb +14 -0
- data/features/step_definitions/admin/users_management_steps.rb +12 -0
- data/features/step_definitions/page_serving_steps.rb +65 -0
- data/features/step_definitions/webrat_steps.rb +117 -0
- data/features/support/env.rb +23 -0
- data/features/support/paths.rb +14 -0
- data/lib/annotatable.rb +0 -0
- data/lib/autotest/discover.rb +0 -0
- data/lib/autotest/radiant_rails_rspec.rb +0 -0
- data/lib/generators/extension/USAGE +0 -0
- data/lib/generators/extension/extension_generator.rb +0 -0
- data/lib/generators/extension/templates/README +0 -0
- data/lib/generators/extension/templates/RSpecRakefile +0 -0
- data/lib/generators/extension/templates/extension.rb +0 -0
- data/lib/generators/extension/templates/functional_test.rb +0 -0
- data/lib/generators/extension/templates/migration.rb +0 -0
- data/lib/generators/extension/templates/spec.opts +0 -0
- data/lib/generators/extension/templates/spec_helper.rb +0 -0
- data/lib/generators/extension/templates/tasks.rake +2 -2
- data/lib/generators/extension/templates/test_helper.rb +0 -0
- data/lib/generators/extension_controller/USAGE +0 -0
- data/lib/generators/extension_controller/extension_controller_generator.rb +0 -0
- data/lib/generators/extension_controller/templates/controller.rb +0 -0
- data/lib/generators/extension_controller/templates/controller_spec.rb +0 -0
- data/lib/generators/extension_controller/templates/functional_test.rb +0 -0
- data/lib/generators/extension_controller/templates/helper.rb +0 -0
- data/lib/generators/extension_controller/templates/helper_spec.rb +0 -0
- data/lib/generators/extension_controller/templates/helper_test.rb +4 -0
- data/lib/generators/extension_controller/templates/view.html.erb +0 -0
- data/lib/generators/extension_controller/templates/view_spec.rb +0 -0
- data/lib/generators/extension_mailer/USAGE +0 -0
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +0 -0
- data/lib/generators/extension_mailer/templates/fixture.erb +0 -0
- data/lib/generators/extension_mailer/templates/mailer.rb +0 -0
- data/lib/generators/extension_mailer/templates/unit_test.rb +0 -0
- data/lib/generators/extension_mailer/templates/view.erb +0 -0
- data/lib/generators/extension_migration/USAGE +0 -0
- data/lib/generators/extension_migration/extension_migration_generator.rb +0 -0
- data/lib/generators/extension_migration/templates/migration.rb +0 -0
- data/lib/generators/extension_model/USAGE +0 -0
- data/lib/generators/extension_model/extension_model_generator.rb +0 -0
- data/lib/generators/extension_model/templates/fixtures.yml +0 -0
- data/lib/generators/extension_model/templates/migration.rb +0 -0
- data/lib/generators/extension_model/templates/model.rb +0 -0
- data/lib/generators/extension_model/templates/model_spec.rb +0 -0
- data/lib/generators/extension_model/templates/unit_test.rb +0 -0
- data/lib/generators/generator_base_extension.rb +0 -0
- data/lib/generators/instance/instance_generator.rb +0 -0
- data/lib/generators/instance/templates/databases/mysql.yml +0 -0
- data/lib/generators/instance/templates/databases/postgresql.yml +0 -0
- data/lib/generators/instance/templates/databases/sqlite3.yml +0 -0
- data/lib/generators/instance/templates/databases/sqlserver.yml +0 -0
- data/lib/generators/instance/templates/instance_boot.rb +1 -4
- data/lib/generators/instance/templates/instance_environment.rb +36 -44
- data/lib/generators/instance/templates/instance_generate +0 -0
- data/lib/generators/instance/templates/instance_rakefile +0 -0
- data/lib/generators/instance/templates/instance_routes.rb +0 -0
- data/lib/inheritable_class_attributes.rb +0 -0
- data/lib/local_time.rb +0 -0
- data/lib/login_system.rb +59 -40
- data/lib/method_observer.rb +0 -0
- data/lib/plugins/active_record_extensions/init.rb +0 -0
- data/lib/plugins/active_record_extensions/lib/active_record_extensions.rb +0 -0
- data/lib/plugins/extension_patches/init.rb +1 -3
- data/lib/plugins/extension_patches/lib/routing_extension.rb +0 -0
- data/lib/plugins/object_extensions/init.rb +0 -0
- data/lib/plugins/object_extensions/lib/object_extensions.rb +0 -0
- data/lib/plugins/response_cache_timeout/init.rb +1 -1
- data/lib/plugins/string_extensions/init.rb +0 -0
- data/lib/plugins/string_extensions/lib/string_extensions.rb +10 -9
- data/lib/plugins/symbol_extensions/init.rb +0 -0
- data/lib/plugins/symbol_extensions/lib/symbol_extensions.rb +2 -4
- data/lib/radiant.rb +2 -2
- data/lib/radiant/admin_ui.rb +0 -0
- data/lib/radiant/admin_ui/region_partials.rb +0 -0
- data/lib/radiant/admin_ui/region_set.rb +0 -0
- data/lib/radiant/cache.rb +84 -0
- data/lib/radiant/extension.rb +0 -0
- data/lib/radiant/extension/script.rb +0 -0
- data/lib/radiant/extension_loader.rb +1 -1
- data/lib/radiant/extension_migrator.rb +0 -0
- data/lib/radiant/initializer.rb +33 -8
- data/lib/radiant/legacy_routes.rb +0 -0
- data/lib/radiant/resource_responses.rb +0 -0
- data/lib/radiant/setup.rb +1 -1
- data/lib/radiant/taggable.rb +0 -0
- data/lib/simpleton.rb +0 -0
- data/lib/tasks/cucumber.rake +17 -0
- data/lib/tasks/database.rake +0 -0
- data/lib/tasks/environments.rake +0 -0
- data/lib/tasks/extensions.rake +0 -0
- data/lib/tasks/framework.rake +49 -16
- data/lib/tasks/instance.rake +0 -0
- data/lib/tasks/release.rake +8 -3
- data/lib/tasks/rspec.rake +178 -130
- data/lib/tasks/undefine.rake +0 -0
- data/log/.keep +0 -0
- data/public/.htaccess +0 -0
- data/public/404.html +0 -0
- data/public/500.html +0 -0
- data/public/favicon.ico +0 -0
- data/public/images/admin/add-child.png +0 -0
- data/public/images/admin/clear-page-cache.png +0 -0
- data/public/images/admin/collapse.png +0 -0
- data/public/images/admin/expand.png +0 -0
- data/public/images/admin/layout.png +0 -0
- data/public/images/admin/minus.png +0 -0
- data/public/images/admin/new-homepage.png +0 -0
- data/public/images/admin/new-layout.png +0 -0
- data/public/images/admin/new-snippet.png +0 -0
- data/public/images/admin/new-user.png +0 -0
- data/public/images/admin/page.png +0 -0
- data/public/images/admin/plus.png +0 -0
- data/public/images/admin/remove-disabled.png +0 -0
- data/public/images/admin/remove.png +0 -0
- data/public/images/admin/snippet.png +0 -0
- data/public/images/admin/spinner.gif +0 -0
- data/public/images/admin/virtual-page.png +0 -0
- data/public/javascripts/admin/admin.js +1 -0
- data/public/javascripts/admin/ruledtable.js +0 -0
- data/public/javascripts/admin/sitemap.js +0 -0
- data/public/javascripts/admin/tabcontrol.js +6 -0
- data/public/javascripts/application.js +0 -0
- data/public/javascripts/controls.js +72 -72
- data/public/javascripts/dragdrop.js +165 -164
- data/public/javascripts/effects.js +173 -165
- data/public/javascripts/pngfix.js +0 -0
- data/public/javascripts/prototype.js +362 -267
- data/public/javascripts/string.js +0 -0
- data/public/robots.txt +0 -0
- data/public/stylesheets/admin/main.css +0 -0
- data/script/cucumber +8 -0
- data/spec/controllers/admin/export_controller_spec.rb +0 -0
- data/spec/controllers/admin/extensions_controller_spec.rb +23 -8
- data/spec/controllers/admin/layouts_controller_spec.rb +41 -1
- data/spec/controllers/admin/pages_controller_spec.rb +73 -25
- data/spec/controllers/admin/preferences_controller_spec.rb +6 -0
- data/spec/controllers/admin/references_controller_spec.rb +0 -0
- data/spec/controllers/admin/snippets_controller_spec.rb +71 -18
- data/spec/controllers/admin/users_controller_spec.rb +44 -0
- data/spec/controllers/admin/welcome_controller_spec.rb +10 -1
- data/spec/controllers/application_controller_spec.rb +25 -4
- data/spec/controllers/site_controller_spec.rb +49 -12
- data/spec/datasets/config_dataset.rb +11 -0
- data/spec/datasets/file_not_found_dataset.rb +0 -0
- data/spec/datasets/home_page_dataset.rb +0 -0
- data/spec/datasets/layouts_dataset.rb +0 -0
- data/spec/datasets/markup_pages_dataset.rb +0 -0
- data/spec/datasets/pages_dataset.rb +5 -0
- data/spec/datasets/pages_with_layouts_dataset.rb +0 -0
- data/spec/datasets/snippets_dataset.rb +0 -0
- data/spec/datasets/users_and_pages_dataset.rb +0 -0
- data/spec/datasets/users_dataset.rb +0 -0
- data/spec/fixtures/example_extension/README +0 -0
- data/spec/fixtures/example_extension/Rakefile +0 -0
- data/spec/fixtures/example_extension/example_extension.rb +0 -0
- data/spec/fixtures/example_extension/lib/tasks/example_extension_tasks.rake +0 -0
- data/spec/fixtures/example_extension/spec/spec.opts +0 -0
- data/spec/fixtures/example_extension/spec/spec_helper.rb +0 -0
- data/spec/fixtures/sample.txt +0 -0
- data/spec/generators/extension_controller_generator_spec.rb +0 -0
- data/spec/generators/extension_generator_spec.rb +0 -0
- data/spec/generators/extension_generators_spec_helper.rb +0 -0
- data/spec/generators/extension_mailer_generator_spec.rb +0 -0
- data/spec/generators/extension_migration_generator_spec.rb +0 -0
- data/spec/generators/extension_model_generator_spec.rb +0 -0
- data/spec/helpers/admin/abstract_model_helper_spec.rb +0 -0
- data/spec/helpers/admin/export_helper_spec.rb +0 -0
- data/spec/helpers/admin/extensions_helper_spec.rb +0 -0
- data/spec/helpers/admin/layouts_helper_spec.rb +0 -0
- data/spec/helpers/admin/node_helper_spec.rb +0 -0
- data/spec/helpers/admin/pages_helper_spec.rb +0 -0
- data/spec/helpers/admin/preferences_helper_spec.rb +0 -0
- data/spec/helpers/admin/references_helper_spec.rb +0 -0
- data/spec/helpers/admin/regions_helper_spec.rb +6 -9
- data/spec/helpers/admin/snippets_helper_spec.rb +0 -0
- data/spec/helpers/admin/users_helper_spec.rb +0 -0
- data/spec/helpers/admin/welcome_helper_spec.rb +0 -0
- data/spec/helpers/application_helper_spec.rb +0 -0
- data/spec/helpers/site_helper_spec.rb +0 -0
- data/spec/lib/annotatable_spec.rb +0 -0
- data/spec/lib/autotest_spec.rb +0 -0
- data/spec/lib/core_ext/string_ext_spec.rb +5 -4
- data/spec/lib/inheritable_class_attributes_spec.rb +0 -0
- data/spec/lib/local_time_spec.rb +0 -0
- data/spec/lib/login_system_spec.rb +29 -35
- data/spec/lib/method_observer_spec.rb +0 -0
- data/spec/lib/radiant/admin_ui/region_partials_spec.rb +0 -0
- data/spec/lib/radiant/admin_ui/region_set_spec.rb +0 -0
- data/spec/lib/radiant/admin_ui_spec.rb +0 -0
- data/spec/lib/radiant/extension/script_spec.rb +0 -0
- data/spec/lib/radiant/extension_loader_spec.rb +32 -23
- data/spec/lib/radiant/extension_migrator_spec.rb +0 -0
- data/spec/lib/radiant/extension_spec.rb +0 -0
- data/spec/lib/radiant/initializer_spec.rb +17 -0
- data/spec/lib/radiant/legacy_routes_spec.rb +0 -0
- data/spec/lib/radiant/resource_responses_spec.rb +0 -0
- data/spec/lib/radiant/taggable_spec.rb +0 -0
- data/spec/lib/radiant_spec.rb +0 -0
- data/spec/lib/simpleton_spec.rb +0 -0
- data/spec/matchers/autotest_matchers.rb +0 -0
- data/spec/matchers/generator_matchers.rb +0 -0
- data/spec/matchers/login_system_matcher.rb +0 -0
- data/spec/matchers/render_form_errors_matcher.rb +0 -0
- data/spec/matchers/render_matcher.rb +9 -4
- data/spec/models/env_dump_page_spec.rb +0 -0
- data/spec/models/file_not_found_page_spec.rb +2 -2
- data/spec/models/layout_spec.rb +0 -0
- data/spec/models/page_context_spec.rb +0 -0
- data/spec/models/page_part_spec.rb +0 -0
- data/spec/models/page_spec.rb +23 -30
- data/spec/models/radiant/config_spec.rb +17 -1
- data/spec/models/radiant/exporter_spec.rb +0 -0
- data/spec/models/snippet_spec.rb +0 -0
- data/spec/models/standard_tags_spec.rb +17 -3
- data/spec/models/status_spec.rb +0 -0
- data/spec/models/text_filter_spec.rb +0 -0
- data/spec/models/user_action_observer_spec.rb +0 -0
- data/spec/models/user_spec.rb +15 -0
- data/spec/rcov.opts +0 -0
- data/spec/spec.opts +1 -1
- data/spec/spec_helper.rb +12 -45
- data/test/fixtures/extensions/01_basic/app/controllers/basic_extension_controller.rb +0 -0
- data/test/fixtures/extensions/01_basic/app/models/basic_extension_mailer.rb +0 -0
- data/test/fixtures/extensions/01_basic/app/models/basic_extension_model.rb +0 -0
- data/test/fixtures/extensions/01_basic/app/views/basic_extension/index.html.erb +0 -0
- data/test/fixtures/extensions/01_basic/app/views/basic_extension/override.html.erb +0 -0
- data/test/fixtures/extensions/01_basic/app/views/basic_extension_mailer/message.text.html.erb +0 -0
- data/test/fixtures/extensions/01_basic/basic_extension.rb +0 -0
- data/test/fixtures/extensions/01_basic/db/migrate/200812131420_create_initial_schema.rb +0 -0
- data/test/fixtures/extensions/01_basic/db/migrate/200812131421_modify_initial_schema.rb +0 -0
- data/test/fixtures/extensions/01_basic/lib/new_module.rb +0 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/multiple/init.rb +0 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/multiple/lib/multiple.rb +0 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/plugin_normal/init.rb +0 -0
- data/test/fixtures/extensions/01_basic/vendor/plugins/plugin_normal/lib/normal_plugin.rb +0 -0
- data/test/fixtures/extensions/02_overriding/app/views/basic_extension/override.html.erb +0 -0
- data/test/fixtures/extensions/02_overriding/overriding_extension.rb +0 -0
- data/test/fixtures/extensions/02_overriding/vendor/plugins/multiple/init.rb +0 -0
- data/test/fixtures/extensions/02_overriding/vendor/plugins/multiple/lib/multiple.rb +0 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/01_first.rb +0 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/02_second.rb +0 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/03_pending.rb +0 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/04_dont_run.rb +0 -0
- data/test/fixtures/extensions/03_upgrading/upgrading_extension.rb +0 -0
- data/test/fixtures/extensions/load_order_blue/load_order_blue_extension.rb +0 -0
- data/test/fixtures/extensions/load_order_green/load_order_green_extension.rb +0 -0
- data/test/fixtures/extensions/load_order_red/load_order_red_extension.rb +0 -0
- data/test/fixtures/extensions/special_characters/db/migrate/001_create_initial_schema.rb +0 -0
- data/test/fixtures/extensions/special_characters/special_characters_extension.rb +0 -0
- data/test/helpers/page_test_helper.rb +0 -0
- data/test/helpers/render_test_helper.rb +0 -0
- data/test/helpers/user_test_helper.rb +0 -0
- data/test/test_helper.rb +0 -0
- data/vendor/extensions/archive/README +0 -0
- data/vendor/extensions/archive/Rakefile +0 -0
- data/vendor/extensions/archive/app/models/archive_finder.rb +0 -0
- data/vendor/extensions/archive/archive_extension.rb +0 -0
- data/vendor/extensions/archive/lib/tasks/archive_extension_tasks.rake +0 -0
- data/vendor/extensions/archive/spec/datasets/archive_dataset.rb +0 -0
- data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +0 -0
- data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +0 -0
- data/vendor/extensions/archive/spec/models/archive_page_spec.rb +0 -0
- data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +0 -0
- data/vendor/extensions/archive/spec/spec.opts +0 -0
- data/vendor/extensions/archive/spec/spec_helper.rb +0 -0
- data/vendor/extensions/archive/test/fixtures/pages.yml +0 -0
- data/vendor/extensions/archive/test/functional/archive_extension_test.rb +0 -0
- data/vendor/extensions/archive/test/test_helper.rb +0 -0
- data/vendor/extensions/markdown_filter/README +0 -0
- data/vendor/extensions/markdown_filter/Rakefile +0 -0
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +0 -0
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +0 -0
- data/vendor/extensions/markdown_filter/lib/smarty_pants_filter.rb +0 -0
- data/vendor/extensions/markdown_filter/lib/tasks/markdown_filter_extension_tasks.rake +0 -0
- data/vendor/extensions/markdown_filter/lib/tasks/textile_filter_extension_tasks.rake +0 -0
- data/vendor/extensions/markdown_filter/markdown.html +0 -0
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +0 -0
- data/vendor/extensions/markdown_filter/smartypants.html +0 -0
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +0 -0
- data/vendor/extensions/markdown_filter/spec/models/smarty_pants_filter_spec.rb +0 -0
- data/vendor/extensions/markdown_filter/spec/spec.opts +0 -0
- data/vendor/extensions/markdown_filter/spec/spec_helper.rb +0 -0
- data/vendor/extensions/markdown_filter/test/test_helper.rb +0 -0
- data/vendor/extensions/markdown_filter/test/unit/markdown_filter_test.rb +0 -0
- data/vendor/extensions/markdown_filter/test/unit/smarty_pants_filter_test.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/CHANGES +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/LICENSE +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/README +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/bin/bluecloth +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/install.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/lib/bluecloth.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/test.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/00_Class.tests.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/05_Markdown.tests.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/10_Bug.tests.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/15_Contrib.tests.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/bctestcase.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/antsugar.txt +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/ml-announce.txt +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/re-overflow.txt +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/tests/data/re-overflow2.txt +0 -0
- data/vendor/extensions/markdown_filter/vendor/bluecloth/utils.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/rubypants/README +0 -0
- data/vendor/extensions/markdown_filter/vendor/rubypants/Rakefile +0 -0
- data/vendor/extensions/markdown_filter/vendor/rubypants/install.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/rubypants/rubypants.rb +0 -0
- data/vendor/extensions/markdown_filter/vendor/rubypants/test_rubypants.rb +0 -0
- data/vendor/extensions/textile_filter/README +0 -0
- data/vendor/extensions/textile_filter/Rakefile +0 -0
- data/vendor/extensions/textile_filter/lib/tasks/textile_filter_extension_tasks.rake +0 -0
- data/vendor/extensions/textile_filter/lib/textile_filter.rb +0 -0
- data/vendor/extensions/textile_filter/lib/textile_tags.rb +0 -0
- data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +0 -0
- data/vendor/extensions/textile_filter/spec/spec.opts +0 -0
- data/vendor/extensions/textile_filter/spec/spec_helper.rb +0 -0
- data/vendor/extensions/textile_filter/test/test_helper.rb +0 -0
- data/vendor/extensions/textile_filter/test/unit/textile_filter_test.rb +0 -0
- data/vendor/extensions/textile_filter/textile.html +0 -0
- data/vendor/extensions/textile_filter/textile_filter_extension.rb +0 -0
- data/vendor/highline/CHANGELOG +39 -0
- data/vendor/highline/INSTALL +0 -0
- data/vendor/highline/LICENSE +1 -1
- data/vendor/highline/README +0 -0
- data/vendor/highline/Rakefile +1 -1
- data/vendor/highline/TODO +0 -0
- data/vendor/highline/examples/ansi_colors.rb +0 -0
- data/vendor/highline/examples/asking_for_arrays.rb +0 -0
- data/vendor/highline/examples/basic_usage.rb +0 -0
- data/vendor/highline/examples/color_scheme.rb +0 -0
- data/vendor/highline/examples/limit.rb +12 -0
- data/vendor/highline/examples/menus.rb +0 -0
- data/vendor/highline/examples/overwrite.rb +0 -0
- data/vendor/highline/examples/page_and_wrap.rb +0 -0
- data/vendor/highline/examples/password.rb +0 -0
- data/vendor/highline/examples/trapping_eof.rb +0 -0
- data/vendor/highline/examples/using_readline.rb +1 -1
- data/vendor/highline/lib/highline.rb +86 -32
- data/vendor/highline/lib/highline/color_scheme.rb +0 -0
- data/vendor/highline/lib/highline/compatibility.rb +17 -0
- data/vendor/highline/lib/highline/import.rb +0 -0
- data/vendor/highline/lib/highline/menu.rb +0 -0
- data/vendor/highline/lib/highline/question.rb +3 -2
- data/vendor/highline/lib/highline/system_extensions.rb +93 -25
- data/vendor/highline/setup.rb +0 -0
- data/vendor/highline/test/tc_color_scheme.rb +0 -0
- data/vendor/highline/test/tc_highline.rb +46 -3
- data/vendor/highline/test/tc_import.rb +0 -0
- data/vendor/highline/test/tc_menu.rb +0 -0
- data/vendor/highline/test/ts_all.rb +0 -0
- data/vendor/plugins/acts_as_tree/README +0 -0
- data/vendor/plugins/acts_as_tree/Rakefile +0 -0
- data/vendor/plugins/acts_as_tree/init.rb +0 -0
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +0 -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 +0 -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/dataset/CHANGELOG +58 -0
- data/vendor/plugins/dataset/LICENSE +1 -1
- data/vendor/plugins/dataset/{README.txt → README} +0 -0
- data/vendor/plugins/dataset/Rakefile +16 -8
- data/vendor/plugins/dataset/TODO +2 -6
- data/vendor/plugins/dataset/VERSION.yml +4 -0
- data/vendor/plugins/dataset/dataset.gemspec +27 -0
- data/vendor/plugins/dataset/lib/dataset.rb +3 -1
- data/vendor/plugins/dataset/lib/dataset/base.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/collection.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/database/base.rb +1 -1
- data/vendor/plugins/dataset/lib/dataset/database/mysql.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/database/postgresql.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/database/sqlite3.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/cucumber.rb +20 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/rspec.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/test_unit.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/instance_methods.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/load.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/record/fixture.rb +28 -9
- data/vendor/plugins/dataset/lib/dataset/record/meta.rb +31 -7
- data/vendor/plugins/dataset/lib/dataset/record/model.rb +15 -6
- data/vendor/plugins/dataset/lib/dataset/resolver.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/session.rb +0 -0
- data/vendor/plugins/dataset/lib/dataset/session_binding.rb +56 -38
- data/vendor/plugins/dataset/lib/dataset/version.rb +0 -0
- data/vendor/plugins/dataset/spec/dataset/cucumber_spec.rb +54 -0
- data/vendor/plugins/dataset/spec/dataset/database/base_spec.rb +3 -3
- data/vendor/plugins/dataset/spec/dataset/record/meta_spec.rb +14 -0
- data/vendor/plugins/dataset/spec/dataset/resolver_spec.rb +1 -1
- data/vendor/plugins/dataset/spec/dataset/rspec_spec.rb +107 -111
- data/vendor/plugins/dataset/spec/dataset/session_binding_spec.rb +42 -4
- data/vendor/plugins/dataset/spec/dataset/session_spec.rb +1 -1
- data/vendor/plugins/dataset/spec/dataset/test_unit_spec.rb +2 -1
- data/vendor/plugins/dataset/spec/fixtures/datasets/constant_not_defined.rb +0 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/ending_with_dataset.rb +0 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/exact_name.rb +0 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/not_a_dataset_base.rb +0 -0
- data/vendor/plugins/dataset/spec/fixtures/more_datasets/in_another_directory.rb +0 -0
- data/vendor/plugins/dataset/spec/models.rb +14 -2
- data/vendor/plugins/dataset/spec/schema.rb +3 -1
- data/vendor/plugins/dataset/spec/spec.opts +0 -0
- data/vendor/plugins/dataset/spec/spec_helper.rb +7 -9
- data/vendor/plugins/dataset/spec/stubs/mini_rails.rb +18 -0
- data/vendor/plugins/dataset/spec/stubs/test_help.rb +1 -0
- data/vendor/plugins/dataset/tasks/dataset.rake +0 -0
- data/vendor/plugins/haml/FAQ +0 -0
- data/vendor/plugins/haml/MIT-LICENSE +0 -0
- data/vendor/plugins/haml/README.rdoc +4 -4
- data/vendor/plugins/haml/REVISION +0 -0
- data/vendor/plugins/haml/Rakefile +35 -1
- data/vendor/plugins/haml/VERSION +1 -1
- data/vendor/plugins/haml/bin/haml +2 -1
- data/vendor/plugins/haml/extra/haml-mode.el +331 -0
- data/vendor/plugins/haml/extra/sass-mode.el +89 -0
- data/vendor/plugins/haml/init.rb +1 -0
- data/vendor/plugins/haml/lib/haml.rb +58 -77
- data/vendor/plugins/haml/lib/haml/buffer.rb +12 -8
- data/vendor/plugins/haml/lib/haml/engine.rb +3 -2
- data/vendor/plugins/haml/lib/haml/error.rb +1 -1
- data/vendor/plugins/haml/lib/haml/exec.rb +33 -8
- data/vendor/plugins/haml/lib/haml/filters.rb +41 -29
- data/vendor/plugins/haml/lib/haml/helpers.rb +69 -36
- data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +0 -0
- data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +30 -20
- data/vendor/plugins/haml/lib/haml/html.rb +53 -19
- data/vendor/plugins/haml/lib/haml/precompiler.rb +38 -25
- data/vendor/plugins/haml/lib/haml/template.rb +0 -0
- data/vendor/plugins/haml/lib/haml/template/patch.rb +0 -0
- data/vendor/plugins/haml/lib/haml/template/plugin.rb +0 -0
- data/vendor/plugins/haml/lib/haml/util.rb +23 -0
- data/vendor/plugins/haml/lib/haml/version.rb +47 -0
- data/vendor/plugins/haml/lib/sass.rb +25 -8
- data/vendor/plugins/haml/lib/sass/constant.rb +3 -1
- data/vendor/plugins/haml/lib/sass/constant/color.rb +0 -0
- data/vendor/plugins/haml/lib/sass/constant/literal.rb +0 -0
- data/vendor/plugins/haml/lib/sass/constant/nil.rb +0 -0
- data/vendor/plugins/haml/lib/sass/constant/number.rb +1 -1
- data/vendor/plugins/haml/lib/sass/constant/operation.rb +0 -0
- data/vendor/plugins/haml/lib/sass/constant/string.rb +0 -0
- data/vendor/plugins/haml/lib/sass/css.rb +31 -30
- data/vendor/plugins/haml/lib/sass/engine.rb +13 -12
- data/vendor/plugins/haml/lib/sass/error.rb +1 -1
- data/vendor/plugins/haml/lib/sass/plugin.rb +11 -7
- data/vendor/plugins/haml/lib/sass/plugin/merb.rb +1 -1
- data/vendor/plugins/haml/lib/sass/plugin/rails.rb +0 -0
- data/vendor/plugins/haml/lib/sass/tree/attr_node.rb +4 -0
- data/vendor/plugins/haml/lib/sass/tree/comment_node.rb +0 -0
- data/vendor/plugins/haml/lib/sass/tree/directive_node.rb +0 -0
- data/vendor/plugins/haml/lib/sass/tree/node.rb +4 -0
- data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +4 -0
- data/vendor/plugins/haml/lib/sass/tree/value_node.rb +4 -0
- data/vendor/plugins/haml/rails/init.rb +1 -0
- data/vendor/plugins/haml/test/benchmark.rb +49 -32
- data/vendor/plugins/haml/test/haml/engine_test.rb +165 -113
- data/vendor/plugins/haml/test/haml/helper_test.rb +29 -8
- data/vendor/plugins/haml/test/haml/html2haml_test.rb +50 -16
- data/vendor/plugins/haml/test/haml/markaby/standard.mab +0 -0
- data/vendor/plugins/haml/test/haml/mocks/article.rb +0 -0
- data/vendor/plugins/haml/test/haml/results/content_for_layout.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/eval_suppressed.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/filters.xhtml +2 -28
- data/vendor/plugins/haml/test/haml/results/helpers.xhtml +20 -18
- data/vendor/plugins/haml/test/haml/results/helpful.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +6 -0
- data/vendor/plugins/haml/test/haml/results/list.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/nuke_inner_whitespace.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/nuke_outer_whitespace.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/original_engine.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/partial_layout.xhtml +5 -0
- data/vendor/plugins/haml/test/haml/results/partials.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/render_layout.xhtml +3 -0
- data/vendor/plugins/haml/test/haml/results/silent_script.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/standard.xhtml +1 -1
- data/vendor/plugins/haml/test/haml/results/tag_parsing.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/very_basic.xhtml +0 -0
- data/vendor/plugins/haml/test/haml/results/whitespace_handling.xhtml +4 -1
- data/vendor/plugins/haml/test/haml/rhtml/_av_partial_1.rhtml +0 -0
- data/vendor/plugins/haml/test/haml/rhtml/_av_partial_2.rhtml +0 -0
- data/vendor/plugins/haml/test/haml/rhtml/action_view.rhtml +0 -0
- data/vendor/plugins/haml/test/haml/rhtml/standard.rhtml +3 -3
- data/vendor/plugins/haml/test/haml/template_test.rb +58 -5
- data/vendor/plugins/haml/test/haml/templates/_av_partial_1.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/_av_partial_1_ugly.haml +9 -0
- data/vendor/plugins/haml/test/haml/templates/_av_partial_2.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/_av_partial_2_ugly.haml +5 -0
- data/vendor/plugins/haml/test/haml/templates/_layout.erb +3 -0
- data/vendor/plugins/haml/test/haml/templates/_layout_for_partial.haml +3 -0
- data/vendor/plugins/haml/test/haml/templates/_partial.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/_text_area.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/action_view.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/action_view_ugly.haml +47 -0
- data/vendor/plugins/haml/test/haml/templates/breakage.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/content_for_layout.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/eval_suppressed.haml +1 -1
- data/vendor/plugins/haml/test/haml/templates/filters.haml +0 -28
- data/vendor/plugins/haml/test/haml/templates/helpers.haml +46 -20
- data/vendor/plugins/haml/test/haml/templates/helpful.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/just_stuff.haml +7 -0
- data/vendor/plugins/haml/test/haml/templates/list.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/nuke_inner_whitespace.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/nuke_outer_whitespace.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/original_engine.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/partial_layout.haml +3 -0
- data/vendor/plugins/haml/test/haml/templates/partialize.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/partials.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/render_layout.haml +2 -0
- data/vendor/plugins/haml/test/haml/templates/silent_script.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/standard.haml +3 -3
- data/vendor/plugins/haml/test/haml/templates/standard_ugly.haml +42 -0
- data/vendor/plugins/haml/test/haml/templates/tag_parsing.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/very_basic.haml +0 -0
- data/vendor/plugins/haml/test/haml/templates/whitespace_handling.haml +2 -2
- data/vendor/plugins/haml/test/linked_rails.rb +12 -0
- data/vendor/plugins/haml/test/sass/css2sass_test.rb +193 -0
- data/vendor/plugins/haml/test/sass/engine_test.rb +14 -2
- data/vendor/plugins/haml/test/sass/plugin_test.rb +12 -6
- data/vendor/plugins/haml/test/sass/results/alt.css +0 -0
- data/vendor/plugins/haml/test/sass/results/basic.css +0 -0
- data/vendor/plugins/haml/test/sass/results/compact.css +0 -0
- data/vendor/plugins/haml/test/sass/results/complex.css +0 -0
- data/vendor/plugins/haml/test/sass/results/compressed.css +0 -0
- data/vendor/plugins/haml/test/sass/results/constants.css +0 -0
- data/vendor/plugins/haml/test/sass/results/expanded.css +0 -0
- data/vendor/plugins/haml/test/sass/results/import.css +0 -0
- data/vendor/plugins/haml/test/sass/results/mixins.css +0 -0
- data/vendor/plugins/haml/test/sass/results/multiline.css +0 -0
- data/vendor/plugins/haml/test/sass/results/nested.css +0 -0
- data/vendor/plugins/haml/test/sass/results/parent_ref.css +0 -0
- data/vendor/plugins/haml/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -0
- data/vendor/plugins/haml/test/sass/results/subdir/subdir.css +0 -0
- data/vendor/plugins/haml/test/sass/templates/_partial.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/alt.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/basic.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/bork.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/bork2.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/compact.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/complex.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/compressed.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/constants.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/expanded.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/import.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/importee.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/mixins.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/multiline.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/nested.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/parent_ref.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -0
- data/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass +0 -0
- data/vendor/plugins/haml/test/test_helper.rb +11 -14
- data/vendor/rack-cache/CHANGES +128 -0
- data/vendor/rack-cache/COPYING +18 -0
- data/vendor/rack-cache/README +110 -0
- data/vendor/rack-cache/Rakefile +137 -0
- data/vendor/rack-cache/TODO +31 -0
- data/vendor/rack-cache/doc/configuration.markdown +86 -0
- data/vendor/rack-cache/doc/faq.markdown +141 -0
- data/vendor/rack-cache/doc/index.markdown +118 -0
- data/vendor/rack-cache/doc/layout.html.erb +34 -0
- data/vendor/rack-cache/doc/license.markdown +24 -0
- data/vendor/rack-cache/doc/rack-cache.css +362 -0
- data/vendor/rack-cache/doc/server.ru +34 -0
- data/vendor/rack-cache/doc/storage.markdown +162 -0
- data/vendor/rack-cache/example/sinatra/app.rb +25 -0
- data/vendor/rack-cache/example/sinatra/views/index.erb +44 -0
- data/vendor/rack-cache/lib/rack/cache.rb +45 -0
- data/vendor/rack-cache/lib/rack/cache/cachecontrol.rb +193 -0
- data/vendor/rack-cache/lib/rack/cache/context.rb +233 -0
- data/vendor/rack-cache/lib/rack/cache/entitystore.rb +253 -0
- data/vendor/rack-cache/lib/rack/cache/key.rb +52 -0
- data/vendor/rack-cache/lib/rack/cache/metastore.rb +328 -0
- data/vendor/rack-cache/lib/rack/cache/options.rb +150 -0
- data/vendor/rack-cache/lib/rack/cache/request.rb +33 -0
- data/vendor/rack-cache/lib/rack/cache/response.rb +267 -0
- data/vendor/rack-cache/lib/rack/cache/storage.rb +49 -0
- data/vendor/rack-cache/rack-cache.gemspec +69 -0
- data/vendor/rack-cache/test/cache_test.rb +38 -0
- data/vendor/rack-cache/test/cachecontrol_test.rb +139 -0
- data/vendor/rack-cache/test/context_test.rb +727 -0
- data/vendor/rack-cache/test/entitystore_test.rb +189 -0
- data/vendor/rack-cache/test/key_test.rb +50 -0
- data/vendor/rack-cache/test/metastore_test.rb +263 -0
- data/vendor/rack-cache/test/options_test.rb +78 -0
- data/vendor/rack-cache/test/pony.jpg +0 -0
- data/vendor/rack-cache/test/request_test.rb +19 -0
- data/vendor/rack-cache/test/response_test.rb +178 -0
- data/vendor/rack-cache/test/spec_setup.rb +202 -0
- data/vendor/rack-cache/test/storage_test.rb +94 -0
- data/vendor/radius/CHANGELOG +0 -0
- data/vendor/radius/QUICKSTART +0 -0
- data/vendor/radius/README +0 -0
- data/vendor/radius/ROADMAP +0 -0
- data/vendor/radius/Rakefile +0 -0
- data/vendor/radius/lib/radius.rb +0 -0
- data/vendor/radius/test/radius_test.rb +0 -0
- data/vendor/rails/actionmailer/CHANGELOG +23 -11
- data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
- data/vendor/rails/actionmailer/README +0 -0
- data/vendor/rails/actionmailer/Rakefile +3 -5
- data/vendor/rails/actionmailer/install.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer.rb +30 -20
- data/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +118 -60
- data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +4 -2
- data/vendor/rails/actionmailer/lib/action_mailer/mail_helper.rb +0 -2
- data/vendor/rails/actionmailer/lib/action_mailer/part.rb +6 -9
- data/vendor/rails/actionmailer/lib/action_mailer/part_container.rb +5 -1
- data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +1 -0
- data/vendor/rails/actionmailer/lib/action_mailer/utils.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/text_format.rb +10 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/port.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +17 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/lib/actionmailer.rb +0 -0
- data/vendor/rails/actionmailer/test/abstract_unit.rb +20 -11
- data/vendor/rails/actionmailer/test/asset_host_test.rb +54 -0
- data/vendor/rails/actionmailer/test/delivery_method_test.rb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/asset_host_mailer/email_with_asset.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/auto_layout_mailer/hello.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/auto_layout_mailer/multipart.text.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/auto_layout_mailer/multipart.text.plain.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/explicit_layout_mailer/logout.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/explicit_layout_mailer/signup.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/layouts/auto_layout_mailer.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/layouts/auto_layout_mailer.text.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/layouts/spam.html.erb +1 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email10 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email12 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email13 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email2 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email3 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email4 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email5 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email6 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email7 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email8 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email9 +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_quoted_with_0d0a +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_email_with_partially_quoted_subject +0 -0
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/body_ivar.erb +2 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/{signed_up.erb → signed_up.html.erb} +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +0 -0
- data/vendor/rails/actionmailer/test/mail_helper_test.rb +0 -0
- data/vendor/rails/actionmailer/test/mail_layout_test.rb +123 -0
- data/vendor/rails/actionmailer/test/mail_render_test.rb +3 -9
- data/vendor/rails/actionmailer/test/mail_service_test.rb +126 -27
- data/vendor/rails/actionmailer/test/quoting_test.rb +4 -3
- data/vendor/rails/actionmailer/test/test_helper_test.rb +5 -5
- data/vendor/rails/actionmailer/test/tmail_test.rb +0 -0
- data/vendor/rails/actionmailer/test/url_test.rb +0 -0
- data/vendor/rails/actionpack/CHANGELOG +698 -364
- data/vendor/rails/actionpack/MIT-LICENSE +1 -1
- data/vendor/rails/actionpack/README +26 -86
- data/vendor/rails/actionpack/RUNNING_UNIT_TESTS +0 -0
- data/vendor/rails/actionpack/Rakefile +11 -11
- data/vendor/rails/actionpack/install.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller.rb +86 -49
- data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +65 -87
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +34 -34
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +26 -17
- data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +1 -4
- data/vendor/rails/actionpack/lib/action_controller/base.rb +350 -210
- data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +39 -26
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +9 -11
- data/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +45 -20
- data/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +38 -56
- data/vendor/rails/actionpack/lib/action_controller/caching/pages.rb +13 -15
- data/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +4 -4
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +0 -1
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +2 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +54 -200
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +23 -25
- data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +57 -101
- data/vendor/rails/actionpack/lib/action_controller/failsafe.rb +52 -0
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +48 -10
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +38 -47
- data/vendor/rails/actionpack/lib/action_controller/headers.rb +16 -14
- data/vendor/rails/actionpack/lib/action_controller/helpers.rb +15 -11
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +204 -24
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +150 -97
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +52 -81
- data/vendor/rails/actionpack/lib/action_controller/middleware_stack.rb +119 -0
- data/vendor/rails/actionpack/lib/action_controller/middlewares.rb +13 -0
- data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +24 -5
- data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +72 -42
- data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/params_parser.rb +71 -0
- data/vendor/rails/actionpack/lib/action_controller/performance_test.rb +15 -0
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +44 -31
- data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/reloader.rb +14 -0
- data/vendor/rails/actionpack/lib/action_controller/request.rb +237 -512
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +9 -41
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +72 -147
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +196 -90
- data/vendor/rails/actionpack/lib/action_controller/response.rb +190 -34
- data/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb +28 -0
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +35 -37
- data/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +49 -55
- data/vendor/rails/actionpack/lib/action_controller/routing/optimisations.rb +32 -22
- data/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb +34 -29
- data/vendor/rails/actionpack/lib/action_controller/routing/route.rb +171 -146
- data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +95 -43
- data/vendor/rails/actionpack/lib/action_controller/routing/routing_ext.rb +4 -1
- data/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +91 -31
- data/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb +181 -0
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +198 -143
- data/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +36 -83
- data/vendor/rails/actionpack/lib/action_controller/session_management.rb +26 -130
- data/vendor/rails/actionpack/lib/action_controller/status_codes.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +37 -13
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/missing_template.erb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/routing_error.erb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/unknown_action.erb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +148 -27
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +190 -144
- data/vendor/rails/actionpack/lib/action_controller/translation.rb +13 -0
- data/vendor/rails/actionpack/lib/action_controller/uploaded_file.rb +44 -0
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +93 -19
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner.rb +16 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +9 -2
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +0 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack.rb +89 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/adapter/camping.rb +22 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb +37 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/request.rb +37 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/basic.rb +58 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/md5.rb +124 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/nonce.rb +51 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/params.rb +55 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/request.rb +40 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb +480 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/builder.rb +63 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/cascade.rb +36 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/chunked.rb +49 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/commonlogger.rb +61 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/conditionalget.rb +45 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/content_length.rb +29 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/content_type.rb +23 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/deflater.rb +85 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/directory.rb +153 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb +88 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler.rb +48 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/cgi.rb +61 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/evented_mongrel.rb +8 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/fastcgi.rb +89 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/lsws.rb +55 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb +84 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/scgi.rb +59 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb +8 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb +18 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb +67 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb +19 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb +462 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lobster.rb +65 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb +16 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb +27 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/mime.rb +204 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/mock.rb +160 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/recursive.rb +57 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/reloader.rb +64 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb +241 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/response.rb +179 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/abstract/id.rb +142 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/cookie.rb +91 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/memcache.rb +109 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/session/pool.rb +100 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/showexceptions.rb +349 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/showstatus.rb +106 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/static.rb +38 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb +55 -0
- data/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb +392 -0
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +3 -3
- data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view.rb +32 -19
- data/vendor/rails/actionpack/lib/action_view/base.rb +164 -154
- data/vendor/rails/actionpack/lib/action_view/erb/util.rb +38 -0
- data/vendor/rails/actionpack/lib/action_view/helpers.rb +57 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +56 -27
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +194 -126
- data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +75 -20
- data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +27 -6
- data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +1 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +19 -44
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +564 -299
- data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +20 -13
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +365 -93
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +168 -96
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +63 -40
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +80 -89
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +192 -75
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +218 -213
- data/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +0 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +4 -5
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +55 -33
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +3 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +41 -25
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +294 -223
- data/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb +39 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +124 -59
- data/vendor/rails/actionpack/lib/action_view/inline_template.rb +13 -14
- data/vendor/rails/actionpack/lib/action_view/locale/en.yml +110 -0
- data/vendor/rails/actionpack/lib/action_view/partials.rb +137 -55
- data/vendor/rails/actionpack/lib/action_view/paths.rb +69 -0
- data/vendor/rails/actionpack/lib/action_view/reloadable_template.rb +117 -0
- data/vendor/rails/actionpack/lib/action_view/renderable.rb +95 -0
- data/vendor/rails/actionpack/lib/action_view/renderable_partial.rb +47 -0
- data/vendor/rails/actionpack/lib/action_view/template.rb +223 -93
- data/vendor/rails/actionpack/lib/action_view/template_error.rb +18 -29
- data/vendor/rails/actionpack/lib/action_view/template_handler.rb +23 -23
- data/vendor/rails/actionpack/lib/action_view/template_handlers.rb +48 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +5 -15
- data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +11 -45
- data/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +3 -17
- data/vendor/rails/actionpack/lib/action_view/test_case.rb +34 -5
- data/vendor/rails/actionpack/lib/actionpack.rb +0 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +25 -16
- data/vendor/rails/actionpack/test/active_record_unit.rb +32 -33
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +139 -106
- data/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +27 -30
- data/vendor/rails/actionpack/test/adv_attr_test.rb +0 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +30 -57
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +2 -8
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +125 -85
- data/vendor/rails/actionpack/test/controller/base_test.rb +15 -17
- data/vendor/rails/actionpack/test/controller/benchmark_test.rb +3 -3
- data/vendor/rails/actionpack/test/controller/caching_test.rb +161 -81
- data/vendor/rails/actionpack/test/controller/capture_test.rb +3 -26
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +51 -22
- data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +32 -67
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +9 -14
- data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +26 -28
- data/vendor/rails/actionpack/test/controller/fake_controllers.rb +0 -0
- data/vendor/rails/actionpack/test/controller/fake_models.rb +8 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/filters_test.rb +19 -15
- data/vendor/rails/actionpack/test/controller/flash_test.rb +2 -6
- data/vendor/rails/actionpack/test/controller/header_test.rb +0 -0
- data/vendor/rails/actionpack/test/controller/helper_test.rb +15 -1
- data/vendor/rails/actionpack/test/controller/html-scanner/cdata_node_test.rb +15 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +21 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +15 -1
- data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +0 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +0 -0
- data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +0 -0
- data/vendor/rails/actionpack/test/controller/http_basic_authentication_test.rb +88 -0
- data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +178 -0
- data/vendor/rails/actionpack/test/controller/integration_test.rb +198 -33
- data/vendor/rails/actionpack/test/controller/layout_test.rb +53 -108
- data/vendor/rails/actionpack/test/controller/logging_test.rb +46 -0
- data/vendor/rails/actionpack/test/controller/middleware_stack_test.rb +90 -0
- data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +67 -69
- data/vendor/rails/actionpack/test/controller/mime_type_test.rb +14 -5
- data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +241 -122
- data/vendor/rails/actionpack/test/controller/rack_test.rb +294 -0
- data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +0 -0
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +78 -85
- data/vendor/rails/actionpack/test/controller/render_test.rb +1459 -234
- data/vendor/rails/actionpack/test/controller/request/json_params_parsing_test.rb +45 -0
- data/vendor/rails/actionpack/test/controller/request/multipart_params_parsing_test.rb +223 -0
- data/vendor/rails/actionpack/test/controller/request/query_string_parsing_test.rb +120 -0
- data/vendor/rails/actionpack/test/controller/request/url_encoded_params_parsing_test.rb +184 -0
- data/vendor/rails/actionpack/test/controller/request/xml_params_parsing_test.rb +88 -0
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +63 -130
- data/vendor/rails/actionpack/test/controller/request_test.rb +65 -586
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +63 -44
- data/vendor/rails/actionpack/test/controller/resources_test.rb +505 -37
- data/vendor/rails/actionpack/test/controller/routing_test.rb +1570 -1477
- data/vendor/rails/actionpack/test/controller/selector_test.rb +3 -3
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +30 -7
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +171 -190
- data/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +94 -148
- data/vendor/rails/actionpack/test/controller/session/test_session_test.rb +58 -0
- data/vendor/rails/actionpack/test/controller/test_test.rb +47 -50
- data/vendor/rails/actionpack/test/controller/translation_test.rb +26 -0
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +80 -31
- data/vendor/rails/actionpack/test/controller/verification_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/view_paths_test.rb +49 -48
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +178 -147
- data/vendor/rails/actionpack/test/fixtures/_top_level_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/_top_level_partial_only.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/addresses/list.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/alternate_helpers/foo_helper.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/companies.yml +0 -0
- data/vendor/rails/actionpack/test/fixtures/company.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rhtml.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rjs.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/content_type/render_default_for_rxml.rxml +0 -0
- data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +0 -0
- data/vendor/rails/actionpack/test/fixtures/developer.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/developers.yml +0 -0
- data/vendor/rails/actionpack/test/fixtures/developers/_developer.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/developers_projects.yml +0 -0
- data/vendor/rails/actionpack/test/fixtures/fun/games/_game.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/fun/games/hello_world.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/fun/serious/games/_game.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.js.rjs +6 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +5 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/good_customers/_good_customer.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/alt/hello.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/alt/layouts/alt.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/item.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/layout_test.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/third_party_template_library.mab +0 -0
- data/vendor/rails/actionpack/test/fixtures/layout_tests/views/hello.rhtml +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/_column.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/default_html.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/standard.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/xhr.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/mascot.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/mascots.yml +0 -0
- data/vendor/rails/actionpack/test/fixtures/mascots/_mascot.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/empty +10 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/hello.txt +1 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/mona_lisa.jpg +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/none +9 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +0 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/text_file +0 -0
- data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/override2/layouts/test/sub.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/project.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/projects.yml +0 -0
- data/vendor/rails/actionpack/test/fixtures/projects/_project.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/404.html +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/500.da.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/500.html +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/images/rails.png +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/controls.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/dragdrop.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/effects.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/subdir/subdir.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/version.1.0.js +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +0 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/subdir/subdir.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/version.1.0.css +0 -0
- data/vendor/rails/actionpack/test/fixtures/quiz/questions/_question.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/replies.yml +1 -1
- data/vendor/rails/actionpack/test/fixtures/replies/_reply.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/reply.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.js.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.js.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.js.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/scope/test/modgreet.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/shared.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_counter.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer.erb +1 -1
- data/vendor/rails/actionpack/test/fixtures/test/_customer_counter.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_greeting.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_with_var.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_form.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hash_greeting.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_hello.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_labelling_form.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_layout_for_block_with_args.html.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/test/_layout_for_partial.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_local_inspector.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_one.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial_for_use_in_layout.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial_only.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_partial_with_only_html_version.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_person.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_raise.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/_two.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/action_talk_to_layout.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/calling_partial_with_layout.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/capturing.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for_concatenated.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/content_for_with_parameter.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/delete_with_js.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/dont_pick_me +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/enum_rjs_test.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.js.rjs +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello.builder +1 -1
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.da.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.pt-BR.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_container.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_from_rxml.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_layout_false.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/hyphen-ated.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/implicit_content_type.atom.builder +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/list.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/nested_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/test/non_erb_block_content_for.builder +1 -1
- data/vendor/rails/actionpack/test/fixtures/test/potential_conflicts.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_explicit_html_template.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_implicit_html_template.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_implicit_html_template_from_xhr_request.da.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_implicit_html_template_from_xhr_request.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_to_string_test.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/sub_template_raise.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/template.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/update_element_with_capture.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/using_layout_around_block.html.erb +0 -0
- data/vendor/rails/actionpack/test/fixtures/test/using_layout_around_block_with_args.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/utf8.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/topic.rb +0 -0
- data/vendor/rails/actionpack/test/fixtures/topics.yml +0 -0
- data/vendor/rails/actionpack/test/fixtures/topics/_topic.html.erb +0 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_i18n_test.rb +44 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +58 -24
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +217 -29
- data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +117 -10
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +50 -24
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +203 -0
- data/vendor/rails/actionpack/test/template/date_helper_i18n_test.rb +120 -0
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +822 -144
- data/vendor/rails/actionpack/test/template/erb_util_test.rb +0 -0
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +454 -196
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +653 -1235
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +89 -34
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +16 -22
- data/vendor/rails/actionpack/test/template/number_helper_i18n_test.rb +69 -0
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +44 -13
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +101 -84
- data/vendor/rails/actionpack/test/template/record_tag_helper_test.rb +24 -20
- data/vendor/rails/actionpack/test/template/render_test.rb +290 -0
- data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +3 -3
- data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +0 -0
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +34 -14
- data/vendor/rails/actionpack/test/template/test_test.rb +4 -6
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +210 -57
- data/vendor/rails/actionpack/test/template/translation_helper_test.rb +32 -0
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +88 -18
- data/vendor/rails/actionpack/test/testing_sandbox.rb +0 -0
- data/vendor/rails/actionpack/test/view/test_case_test.rb +8 -0
- data/vendor/rails/activerecord/CHANGELOG +466 -394
- data/vendor/rails/activerecord/README +0 -0
- data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +0 -0
- data/vendor/rails/activerecord/Rakefile +12 -7
- data/vendor/rails/activerecord/examples/associations.png +0 -0
- data/vendor/rails/activerecord/install.rb +0 -0
- data/vendor/rails/activerecord/lib/active_record.rb +56 -52
- data/vendor/rails/activerecord/lib/active_record/aggregations.rb +110 -38
- data/vendor/rails/activerecord/lib/active_record/association_preload.rb +135 -31
- data/vendor/rails/activerecord/lib/active_record/associations.rb +578 -421
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +136 -34
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +73 -14
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +0 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +24 -8
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +30 -30
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +29 -27
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +35 -9
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +3 -4
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +14 -5
- data/vendor/rails/activerecord/lib/active_record/autosave_association.rb +349 -0
- data/vendor/rails/activerecord/lib/active_record/base.rb +692 -281
- data/vendor/rails/activerecord/lib/active_record/batches.rb +73 -0
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +46 -21
- data/vendor/rails/activerecord/lib/active_record/callbacks.rb +65 -17
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +371 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +45 -215
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +133 -20
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +8 -7
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +0 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +75 -31
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +10 -4
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +94 -29
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +124 -66
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +147 -91
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +41 -21
- data/vendor/rails/activerecord/lib/active_record/dirty.rb +28 -10
- data/vendor/rails/activerecord/lib/active_record/dynamic_finder_match.rb +41 -0
- data/vendor/rails/activerecord/lib/active_record/dynamic_scope_match.rb +25 -0
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +196 -200
- data/vendor/rails/activerecord/lib/active_record/i18n_interpolation_deprecation.rb +26 -0
- data/vendor/rails/activerecord/lib/active_record/locale/en.yml +54 -0
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +33 -0
- data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +0 -0
- data/vendor/rails/activerecord/lib/active_record/migration.rb +55 -12
- data/vendor/rails/activerecord/lib/active_record/named_scope.rb +49 -20
- data/vendor/rails/activerecord/lib/active_record/nested_attributes.rb +329 -0
- data/vendor/rails/activerecord/lib/active_record/observer.rb +0 -0
- data/vendor/rails/activerecord/lib/active_record/query_cache.rb +25 -13
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +132 -55
- data/vendor/rails/activerecord/lib/active_record/schema.rb +0 -0
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +15 -7
- data/vendor/rails/activerecord/lib/active_record/serialization.rb +3 -1
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +19 -0
- data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +28 -13
- data/vendor/rails/activerecord/lib/active_record/session_store.rb +318 -0
- data/vendor/rails/activerecord/lib/active_record/test_case.rb +33 -14
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/transactions.rb +145 -40
- data/vendor/rails/activerecord/lib/active_record/validations.rb +290 -195
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/lib/activerecord.rb +0 -0
- data/vendor/rails/activerecord/test/assets/example.log +0 -0
- data/vendor/rails/activerecord/test/assets/flowers.jpg +0 -0
- data/vendor/rails/activerecord/test/cases/aaa_create_tables_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +5 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb +0 -0
- data/vendor/rails/activerecord/test/cases/adapter_test.rb +6 -0
- data/vendor/rails/activerecord/test/cases/aggregations_test.rb +39 -0
- data/vendor/rails/activerecord/test/cases/ar_schema_test.rb +0 -1
- data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +37 -123
- data/vendor/rails/activerecord/test/cases/associations/callbacks_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +8 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +59 -12
- data/vendor/rails/activerecord/test/cases/associations/eager_singularization_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +190 -11
- data/vendor/rails/activerecord/test/cases/associations/extension_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +127 -11
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +175 -147
- data/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +82 -3
- data/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +54 -90
- data/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +80 -1
- data/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +5 -7
- data/vendor/rails/activerecord/test/cases/associations_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/attribute_methods_test.rb +72 -5
- data/vendor/rails/activerecord/test/cases/autosave_association_test.rb +901 -0
- data/vendor/rails/activerecord/test/cases/base_test.rb +120 -28
- data/vendor/rails/activerecord/test/cases/batches_test.rb +61 -0
- data/vendor/rails/activerecord/test/cases/binary_test.rb +1 -5
- data/vendor/rails/activerecord/test/cases/calculations_test.rb +42 -17
- data/vendor/rails/activerecord/test/cases/callbacks_observers_test.rb +38 -0
- data/vendor/rails/activerecord/test/cases/callbacks_test.rb +43 -5
- data/vendor/rails/activerecord/test/cases/class_inheritable_attributes_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/column_alias_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/column_definition_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/connection_pool_test.rb +25 -0
- data/vendor/rails/activerecord/test/cases/connection_test_firebird.rb +0 -0
- data/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +27 -1
- data/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +11 -0
- data/vendor/rails/activerecord/test/cases/database_statements_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/datatype_test_postgresql.rb +1 -0
- data/vendor/rails/activerecord/test/cases/date_time_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/default_test_firebird.rb +0 -0
- data/vendor/rails/activerecord/test/cases/defaults_test.rb +63 -21
- data/vendor/rails/activerecord/test/cases/deprecated_finder_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/dirty_test.rb +52 -3
- data/vendor/rails/activerecord/test/cases/finder_respond_to_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/finder_test.rb +224 -39
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +47 -22
- data/vendor/rails/activerecord/test/cases/helper.rb +32 -10
- data/vendor/rails/activerecord/test/cases/i18n_test.rb +41 -0
- data/vendor/rails/activerecord/test/cases/inheritance_test.rb +4 -4
- data/vendor/rails/activerecord/test/cases/invalid_date_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +1 -1
- data/vendor/rails/activerecord/test/cases/lifecycle_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/locking_test.rb +27 -14
- data/vendor/rails/activerecord/test/cases/method_scoping_test.rb +239 -7
- data/vendor/rails/activerecord/test/cases/migration_test.rb +294 -243
- data/vendor/rails/activerecord/test/cases/migration_test_firebird.rb +0 -0
- data/vendor/rails/activerecord/test/cases/mixin_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/modules_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/multiple_db_test.rb +25 -0
- data/vendor/rails/activerecord/test/cases/named_scope_test.rb +155 -2
- data/vendor/rails/activerecord/test/cases/nested_attributes_test.rb +509 -0
- data/vendor/rails/activerecord/test/cases/pk_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/pooled_connections_test.rb +103 -0
- data/vendor/rails/activerecord/test/cases/query_cache_test.rb +0 -4
- data/vendor/rails/activerecord/test/cases/readonly_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +21 -3
- data/vendor/rails/activerecord/test/cases/reload_models_test.rb +22 -0
- data/vendor/rails/activerecord/test/cases/repair_helper.rb +50 -0
- data/vendor/rails/activerecord/test/cases/reserved_word_test_mysql.rb +0 -0
- data/vendor/rails/activerecord/test/cases/sanitize_test.rb +25 -0
- data/vendor/rails/activerecord/test/cases/schema_authorization_test_postgresql.rb +2 -2
- data/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +0 -1
- data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +0 -0
- data/vendor/rails/activerecord/test/cases/serialization_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/synonym_test_oracle.rb +0 -0
- data/vendor/rails/activerecord/test/cases/transactions_test.rb +237 -22
- data/vendor/rails/activerecord/test/cases/unconnected_test.rb +0 -0
- data/vendor/rails/activerecord/test/cases/validations_i18n_test.rb +915 -0
- data/vendor/rails/activerecord/test/cases/validations_test.rb +274 -213
- data/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +19 -1
- data/vendor/rails/activerecord/test/config.rb +0 -0
- data/vendor/rails/activerecord/test/connections/jdbc_jdbcderby/connection.rb +18 -0
- data/vendor/rails/activerecord/test/connections/jdbc_jdbch2/connection.rb +18 -0
- data/vendor/rails/activerecord/test/connections/jdbc_jdbchsqldb/connection.rb +18 -0
- data/vendor/rails/activerecord/test/connections/jdbc_jdbcmysql/connection.rb +26 -0
- data/vendor/rails/activerecord/test/connections/jdbc_jdbcpostgresql/connection.rb +26 -0
- data/vendor/rails/activerecord/test/connections/jdbc_jdbcsqlite3/connection.rb +25 -0
- data/vendor/rails/activerecord/test/connections/native_db2/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +1 -3
- data/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +0 -0
- data/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +0 -0
- data/vendor/rails/activerecord/test/fixtures/accounts.yml +0 -0
- 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_addresses.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/author_favorites.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/authors.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/binaries.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/books.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/categories.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/categories/special_categories.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/categories/subsubdir/arbitrary_filename.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/categories_ordered.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/categories_posts.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/categorizations.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/clubs.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/comments.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/companies.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/computers.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/courses.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/customers.yml +10 -1
- data/vendor/rails/activerecord/test/fixtures/developers.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/developers_projects.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/edges.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/entrants.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/fk_test_has_fk.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/fk_test_has_pk.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/funny_jokes.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/items.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/jobs.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/legacy_things.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/mateys.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/member_types.yml +6 -0
- data/vendor/rails/activerecord/test/fixtures/members.yml +3 -1
- data/vendor/rails/activerecord/test/fixtures/memberships.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/minimalistics.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/mixed_case_monkeys.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/mixins.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/movies.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/naked/csv/accounts.csv +0 -0
- data/vendor/rails/activerecord/test/fixtures/naked/yml/accounts.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/naked/yml/companies.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/naked/yml/courses.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/organizations.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/owners.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/parrots.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/parrots_pirates.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/people.yml +10 -1
- data/vendor/rails/activerecord/test/fixtures/pets.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/pirates.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/posts.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/price_estimates.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/projects.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/readers.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/references.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/distinct.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/distincts_selects.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/group.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/select.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/reserved_words/values.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/ships.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/sponsors.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/subscribers.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/subscriptions.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/taggings.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/tags.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/tasks.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/topics.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/toys.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/treasures.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/vertices.yml +0 -0
- data/vendor/rails/activerecord/test/fixtures/warehouse-things.yml +0 -0
- data/vendor/rails/activerecord/test/migrations/broken/100_migration_that_raises_exception.rb +10 -0
- data/vendor/rails/activerecord/test/migrations/decimal/1_give_me_big_numbers.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/3_foo.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_1/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_2/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/valid/1_people_have_last_names.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/models/author.rb +4 -0
- data/vendor/rails/activerecord/test/models/auto_id.rb +0 -0
- data/vendor/rails/activerecord/test/models/binary.rb +0 -0
- data/vendor/rails/activerecord/test/models/bird.rb +3 -0
- data/vendor/rails/activerecord/test/models/book.rb +0 -0
- data/vendor/rails/activerecord/test/models/categorization.rb +0 -0
- data/vendor/rails/activerecord/test/models/category.rb +4 -0
- data/vendor/rails/activerecord/test/models/citation.rb +0 -0
- data/vendor/rails/activerecord/test/models/club.rb +6 -0
- data/vendor/rails/activerecord/test/models/column_name.rb +0 -0
- data/vendor/rails/activerecord/test/models/comment.rb +0 -0
- data/vendor/rails/activerecord/test/models/company.rb +28 -1
- data/vendor/rails/activerecord/test/models/company_in_module.rb +0 -0
- data/vendor/rails/activerecord/test/models/computer.rb +0 -0
- data/vendor/rails/activerecord/test/models/contact.rb +0 -0
- data/vendor/rails/activerecord/test/models/course.rb +0 -0
- data/vendor/rails/activerecord/test/models/customer.rb +19 -1
- data/vendor/rails/activerecord/test/models/default.rb +0 -0
- data/vendor/rails/activerecord/test/models/developer.rb +12 -0
- data/vendor/rails/activerecord/test/models/edge.rb +0 -0
- data/vendor/rails/activerecord/test/models/entrant.rb +0 -0
- data/vendor/rails/activerecord/test/models/event.rb +3 -0
- data/vendor/rails/activerecord/test/models/guid.rb +0 -0
- data/vendor/rails/activerecord/test/models/item.rb +0 -0
- data/vendor/rails/activerecord/test/models/job.rb +0 -0
- data/vendor/rails/activerecord/test/models/joke.rb +0 -0
- data/vendor/rails/activerecord/test/models/keyboard.rb +0 -0
- data/vendor/rails/activerecord/test/models/legacy_thing.rb +0 -0
- data/vendor/rails/activerecord/test/models/matey.rb +0 -0
- data/vendor/rails/activerecord/test/models/member.rb +3 -0
- data/vendor/rails/activerecord/test/models/member_detail.rb +5 -0
- data/vendor/rails/activerecord/test/models/member_type.rb +3 -0
- data/vendor/rails/activerecord/test/models/membership.rb +0 -0
- data/vendor/rails/activerecord/test/models/minimalistic.rb +0 -0
- data/vendor/rails/activerecord/test/models/mixed_case_monkey.rb +0 -0
- data/vendor/rails/activerecord/test/models/movie.rb +0 -0
- data/vendor/rails/activerecord/test/models/order.rb +0 -0
- data/vendor/rails/activerecord/test/models/organization.rb +4 -0
- data/vendor/rails/activerecord/test/models/owner.rb +2 -1
- data/vendor/rails/activerecord/test/models/parrot.rb +3 -0
- data/vendor/rails/activerecord/test/models/person.rb +6 -0
- data/vendor/rails/activerecord/test/models/pet.rb +2 -1
- data/vendor/rails/activerecord/test/models/pirate.rb +55 -1
- data/vendor/rails/activerecord/test/models/post.rb +15 -0
- data/vendor/rails/activerecord/test/models/price_estimate.rb +0 -0
- data/vendor/rails/activerecord/test/models/project.rb +1 -0
- data/vendor/rails/activerecord/test/models/reader.rb +0 -0
- data/vendor/rails/activerecord/test/models/reference.rb +0 -0
- data/vendor/rails/activerecord/test/models/reply.rb +6 -0
- data/vendor/rails/activerecord/test/models/ship.rb +8 -1
- data/vendor/rails/activerecord/test/models/ship_part.rb +5 -0
- data/vendor/rails/activerecord/test/models/sponsor.rb +0 -0
- data/vendor/rails/activerecord/test/models/subject.rb +0 -0
- data/vendor/rails/activerecord/test/models/subscriber.rb +0 -0
- data/vendor/rails/activerecord/test/models/subscription.rb +0 -0
- data/vendor/rails/activerecord/test/models/tag.rb +0 -0
- data/vendor/rails/activerecord/test/models/tagging.rb +0 -0
- data/vendor/rails/activerecord/test/models/task.rb +0 -0
- data/vendor/rails/activerecord/test/models/topic.rb +16 -1
- data/vendor/rails/activerecord/test/models/toy.rb +4 -0
- data/vendor/rails/activerecord/test/models/treasure.rb +0 -0
- data/vendor/rails/activerecord/test/models/vertex.rb +0 -0
- data/vendor/rails/activerecord/test/models/warehouse_thing.rb +0 -0
- data/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +0 -0
- data/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +0 -0
- data/vendor/rails/activerecord/test/schema/schema.rb +47 -3
- data/vendor/rails/activerecord/test/schema/schema2.rb +0 -0
- data/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb +0 -0
- data/vendor/rails/activeresource/CHANGELOG +35 -24
- data/vendor/rails/activeresource/README +1 -1
- data/vendor/rails/activeresource/Rakefile +5 -4
- data/vendor/rails/activeresource/lib/active_resource.rb +7 -10
- data/vendor/rails/activeresource/lib/active_resource/base.rb +177 -121
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +28 -17
- data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +14 -13
- data/vendor/rails/activeresource/lib/active_resource/formats.rb +0 -0
- data/vendor/rails/activeresource/lib/active_resource/formats/json_format.rb +7 -7
- data/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +9 -9
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +29 -39
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +16 -30
- data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
- data/vendor/rails/activeresource/lib/activeresource.rb +0 -0
- data/vendor/rails/activeresource/test/abstract_unit.rb +5 -8
- data/vendor/rails/activeresource/test/authorization_test.rb +12 -12
- data/vendor/rails/activeresource/test/base/custom_methods_test.rb +3 -2
- data/vendor/rails/activeresource/test/base/equality_test.rb +9 -0
- data/vendor/rails/activeresource/test/base/load_test.rb +2 -2
- data/vendor/rails/activeresource/test/base_errors_test.rb +0 -0
- data/vendor/rails/activeresource/test/base_test.rb +144 -101
- data/vendor/rails/activeresource/test/connection_test.rb +14 -8
- data/vendor/rails/activeresource/test/fixtures/beast.rb +0 -0
- data/vendor/rails/activeresource/test/fixtures/customer.rb +0 -0
- data/vendor/rails/activeresource/test/fixtures/person.rb +0 -0
- data/vendor/rails/activeresource/test/fixtures/street_address.rb +0 -0
- data/vendor/rails/activeresource/test/format_test.rb +40 -11
- data/vendor/rails/activeresource/test/setter_trap.rb +2 -3
- data/vendor/rails/activesupport/CHANGELOG +194 -83
- data/vendor/rails/activesupport/README +0 -0
- data/vendor/rails/activesupport/lib/active_support.rb +30 -32
- data/vendor/rails/activesupport/lib/active_support/backtrace_cleaner.rb +72 -0
- data/vendor/rails/activesupport/lib/active_support/base64.rb +13 -2
- data/vendor/rails/activesupport/lib/active_support/basic_object.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +27 -21
- data/vendor/rails/activesupport/lib/active_support/cache.rb +128 -47
- data/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +7 -2
- data/vendor/rails/activesupport/lib/active_support/cache/drb_store.rb +2 -3
- data/vendor/rails/activesupport/lib/active_support/cache/file_store.rb +7 -5
- data/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +53 -21
- data/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +16 -2
- data/vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb +104 -0
- data/vendor/rails/activesupport/lib/active_support/cache/synchronized_memory_store.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/callbacks.rb +34 -30
- data/vendor/rails/activesupport/lib/active_support/core_ext.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +30 -12
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +53 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/wrapper.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb +13 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +18 -22
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb +14 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +24 -24
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +20 -19
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +39 -39
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +24 -9
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +3 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +19 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb +6 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +51 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +12 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +4 -20
- data/vendor/rails/activesupport/lib/active_support/core_ext/file/atomic.rb +46 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/float.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/float/rounding.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/float/time.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +33 -55
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/deep_merge.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +6 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +12 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +15 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/time.rb +45 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/agnostics.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/requires.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/load_error.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/logger.rb +136 -7
- data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +11 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +71 -67
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +24 -24
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +60 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +81 -66
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb +8 -7
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/synchronization.rb +39 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +0 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +29 -7
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/metaclass.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +52 -21
- data/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/pathname/clean_within.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/proc.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/process.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/process/daemon.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb +29 -24
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +6 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +5 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/behavior.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/filters.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +22 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/multibyte.rb +81 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/xchar.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +39 -12
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/zones.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/try.rb +36 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/uri.rb +16 -0
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +196 -124
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +33 -60
- data/vendor/rails/activesupport/lib/active_support/duration.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/gzip.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +131 -38
- data/vendor/rails/activesupport/lib/active_support/json.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +23 -4
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +9 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +9 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +10 -11
- data/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +10 -3
- data/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +23 -29
- data/vendor/rails/activesupport/lib/active_support/json/variable.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/locale/en.yml +33 -0
- data/vendor/rails/activesupport/lib/active_support/memoizable.rb +100 -0
- data/vendor/rails/activesupport/lib/active_support/message_encryptor.rb +70 -0
- data/vendor/rails/activesupport/lib/active_support/message_verifier.rb +46 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte.rb +31 -7
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +686 -122
- data/vendor/rails/activesupport/lib/active_support/multibyte/exceptions.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/multibyte/unicode_database.rb +71 -0
- data/vendor/rails/activesupport/lib/active_support/option_merger.rb +6 -8
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +81 -18
- data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/rescuable.rb +108 -0
- data/vendor/rails/activesupport/lib/active_support/secure_random.rb +199 -0
- data/vendor/rails/activesupport/lib/active_support/string_inquirer.rb +11 -1
- data/vendor/rails/activesupport/lib/active_support/test_case.rb +33 -7
- data/vendor/rails/activesupport/lib/active_support/{core_ext/test/unit → testing}/assertions.rb +14 -13
- data/vendor/rails/activesupport/lib/active_support/testing/declarative.rb +21 -0
- data/vendor/rails/activesupport/lib/active_support/testing/default.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/testing/deprecation.rb +55 -0
- data/vendor/rails/activesupport/lib/active_support/testing/performance.rb +452 -0
- data/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +66 -68
- data/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +80 -50
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +12 -4
- data/vendor/rails/activesupport/lib/active_support/values/unicode_tables.dat +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +12 -9
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/README.textile +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/Rakefile +5 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb +199 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb +214 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb +53 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/all.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb +100 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb +125 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.yml +3 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb +568 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{memcache-client-1.5.0 → memcache-client-1.6.5}/memcache.rb +383 -297
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/data_timezone.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/data_timezone_info.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Algiers.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Cairo.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Casablanca.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Harare.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Johannesburg.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Monrovia.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Africa/Nairobi.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/San_Juan.rb +86 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Bogota.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Caracas.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Chicago.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Chihuahua.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Denver.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Godthab.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Guatemala.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Halifax.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Indiana/Indianapolis.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Juneau.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/La_Paz.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Lima.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Los_Angeles.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Mazatlan.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Mexico_City.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Monterrey.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/New_York.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Phoenix.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Regina.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Santiago.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Sao_Paulo.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/St_Johns.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/America/Tijuana.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Almaty.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Baghdad.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Baku.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Bangkok.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Chongqing.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Colombo.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Dhaka.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Hong_Kong.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Irkutsk.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Jakarta.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Jerusalem.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Kabul.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Kamchatka.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Karachi.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Katmandu.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Kolkata.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Krasnoyarsk.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Kuala_Lumpur.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Kuwait.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Magadan.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Muscat.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Novosibirsk.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Rangoon.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Riyadh.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Seoul.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Shanghai.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Singapore.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Taipei.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Tashkent.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Tbilisi.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Tehran.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Tokyo.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Ulaanbaatar.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Urumqi.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Vladivostok.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Yakutsk.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Yekaterinburg.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Asia/Yerevan.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Atlantic/Azores.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Atlantic/Cape_Verde.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Atlantic/South_Georgia.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Adelaide.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Brisbane.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Darwin.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Hobart.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Melbourne.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Perth.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Australia/Sydney.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Etc/UTC.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Amsterdam.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Athens.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Belgrade.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Berlin.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Bratislava.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Brussels.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Bucharest.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Budapest.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Copenhagen.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Dublin.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Helsinki.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Istanbul.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Kiev.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Lisbon.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Ljubljana.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/London.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Madrid.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Minsk.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Moscow.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Paris.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Prague.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Riga.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Rome.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Sarajevo.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Skopje.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Sofia.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Stockholm.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Tallinn.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Vienna.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Vilnius.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Warsaw.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Europe/Zagreb.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Auckland.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Fiji.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Guam.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Honolulu.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Majuro.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Midway.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Noumea.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Pago_Pago.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Port_Moresby.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/definitions/Pacific/Tongatapu.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/info_timezone.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/linked_timezone.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/linked_timezone_info.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/offset_rationals.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/ruby_core_support.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/time_or_datetime.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/timezone.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/timezone_definition.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/timezone_info.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/timezone_offset_info.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/timezone_period.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.11 → tzinfo-0.3.12}/tzinfo/timezone_transition_info.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +0 -0
- data/vendor/rails/activesupport/lib/active_support/xml_mini.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/xml_mini/libxml.rb +133 -0
- data/vendor/rails/activesupport/lib/active_support/xml_mini/nokogiri.rb +77 -0
- data/vendor/rails/activesupport/lib/active_support/xml_mini/rexml.rb +108 -0
- data/vendor/rails/activesupport/lib/activesupport.rb +0 -0
- data/vendor/rails/railties/CHANGELOG +297 -188
- data/vendor/rails/railties/MIT-LICENSE +1 -1
- data/vendor/rails/railties/README +6 -19
- data/vendor/rails/railties/Rakefile +33 -20
- data/vendor/rails/railties/bin/rails +1 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +12 -8
- data/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +0 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info_helper.rb +0 -0
- data/vendor/rails/railties/builtin/rails_info/rails_info_controller.rb +0 -0
- data/vendor/rails/railties/configs/databases/frontbase.yml +0 -0
- data/vendor/rails/railties/configs/databases/ibm_db.yml +62 -0
- data/vendor/rails/railties/configs/databases/mysql.yml +6 -0
- data/vendor/rails/railties/configs/databases/oracle.yml +0 -0
- data/vendor/rails/railties/configs/databases/postgresql.yml +3 -0
- data/vendor/rails/railties/configs/databases/sqlite2.yml +3 -0
- data/vendor/rails/railties/configs/databases/sqlite3.yml +3 -0
- data/vendor/rails/railties/configs/empty.log +0 -0
- data/vendor/rails/railties/configs/initializers/backtrace_silencers.rb +7 -0
- data/vendor/rails/railties/configs/initializers/inflections.rb +0 -0
- data/vendor/rails/railties/configs/initializers/mime_types.rb +0 -0
- data/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +2 -0
- data/vendor/rails/railties/configs/initializers/session_store.rb +15 -0
- data/vendor/rails/railties/configs/locales/en.yml +5 -0
- data/vendor/rails/railties/configs/routes.rb +0 -0
- data/vendor/rails/railties/dispatches/config.ru +7 -0
- data/vendor/rails/railties/dispatches/dispatch.fcgi +1 -1
- data/vendor/rails/railties/dispatches/dispatch.rb +2 -2
- data/vendor/rails/railties/dispatches/gateway.cgi +2 -2
- data/vendor/rails/railties/doc/README_FOR_APP +0 -0
- data/vendor/rails/railties/environments/boot.rb +3 -2
- data/vendor/rails/railties/environments/development.rb +0 -0
- data/vendor/rails/railties/environments/environment.rb +16 -42
- data/vendor/rails/railties/environments/production.rb +10 -4
- data/vendor/rails/railties/environments/test.rb +6 -0
- data/vendor/rails/railties/helpers/application_controller.rb +10 -0
- data/vendor/rails/railties/helpers/application_helper.rb +0 -0
- data/vendor/rails/railties/helpers/performance_test.rb +9 -0
- data/vendor/rails/railties/helpers/test_helper.rb +1 -1
- data/vendor/rails/railties/html/404.html +0 -0
- data/vendor/rails/railties/html/422.html +0 -0
- data/vendor/rails/railties/html/500.html +1 -1
- data/vendor/rails/railties/html/favicon.ico +0 -0
- data/vendor/rails/railties/html/images/rails.png +0 -0
- data/vendor/rails/railties/html/index.html +1 -0
- data/vendor/rails/railties/html/javascripts/application.js +0 -0
- data/vendor/rails/railties/html/javascripts/controls.js +72 -72
- data/vendor/rails/railties/html/javascripts/dragdrop.js +165 -164
- data/vendor/rails/railties/html/javascripts/effects.js +173 -165
- data/vendor/rails/railties/html/javascripts/prototype.js +362 -267
- data/vendor/rails/railties/html/robots.txt +0 -0
- data/vendor/rails/railties/lib/code_statistics.rb +0 -0
- data/vendor/rails/railties/lib/commands.rb +0 -0
- data/vendor/rails/railties/lib/commands/about.rb +1 -1
- data/vendor/rails/railties/lib/commands/console.rb +13 -0
- data/vendor/rails/railties/lib/commands/dbconsole.rb +20 -4
- data/vendor/rails/railties/lib/commands/destroy.rb +0 -0
- data/vendor/rails/railties/lib/commands/ncgi/listener +2 -2
- data/vendor/rails/railties/lib/commands/ncgi/tracker +2 -2
- data/vendor/rails/railties/lib/commands/performance/benchmarker.rb +0 -0
- data/vendor/rails/railties/lib/commands/performance/profiler.rb +0 -0
- data/vendor/rails/railties/lib/commands/plugin.rb +43 -25
- data/vendor/rails/railties/lib/commands/runner.rb +13 -7
- data/vendor/rails/railties/lib/commands/server.rb +100 -25
- data/vendor/rails/railties/lib/commands/update.rb +0 -0
- data/vendor/rails/railties/lib/console_app.rb +4 -4
- data/vendor/rails/railties/lib/console_sandbox.rb +0 -0
- data/vendor/rails/railties/lib/console_with_helpers.rb +2 -23
- data/vendor/rails/railties/lib/dispatcher.rb +1 -1
- data/vendor/rails/railties/lib/fcgi_handler.rb +13 -13
- data/vendor/rails/railties/lib/initializer.rb +256 -66
- data/vendor/rails/railties/lib/performance_test_help.rb +5 -0
- data/vendor/rails/railties/lib/rails/backtrace_cleaner.rb +54 -0
- data/vendor/rails/railties/lib/rails/gem_builder.rb +3 -3
- data/vendor/rails/railties/lib/rails/gem_dependency.rb +209 -56
- data/vendor/rails/railties/lib/rails/plugin.rb +59 -8
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +66 -27
- data/vendor/rails/railties/lib/rails/plugin/locator.rb +1 -1
- data/vendor/rails/railties/lib/rails/rack.rb +8 -0
- data/vendor/rails/railties/lib/rails/rack/debugger.rb +21 -0
- data/vendor/rails/railties/lib/rails/rack/log_tailer.rb +35 -0
- data/vendor/rails/railties/lib/rails/rack/metal.rb +51 -0
- data/vendor/rails/railties/lib/rails/rack/static.rb +46 -0
- data/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb +140 -0
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/base.rb +3 -0
- data/vendor/rails/railties/lib/rails_generator/commands.rb +16 -17
- data/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +4 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +213 -133
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/scm/scm.rb +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/scm/svn.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/template_runner.rb +401 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +12 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +7 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/helper.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/helper_test.rb +4 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/view.html.erb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/helper/USAGE +24 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/helper/helper_generator.rb +25 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/helper/templates/helper.rb +2 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/helper/templates/helper_test.rb +4 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +2 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/metal/USAGE +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/metal/metal_generator.rb +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/metal/templates/metal.rb +12 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/model.rb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/observer_generator.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/observer.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/performance_test/USAGE +8 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/performance_test/performance_test_generator.rb +16 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/performance_test/templates/performance_test.rb +9 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +11 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +1 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/generator.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/install.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/test_helper.rb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +4 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +4 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/helper.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/helper_test.rb +4 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +9 -5
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +12 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +11 -11
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/helper.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/helper_test.rb +4 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/lookup.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/manifest.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/options.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/scripts.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +6 -7
- data/vendor/rails/railties/lib/rails_generator/scripts/generate.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/scripts/update.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +7 -147
- data/vendor/rails/railties/lib/rails_generator/simple_logger.rb +0 -0
- data/vendor/rails/railties/lib/rails_generator/spec.rb +0 -0
- data/vendor/rails/railties/lib/railties_path.rb +0 -0
- data/vendor/rails/railties/lib/ruby_version_check.rb +0 -0
- data/vendor/rails/railties/lib/rubyprof_ext.rb +0 -0
- data/vendor/rails/railties/lib/source_annotation_extractor.rb +0 -0
- data/vendor/rails/railties/lib/tasks/annotations.rake +8 -11
- data/vendor/rails/railties/lib/tasks/databases.rake +55 -21
- data/vendor/rails/railties/lib/tasks/documentation.rake +8 -0
- data/vendor/rails/railties/lib/tasks/framework.rake +31 -2
- data/vendor/rails/railties/lib/tasks/gems.rake +41 -40
- data/vendor/rails/railties/lib/tasks/log.rake +0 -0
- data/vendor/rails/railties/lib/tasks/middleware.rake +7 -0
- data/vendor/rails/railties/lib/tasks/misc.rake +10 -4
- data/vendor/rails/railties/lib/tasks/rails.rb +0 -0
- data/vendor/rails/railties/lib/tasks/routes.rake +0 -0
- data/vendor/rails/railties/lib/tasks/statistics.rake +0 -1
- data/vendor/rails/railties/lib/tasks/testing.rake +30 -9
- data/vendor/rails/railties/lib/test_help.rb +17 -10
- data/vendor/rails/railties/lib/webrick_server.rb +2 -11
- data/vendor/redcloth/Rakefile +0 -0
- data/vendor/redcloth/bin/redcloth +0 -0
- data/vendor/redcloth/doc/CHANGELOG +0 -0
- data/vendor/redcloth/doc/COPYING +0 -0
- data/vendor/redcloth/doc/README +0 -0
- data/vendor/redcloth/doc/REFERENCE +0 -0
- data/vendor/redcloth/doc/make.rb +0 -0
- data/vendor/redcloth/lib/rctodb.rb +0 -0
- data/vendor/redcloth/lib/redcloth.rb +0 -0
- data/vendor/redcloth/run-tests.rb +0 -0
- data/vendor/redcloth/setup.rb +0 -0
- data/vendor/redcloth/tests/code.yml +0 -0
- data/vendor/redcloth/tests/images.yml +0 -0
- data/vendor/redcloth/tests/instiki.yml +0 -0
- data/vendor/redcloth/tests/links.yml +0 -0
- data/vendor/redcloth/tests/lists.yml +0 -0
- data/vendor/redcloth/tests/markdown.yml +0 -0
- data/vendor/redcloth/tests/poignant.yml +0 -0
- data/vendor/redcloth/tests/table.yml +0 -0
- data/vendor/redcloth/tests/textism.yml +0 -0
- metadata +514 -315
- data/app/controllers/admin/abstract_model_controller.rb +0 -134
- data/app/models/response_cache.rb +0 -187
- data/lib/plugins/extension_patches/lib/fixture_loading_extension.rb +0 -76
- data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +0 -93
- data/lib/radiant/compat.rb +0 -10
- data/spec/integration/admin/content_negotiation_spec.rb +0 -27
- data/spec/integration/admin/pages_integration_spec.rb +0 -124
- data/spec/integration/admin/permission_integration_spec.rb +0 -24
- data/spec/integration/admin/snippets_integration_spec.rb +0 -73
- data/spec/integration/admin/user_management_integration_spec.rb +0 -80
- data/spec/integration/admin/user_preferences_integration_spec.rb +0 -19
- data/spec/integration/page_serving_spec.rb +0 -37
- data/spec/models/response_cache_spec.rb +0 -286
- data/stories/all.rb +0 -4
- data/stories/helper.rb +0 -3
- data/vendor/highline/AUTHORS +0 -2
- data/vendor/highline/COPYING +0 -340
- data/vendor/highline/site/highline.css +0 -65
- data/vendor/highline/site/images/logo.png +0 -0
- data/vendor/highline/site/index.html +0 -59
- data/vendor/plugins/dataset/History.txt +0 -9
- data/vendor/plugins/dataset/Manifest.txt +0 -21
- data/vendor/plugins/default_order/README +0 -35
- data/vendor/plugins/default_order/Rakefile +0 -22
- data/vendor/plugins/default_order/init.rb +0 -1
- data/vendor/plugins/default_order/lib/default_order.rb +0 -32
- data/vendor/plugins/default_order/test/default_order_test.rb +0 -5
- data/vendor/plugins/spec_integration/LICENSE +0 -19
- data/vendor/plugins/spec_integration/README +0 -117
- data/vendor/plugins/spec_integration/Rakefile +0 -10
- data/vendor/plugins/spec_integration/lib/spec/integration.rb +0 -10
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl.rb +0 -11
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/form.rb +0 -157
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/integration_example_group.rb +0 -97
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/navigation.rb +0 -102
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions.rb +0 -8
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/action_controller.rb +0 -25
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/hash.rb +0 -48
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers.rb +0 -1
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/display_object.rb +0 -41
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/have_link_to.rb +0 -35
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/navigate_successfully.rb +0 -60
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/showing.rb +0 -44
- data/vendor/plugins/spec_integration/spec/application.rb +0 -3
- data/vendor/plugins/spec_integration/spec/dispatcher.rb +0 -24
- data/vendor/plugins/spec_integration/spec/dsl/form_spec.rb +0 -130
- data/vendor/plugins/spec_integration/spec/dsl/integration_spec_spec.rb +0 -38
- data/vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb +0 -35
- data/vendor/plugins/spec_integration/spec/integration_dsl_controller.rb +0 -5
- data/vendor/plugins/spec_integration/spec/spec.opts +0 -7
- data/vendor/plugins/spec_integration/spec/spec_helper.rb +0 -10
- data/vendor/plugins/spec_integration/tasks/integration.rake +0 -14
- data/vendor/plugins/vizres/CHANGELOG +0 -15
- data/vendor/plugins/vizres/MIT-LICENSE +0 -16
- data/vendor/plugins/vizres/README +0 -80
- data/vendor/plugins/vizres/Rakefile +0 -22
- data/vendor/plugins/vizres/init.rb +0 -1
- data/vendor/plugins/vizres/lib/vizres.rb +0 -33
- data/vendor/plugins/vizres/lib/vizres/browser.rb +0 -36
- data/vendor/plugins/vizres/lib/vizres/scm.rb +0 -27
- data/vendor/plugins/vizres/test/vizres/browser_test.rb +0 -76
- data/vendor/plugins/vizres/test/vizres/scm_test.rb +0 -41
- data/vendor/plugins/vizres/test/vizres_test.rb +0 -55
- data/vendor/plugins/vizres/vizres.gemspec +0 -26
- data/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +0 -14
- data/vendor/rails/actionpack/lib/action_controller/assertions.rb +0 -69
- data/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb +0 -18
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +0 -73
- data/vendor/rails/actionpack/lib/action_controller/components.rb +0 -166
- data/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +0 -169
- data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +0 -340
- data/vendor/rails/actionpack/lib/action_controller/session/drb_server.rb +0 -32
- data/vendor/rails/actionpack/lib/action_controller/session/drb_store.rb +0 -35
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +0 -963
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +0 -972
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +0 -1120
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +0 -4225
- data/vendor/rails/actionpack/lib/action_view/partial_template.rb +0 -70
- data/vendor/rails/actionpack/lib/action_view/template_finder.rb +0 -177
- data/vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb +0 -128
- data/vendor/rails/actionpack/test/controller/cgi_test.rb +0 -116
- data/vendor/rails/actionpack/test/controller/components_test.rb +0 -140
- data/vendor/rails/actionpack/test/controller/custom_handler_test.rb +0 -45
- data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +0 -54
- data/vendor/rails/actionpack/test/controller/integration_upload_test.rb +0 -43
- data/vendor/rails/actionpack/test/controller/new_render_test.rb +0 -945
- data/vendor/rails/actionpack/test/controller/session_fixation_test.rb +0 -89
- data/vendor/rails/actionpack/test/controller/session_management_test.rb +0 -178
- data/vendor/rails/actionpack/test/fixtures/test/block_content_for.erb +0 -2
- data/vendor/rails/actionpack/test/fixtures/test/erb_content_for.erb +0 -2
- data/vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb +0 -9
- data/vendor/rails/actionpack/test/template/template_finder_test.rb +0 -73
- data/vendor/rails/actionpack/test/template/template_object_test.rb +0 -95
- data/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb +0 -1214
- data/vendor/rails/activerecord/test/cases/adapter_test_sqlserver.rb +0 -95
- data/vendor/rails/activerecord/test/cases/table_name_test_sqlserver.rb +0 -23
- data/vendor/rails/activerecord/test/cases/threaded_connections_test.rb +0 -48
- data/vendor/rails/activerecord/test/schema/sqlserver_specific_schema.rb +0 -5
- data/vendor/rails/activesupport/lib/active_support/clean_logger.rb +0 -127
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +0 -66
- data/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/multibyte/generators/generate_tables.rb +0 -149
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/passthru_handler.rb +0 -9
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +0 -564
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler_proc.rb +0 -43
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/San_Juan.rb +0 -170
- data/vendor/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb +0 -1021
- data/vendor/rails/railties/bin/performance/request +0 -3
- data/vendor/rails/railties/bin/process/inspector +0 -3
- data/vendor/rails/railties/bin/process/reaper +0 -3
- data/vendor/rails/railties/bin/process/spawner +0 -3
- data/vendor/rails/railties/configs/apache.conf +0 -40
- data/vendor/rails/railties/configs/lighttpd.conf +0 -54
- data/vendor/rails/railties/helpers/application.rb +0 -15
- data/vendor/rails/railties/lib/commands/performance/request.rb +0 -6
- data/vendor/rails/railties/lib/commands/process/inspector.rb +0 -68
- data/vendor/rails/railties/lib/commands/process/reaper.rb +0 -149
- data/vendor/rails/railties/lib/commands/process/spawner.rb +0 -219
- data/vendor/rails/railties/lib/commands/process/spinner.rb +0 -57
- data/vendor/rails/railties/lib/commands/servers/base.rb +0 -31
- data/vendor/rails/railties/lib/commands/servers/lighttpd.rb +0 -94
- data/vendor/rails/railties/lib/commands/servers/mongrel.rb +0 -69
- data/vendor/rails/railties/lib/commands/servers/new_mongrel.rb +0 -16
- data/vendor/rails/railties/lib/commands/servers/webrick.rb +0 -66
- data/vendor/rails/railties/lib/rails/mongrel_server/commands.rb +0 -342
- data/vendor/rails/railties/lib/rails/mongrel_server/handler.rb +0 -55
@@ -0,0 +1,349 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
# AutosaveAssociation is a module that takes care of automatically saving
|
3
|
+
# your associations when the parent is saved. In addition to saving, it
|
4
|
+
# also destroys any associations that were marked for destruction.
|
5
|
+
# (See mark_for_destruction and marked_for_destruction?)
|
6
|
+
#
|
7
|
+
# Saving of the parent, its associations, and the destruction of marked
|
8
|
+
# associations, all happen inside 1 transaction. This should never leave the
|
9
|
+
# database in an inconsistent state after, for instance, mass assigning
|
10
|
+
# attributes and saving them.
|
11
|
+
#
|
12
|
+
# If validations for any of the associations fail, their error messages will
|
13
|
+
# be applied to the parent.
|
14
|
+
#
|
15
|
+
# Note that it also means that associations marked for destruction won't
|
16
|
+
# be destroyed directly. They will however still be marked for destruction.
|
17
|
+
#
|
18
|
+
# === One-to-one Example
|
19
|
+
#
|
20
|
+
# Consider a Post model with one Author:
|
21
|
+
#
|
22
|
+
# class Post
|
23
|
+
# has_one :author, :autosave => true
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# Saving changes to the parent and its associated model can now be performed
|
27
|
+
# automatically _and_ atomically:
|
28
|
+
#
|
29
|
+
# post = Post.find(1)
|
30
|
+
# post.title # => "The current global position of migrating ducks"
|
31
|
+
# post.author.name # => "alloy"
|
32
|
+
#
|
33
|
+
# post.title = "On the migration of ducks"
|
34
|
+
# post.author.name = "Eloy Duran"
|
35
|
+
#
|
36
|
+
# post.save
|
37
|
+
# post.reload
|
38
|
+
# post.title # => "On the migration of ducks"
|
39
|
+
# post.author.name # => "Eloy Duran"
|
40
|
+
#
|
41
|
+
# Destroying an associated model, as part of the parent's save action, is as
|
42
|
+
# simple as marking it for destruction:
|
43
|
+
#
|
44
|
+
# post.author.mark_for_destruction
|
45
|
+
# post.author.marked_for_destruction? # => true
|
46
|
+
#
|
47
|
+
# Note that the model is _not_ yet removed from the database:
|
48
|
+
# id = post.author.id
|
49
|
+
# Author.find_by_id(id).nil? # => false
|
50
|
+
#
|
51
|
+
# post.save
|
52
|
+
# post.reload.author # => nil
|
53
|
+
#
|
54
|
+
# Now it _is_ removed from the database:
|
55
|
+
# Author.find_by_id(id).nil? # => true
|
56
|
+
#
|
57
|
+
# === One-to-many Example
|
58
|
+
#
|
59
|
+
# Consider a Post model with many Comments:
|
60
|
+
#
|
61
|
+
# class Post
|
62
|
+
# has_many :comments, :autosave => true
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# Saving changes to the parent and its associated model can now be performed
|
66
|
+
# automatically _and_ atomically:
|
67
|
+
#
|
68
|
+
# post = Post.find(1)
|
69
|
+
# post.title # => "The current global position of migrating ducks"
|
70
|
+
# post.comments.first.body # => "Wow, awesome info thanks!"
|
71
|
+
# post.comments.last.body # => "Actually, your article should be named differently."
|
72
|
+
#
|
73
|
+
# post.title = "On the migration of ducks"
|
74
|
+
# post.comments.last.body = "Actually, your article should be named differently. [UPDATED]: You are right, thanks."
|
75
|
+
#
|
76
|
+
# post.save
|
77
|
+
# post.reload
|
78
|
+
# post.title # => "On the migration of ducks"
|
79
|
+
# post.comments.last.body # => "Actually, your article should be named differently. [UPDATED]: You are right, thanks."
|
80
|
+
#
|
81
|
+
# Destroying one of the associated models members, as part of the parent's
|
82
|
+
# save action, is as simple as marking it for destruction:
|
83
|
+
#
|
84
|
+
# post.comments.last.mark_for_destruction
|
85
|
+
# post.comments.last.marked_for_destruction? # => true
|
86
|
+
# post.comments.length # => 2
|
87
|
+
#
|
88
|
+
# Note that the model is _not_ yet removed from the database:
|
89
|
+
# id = post.comments.last.id
|
90
|
+
# Comment.find_by_id(id).nil? # => false
|
91
|
+
#
|
92
|
+
# post.save
|
93
|
+
# post.reload.comments.length # => 1
|
94
|
+
#
|
95
|
+
# Now it _is_ removed from the database:
|
96
|
+
# Comment.find_by_id(id).nil? # => true
|
97
|
+
#
|
98
|
+
# === Validation
|
99
|
+
#
|
100
|
+
# Validation is performed on the parent as usual, but also on all autosave
|
101
|
+
# enabled associations. If any of the associations fail validation, its
|
102
|
+
# error messages will be applied on the parents errors object and validation
|
103
|
+
# of the parent will fail.
|
104
|
+
#
|
105
|
+
# Consider a Post model with Author which validates the presence of its name
|
106
|
+
# attribute:
|
107
|
+
#
|
108
|
+
# class Post
|
109
|
+
# has_one :author, :autosave => true
|
110
|
+
# end
|
111
|
+
#
|
112
|
+
# class Author
|
113
|
+
# validates_presence_of :name
|
114
|
+
# end
|
115
|
+
#
|
116
|
+
# post = Post.find(1)
|
117
|
+
# post.author.name = ''
|
118
|
+
# post.save # => false
|
119
|
+
# post.errors # => #<ActiveRecord::Errors:0x174498c @errors={"author_name"=>["can't be blank"]}, @base=#<Post ...>>
|
120
|
+
#
|
121
|
+
# No validations will be performed on the associated models when validations
|
122
|
+
# are skipped for the parent:
|
123
|
+
#
|
124
|
+
# post = Post.find(1)
|
125
|
+
# post.author.name = ''
|
126
|
+
# post.save(false) # => true
|
127
|
+
module AutosaveAssociation
|
128
|
+
ASSOCIATION_TYPES = %w{ has_one belongs_to has_many has_and_belongs_to_many }
|
129
|
+
|
130
|
+
def self.included(base)
|
131
|
+
base.class_eval do
|
132
|
+
base.extend(ClassMethods)
|
133
|
+
alias_method_chain :reload, :autosave_associations
|
134
|
+
|
135
|
+
ASSOCIATION_TYPES.each do |type|
|
136
|
+
base.send("valid_keys_for_#{type}_association") << :autosave
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
module ClassMethods
|
142
|
+
private
|
143
|
+
|
144
|
+
# def belongs_to(name, options = {})
|
145
|
+
# super
|
146
|
+
# add_autosave_association_callbacks(reflect_on_association(name))
|
147
|
+
# end
|
148
|
+
ASSOCIATION_TYPES.each do |type|
|
149
|
+
module_eval %{
|
150
|
+
def #{type}(name, options = {})
|
151
|
+
super
|
152
|
+
add_autosave_association_callbacks(reflect_on_association(name))
|
153
|
+
end
|
154
|
+
}
|
155
|
+
end
|
156
|
+
|
157
|
+
# Adds a validate and save callback for the association as specified by
|
158
|
+
# the +reflection+.
|
159
|
+
def add_autosave_association_callbacks(reflection)
|
160
|
+
save_method = "autosave_associated_records_for_#{reflection.name}"
|
161
|
+
validation_method = "validate_associated_records_for_#{reflection.name}"
|
162
|
+
validate validation_method
|
163
|
+
|
164
|
+
case reflection.macro
|
165
|
+
when :has_many, :has_and_belongs_to_many
|
166
|
+
before_save :before_save_collection_association
|
167
|
+
|
168
|
+
define_method(save_method) { save_collection_association(reflection) }
|
169
|
+
# Doesn't use after_save as that would save associations added in after_create/after_update twice
|
170
|
+
after_create save_method
|
171
|
+
after_update save_method
|
172
|
+
|
173
|
+
define_method(validation_method) { validate_collection_association(reflection) }
|
174
|
+
else
|
175
|
+
case reflection.macro
|
176
|
+
when :has_one
|
177
|
+
define_method(save_method) { save_has_one_association(reflection) }
|
178
|
+
after_save save_method
|
179
|
+
when :belongs_to
|
180
|
+
define_method(save_method) { save_belongs_to_association(reflection) }
|
181
|
+
before_save save_method
|
182
|
+
end
|
183
|
+
define_method(validation_method) { validate_single_association(reflection) }
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Reloads the attributes of the object as usual and removes a mark for destruction.
|
189
|
+
def reload_with_autosave_associations(options = nil)
|
190
|
+
@marked_for_destruction = false
|
191
|
+
reload_without_autosave_associations(options)
|
192
|
+
end
|
193
|
+
|
194
|
+
# Marks this record to be destroyed as part of the parents save transaction.
|
195
|
+
# This does _not_ actually destroy the record yet, rather it will be destroyed when <tt>parent.save</tt> is called.
|
196
|
+
#
|
197
|
+
# Only useful if the <tt>:autosave</tt> option on the parent is enabled for this associated model.
|
198
|
+
def mark_for_destruction
|
199
|
+
@marked_for_destruction = true
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns whether or not this record will be destroyed as part of the parents save transaction.
|
203
|
+
#
|
204
|
+
# Only useful if the <tt>:autosave</tt> option on the parent is enabled for this associated model.
|
205
|
+
def marked_for_destruction?
|
206
|
+
@marked_for_destruction
|
207
|
+
end
|
208
|
+
|
209
|
+
private
|
210
|
+
|
211
|
+
# Returns the record for an association collection that should be validated
|
212
|
+
# or saved. If +autosave+ is +false+ only new records will be returned,
|
213
|
+
# unless the parent is/was a new record itself.
|
214
|
+
def associated_records_to_validate_or_save(association, new_record, autosave)
|
215
|
+
if new_record
|
216
|
+
association
|
217
|
+
elsif association.loaded?
|
218
|
+
autosave ? association : association.select { |record| record.new_record? }
|
219
|
+
else
|
220
|
+
autosave ? association.target : association.target.select { |record| record.new_record? }
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Validate the association if <tt>:validate</tt> or <tt>:autosave</tt> is
|
225
|
+
# turned on for the association specified by +reflection+.
|
226
|
+
def validate_single_association(reflection)
|
227
|
+
if reflection.options[:validate] == true || reflection.options[:autosave] == true
|
228
|
+
if (association = association_instance_get(reflection.name)) && !association.target.nil?
|
229
|
+
association_valid?(reflection, association)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
# Validate the associated records if <tt>:validate</tt> or
|
235
|
+
# <tt>:autosave</tt> is turned on for the association specified by
|
236
|
+
# +reflection+.
|
237
|
+
def validate_collection_association(reflection)
|
238
|
+
if reflection.options[:validate] != false && association = association_instance_get(reflection.name)
|
239
|
+
if records = associated_records_to_validate_or_save(association, new_record?, reflection.options[:autosave])
|
240
|
+
records.each { |record| association_valid?(reflection, record) }
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
# Returns whether or not the association is valid and applies any errors to
|
246
|
+
# the parent, <tt>self</tt>, if it wasn't. Skips any <tt>:autosave</tt>
|
247
|
+
# enabled records if they're marked_for_destruction?.
|
248
|
+
def association_valid?(reflection, association)
|
249
|
+
unless valid = association.valid?
|
250
|
+
if reflection.options[:autosave]
|
251
|
+
unless association.marked_for_destruction?
|
252
|
+
association.errors.each do |attribute, message|
|
253
|
+
attribute = "#{reflection.name}_#{attribute}"
|
254
|
+
errors.add(attribute, message) unless errors.on(attribute)
|
255
|
+
end
|
256
|
+
end
|
257
|
+
else
|
258
|
+
errors.add(reflection.name)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
valid
|
262
|
+
end
|
263
|
+
|
264
|
+
# Is used as a before_save callback to check while saving a collection
|
265
|
+
# association whether or not the parent was a new record before saving.
|
266
|
+
def before_save_collection_association
|
267
|
+
@new_record_before_save = new_record?
|
268
|
+
true
|
269
|
+
end
|
270
|
+
|
271
|
+
# Saves any new associated records, or all loaded autosave associations if
|
272
|
+
# <tt>:autosave</tt> is enabled on the association.
|
273
|
+
#
|
274
|
+
# In addition, it destroys all children that were marked for destruction
|
275
|
+
# with mark_for_destruction.
|
276
|
+
#
|
277
|
+
# This all happens inside a transaction, _if_ the Transactions module is included into
|
278
|
+
# ActiveRecord::Base after the AutosaveAssociation module, which it does by default.
|
279
|
+
def save_collection_association(reflection)
|
280
|
+
if association = association_instance_get(reflection.name)
|
281
|
+
autosave = reflection.options[:autosave]
|
282
|
+
|
283
|
+
if records = associated_records_to_validate_or_save(association, @new_record_before_save, autosave)
|
284
|
+
records.each do |record|
|
285
|
+
if autosave && record.marked_for_destruction?
|
286
|
+
association.destroy(record)
|
287
|
+
elsif @new_record_before_save || record.new_record?
|
288
|
+
if autosave
|
289
|
+
association.send(:insert_record, record, false, false)
|
290
|
+
else
|
291
|
+
association.send(:insert_record, record)
|
292
|
+
end
|
293
|
+
elsif autosave
|
294
|
+
record.save(false)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
# reconstruct the SQL queries now that we know the owner's id
|
300
|
+
association.send(:construct_sql) if association.respond_to?(:construct_sql)
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
# Saves the associated record if it's new or <tt>:autosave</tt> is enabled
|
305
|
+
# on the association.
|
306
|
+
#
|
307
|
+
# In addition, it will destroy the association if it was marked for
|
308
|
+
# destruction with mark_for_destruction.
|
309
|
+
#
|
310
|
+
# This all happens inside a transaction, _if_ the Transactions module is included into
|
311
|
+
# ActiveRecord::Base after the AutosaveAssociation module, which it does by default.
|
312
|
+
def save_has_one_association(reflection)
|
313
|
+
if (association = association_instance_get(reflection.name)) && !association.target.nil?
|
314
|
+
if reflection.options[:autosave] && association.marked_for_destruction?
|
315
|
+
association.destroy
|
316
|
+
elsif new_record? || association.new_record? || association[reflection.primary_key_name] != id || reflection.options[:autosave]
|
317
|
+
association[reflection.primary_key_name] = id
|
318
|
+
association.save(false)
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
# Saves the associated record if it's new or <tt>:autosave</tt> is enabled
|
324
|
+
# on the association.
|
325
|
+
#
|
326
|
+
# In addition, it will destroy the association if it was marked for
|
327
|
+
# destruction with mark_for_destruction.
|
328
|
+
#
|
329
|
+
# This all happens inside a transaction, _if_ the Transactions module is included into
|
330
|
+
# ActiveRecord::Base after the AutosaveAssociation module, which it does by default.
|
331
|
+
def save_belongs_to_association(reflection)
|
332
|
+
if association = association_instance_get(reflection.name)
|
333
|
+
if reflection.options[:autosave] && association.marked_for_destruction?
|
334
|
+
association.destroy
|
335
|
+
else
|
336
|
+
association.save(false) if association.new_record? || reflection.options[:autosave]
|
337
|
+
|
338
|
+
if association.updated?
|
339
|
+
self[reflection.primary_key_name] = association.id
|
340
|
+
# TODO: Removing this code doesn't seem to matter…
|
341
|
+
if reflection.options[:polymorphic]
|
342
|
+
self[reflection.options[:foreign_type]] = association.class.base_class.name.to_s
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
@@ -6,7 +6,7 @@ module ActiveRecord #:nodoc:
|
|
6
6
|
class ActiveRecordError < StandardError
|
7
7
|
end
|
8
8
|
|
9
|
-
# Raised when the single-table inheritance mechanism
|
9
|
+
# Raised when the single-table inheritance mechanism fails to locate the subclass
|
10
10
|
# (for example due to improper usage of column that +inheritance_column+ points to).
|
11
11
|
class SubclassNotFound < ActiveRecordError #:nodoc:
|
12
12
|
end
|
@@ -83,8 +83,33 @@ module ActiveRecord #:nodoc:
|
|
83
83
|
class ReadOnlyRecord < ActiveRecordError
|
84
84
|
end
|
85
85
|
|
86
|
-
#
|
87
|
-
#
|
86
|
+
# ActiveRecord::Transactions::ClassMethods.transaction uses this exception
|
87
|
+
# to distinguish a deliberate rollback from other exceptional situations.
|
88
|
+
# Normally, raising an exception will cause the +transaction+ method to rollback
|
89
|
+
# the database transaction *and* pass on the exception. But if you raise an
|
90
|
+
# ActiveRecord::Rollback exception, then the database transaction will be rolled back,
|
91
|
+
# without passing on the exception.
|
92
|
+
#
|
93
|
+
# For example, you could do this in your controller to rollback a transaction:
|
94
|
+
#
|
95
|
+
# class BooksController < ActionController::Base
|
96
|
+
# def create
|
97
|
+
# Book.transaction do
|
98
|
+
# book = Book.new(params[:book])
|
99
|
+
# book.save!
|
100
|
+
# if today_is_friday?
|
101
|
+
# # The system must fail on Friday so that our support department
|
102
|
+
# # won't be out of job. We silently rollback this transaction
|
103
|
+
# # without telling the user.
|
104
|
+
# raise ActiveRecord::Rollback, "Call tech support!"
|
105
|
+
# end
|
106
|
+
# end
|
107
|
+
# # ActiveRecord::Rollback is the only exception that won't be passed on
|
108
|
+
# # by ActiveRecord::Base.transaction, so this line will still be reached
|
109
|
+
# # even on Friday.
|
110
|
+
# redirect_to root_url
|
111
|
+
# end
|
112
|
+
# end
|
88
113
|
class Rollback < ActiveRecordError
|
89
114
|
end
|
90
115
|
|
@@ -97,7 +122,11 @@ module ActiveRecord #:nodoc:
|
|
97
122
|
class MissingAttributeError < NoMethodError
|
98
123
|
end
|
99
124
|
|
100
|
-
# Raised when
|
125
|
+
# Raised when unknown attributes are supplied via mass assignment.
|
126
|
+
class UnknownAttributeError < NoMethodError
|
127
|
+
end
|
128
|
+
|
129
|
+
# Raised when an error occurred while doing a mass assignment to an attribute through the
|
101
130
|
# <tt>attributes=</tt> method. The exception has an +attribute+ property that is the name of the
|
102
131
|
# offending attribute.
|
103
132
|
class AttributeAssignmentError < ActiveRecordError
|
@@ -245,7 +274,7 @@ module ActiveRecord #:nodoc:
|
|
245
274
|
# == Dynamic attribute-based finders
|
246
275
|
#
|
247
276
|
# Dynamic attribute-based finders are a cleaner way of getting (and/or creating) objects by simple queries without turning to SQL. They work by
|
248
|
-
# appending the name of an attribute to <tt>find_by_</tt> or <tt>find_all_by_</tt>, so you get finders like <tt>Person.find_by_user_name</tt>,
|
277
|
+
# appending the name of an attribute to <tt>find_by_</tt>, <tt>find_last_by_</tt>, or <tt>find_all_by_</tt>, so you get finders like <tt>Person.find_by_user_name</tt>,
|
249
278
|
# <tt>Person.find_all_by_last_name</tt>, and <tt>Payment.find_by_transaction_id</tt>. So instead of writing
|
250
279
|
# <tt>Person.find(:first, :conditions => ["user_name = ?", user_name])</tt>, you just do <tt>Person.find_by_user_name(user_name)</tt>.
|
251
280
|
# And instead of writing <tt>Person.find(:all, :conditions => ["last_name = ?", last_name])</tt>, you just do <tt>Person.find_all_by_last_name(last_name)</tt>.
|
@@ -258,6 +287,7 @@ module ActiveRecord #:nodoc:
|
|
258
287
|
# It's even possible to use all the additional parameters to find. For example, the full interface for <tt>Payment.find_all_by_amount</tt>
|
259
288
|
# is actually <tt>Payment.find_all_by_amount(amount, options)</tt>. And the full interface to <tt>Person.find_by_user_name</tt> is
|
260
289
|
# actually <tt>Person.find_by_user_name(user_name, options)</tt>. So you could call <tt>Payment.find_all_by_amount(50, :order => "created_on")</tt>.
|
290
|
+
# Also you may call <tt>Payment.find_last_by_amount(amount, options)</tt> returning the last record matching that amount and options.
|
261
291
|
#
|
262
292
|
# The same dynamic finder style can be used to create the object if it doesn't already exist. This dynamic finder is called with
|
263
293
|
# <tt>find_or_create_by_</tt> and will return the object if it already exists and otherwise creates it, then returns it. Protected attributes won't be set unless they are given in a block. For example:
|
@@ -271,7 +301,7 @@ module ActiveRecord #:nodoc:
|
|
271
301
|
# # Now 'Bob' exist and is an 'admin'
|
272
302
|
# User.find_or_create_by_name('Bob', :age => 40) { |u| u.admin = true }
|
273
303
|
#
|
274
|
-
# Use the <tt>find_or_initialize_by_</tt> finder if you want to return a new record without saving it first. Protected attributes won't be
|
304
|
+
# Use the <tt>find_or_initialize_by_</tt> finder if you want to return a new record without saving it first. Protected attributes won't be set unless they are given in a block. For example:
|
275
305
|
#
|
276
306
|
# # No 'Winter' tag exists
|
277
307
|
# winter = Tag.find_or_initialize_by_name("Winter")
|
@@ -297,7 +327,7 @@ module ActiveRecord #:nodoc:
|
|
297
327
|
# User.find(user.id).preferences # => { "background" => "black", "display" => large }
|
298
328
|
#
|
299
329
|
# You can also specify a class option as the second parameter that'll raise an exception if a serialized object is retrieved as a
|
300
|
-
#
|
330
|
+
# descendant of a class not in the hierarchy. Example:
|
301
331
|
#
|
302
332
|
# class User < ActiveRecord::Base
|
303
333
|
# serialize :preferences, Hash
|
@@ -359,6 +389,8 @@ module ActiveRecord #:nodoc:
|
|
359
389
|
# So it's possible to assign a logger to the class through <tt>Base.logger=</tt> which will then be used by all
|
360
390
|
# instances in the current object space.
|
361
391
|
class Base
|
392
|
+
##
|
393
|
+
# :singleton-method:
|
362
394
|
# Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then passed
|
363
395
|
# on to any new database connections made and which can be retrieved on both a class and instance level by calling +logger+.
|
364
396
|
cattr_accessor :logger, :instance_writer => false
|
@@ -385,9 +417,38 @@ module ActiveRecord #:nodoc:
|
|
385
417
|
|
386
418
|
@@subclasses = {}
|
387
419
|
|
420
|
+
##
|
421
|
+
# :singleton-method:
|
422
|
+
# Contains the database configuration - as is typically stored in config/database.yml -
|
423
|
+
# as a Hash.
|
424
|
+
#
|
425
|
+
# For example, the following database.yml...
|
426
|
+
#
|
427
|
+
# development:
|
428
|
+
# adapter: sqlite3
|
429
|
+
# database: db/development.sqlite3
|
430
|
+
#
|
431
|
+
# production:
|
432
|
+
# adapter: sqlite3
|
433
|
+
# database: db/production.sqlite3
|
434
|
+
#
|
435
|
+
# ...would result in ActiveRecord::Base.configurations to look like this:
|
436
|
+
#
|
437
|
+
# {
|
438
|
+
# 'development' => {
|
439
|
+
# 'adapter' => 'sqlite3',
|
440
|
+
# 'database' => 'db/development.sqlite3'
|
441
|
+
# },
|
442
|
+
# 'production' => {
|
443
|
+
# 'adapter' => 'sqlite3',
|
444
|
+
# 'database' => 'db/production.sqlite3'
|
445
|
+
# }
|
446
|
+
# }
|
388
447
|
cattr_accessor :configurations, :instance_writer => false
|
389
448
|
@@configurations = {}
|
390
449
|
|
450
|
+
##
|
451
|
+
# :singleton-method:
|
391
452
|
# Accessor for the prefix type that will be prepended to every primary key column name. The options are :table_name and
|
392
453
|
# :table_name_with_underscore. If the first is specified, the Product class will look for "productid" instead of "id" as
|
393
454
|
# the primary column. If the latter is specified, the Product class will look for "product_id" instead of "id". Remember
|
@@ -395,41 +456,46 @@ module ActiveRecord #:nodoc:
|
|
395
456
|
cattr_accessor :primary_key_prefix_type, :instance_writer => false
|
396
457
|
@@primary_key_prefix_type = nil
|
397
458
|
|
459
|
+
##
|
460
|
+
# :singleton-method:
|
398
461
|
# Accessor for the name of the prefix string to prepend to every table name. So if set to "basecamp_", all
|
399
462
|
# table names will be named like "basecamp_projects", "basecamp_people", etc. This is a convenient way of creating a namespace
|
400
463
|
# for tables in a shared database. By default, the prefix is the empty string.
|
401
464
|
cattr_accessor :table_name_prefix, :instance_writer => false
|
402
465
|
@@table_name_prefix = ""
|
403
466
|
|
467
|
+
##
|
468
|
+
# :singleton-method:
|
404
469
|
# Works like +table_name_prefix+, but appends instead of prepends (set to "_basecamp" gives "projects_basecamp",
|
405
470
|
# "people_basecamp"). By default, the suffix is the empty string.
|
406
471
|
cattr_accessor :table_name_suffix, :instance_writer => false
|
407
472
|
@@table_name_suffix = ""
|
408
473
|
|
474
|
+
##
|
475
|
+
# :singleton-method:
|
409
476
|
# Indicates whether table names should be the pluralized versions of the corresponding class names.
|
410
477
|
# If true, the default table name for a Product class will be +products+. If false, it would just be +product+.
|
411
478
|
# See table_name for the full rules on table/class naming. This is true, by default.
|
412
479
|
cattr_accessor :pluralize_table_names, :instance_writer => false
|
413
480
|
@@pluralize_table_names = true
|
414
481
|
|
482
|
+
##
|
483
|
+
# :singleton-method:
|
415
484
|
# Determines whether to use ANSI codes to colorize the logging statements committed by the connection adapter. These colors
|
416
485
|
# make it much easier to overview things during debugging (when used through a reader like +tail+ and on a black background), but
|
417
486
|
# may complicate matters if you use software like syslog. This is true, by default.
|
418
487
|
cattr_accessor :colorize_logging, :instance_writer => false
|
419
488
|
@@colorize_logging = true
|
420
489
|
|
490
|
+
##
|
491
|
+
# :singleton-method:
|
421
492
|
# Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database.
|
422
493
|
# This is set to :local by default.
|
423
494
|
cattr_accessor :default_timezone, :instance_writer => false
|
424
495
|
@@default_timezone = :local
|
425
496
|
|
426
|
-
|
427
|
-
#
|
428
|
-
# and periodically call verify_active_connections! to clear out connections
|
429
|
-
# assigned to stale threads.
|
430
|
-
cattr_accessor :allow_concurrency, :instance_writer => false
|
431
|
-
@@allow_concurrency = false
|
432
|
-
|
497
|
+
##
|
498
|
+
# :singleton-method:
|
433
499
|
# Specifies the format to use when dumping the database schema with Rails'
|
434
500
|
# Rakefile. If :sql, the schema is dumped as (potentially database-
|
435
501
|
# specific) SQL statements. If :ruby, the schema is dumped as an
|
@@ -439,6 +505,8 @@ module ActiveRecord #:nodoc:
|
|
439
505
|
cattr_accessor :schema_format , :instance_writer => false
|
440
506
|
@@schema_format = :ruby
|
441
507
|
|
508
|
+
##
|
509
|
+
# :singleton-method:
|
442
510
|
# Specify whether or not to use timestamps for migration numbers
|
443
511
|
cattr_accessor :timestamped_migrations , :instance_writer => false
|
444
512
|
@@timestamped_migrations = true
|
@@ -447,6 +515,10 @@ module ActiveRecord #:nodoc:
|
|
447
515
|
superclass_delegating_accessor :store_full_sti_class
|
448
516
|
self.store_full_sti_class = false
|
449
517
|
|
518
|
+
# Stores the default scope for the class
|
519
|
+
class_inheritable_accessor :default_scoping, :instance_writer => false
|
520
|
+
self.default_scoping = []
|
521
|
+
|
450
522
|
class << self # Class methods
|
451
523
|
# Find operates with four different retrieval approaches:
|
452
524
|
#
|
@@ -464,21 +536,23 @@ module ActiveRecord #:nodoc:
|
|
464
536
|
#
|
465
537
|
# All approaches accept an options hash as their last parameter.
|
466
538
|
#
|
467
|
-
# ====
|
539
|
+
# ==== Parameters
|
468
540
|
#
|
469
|
-
# * <tt>:conditions</tt> - An SQL fragment like "administrator = 1"
|
541
|
+
# * <tt>:conditions</tt> - An SQL fragment like "administrator = 1", <tt>[ "user_name = ?", username ]</tt>, or <tt>["user_name = :user_name", { :user_name => user_name }]</tt>. See conditions in the intro.
|
470
542
|
# * <tt>:order</tt> - An SQL fragment like "created_at DESC, name".
|
471
543
|
# * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
|
544
|
+
# * <tt>:having</tt> - Combined with +:group+ this can be used to filter the records that a <tt>GROUP BY</tt> returns. Uses the <tt>HAVING</tt> SQL-clause.
|
472
545
|
# * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
|
473
546
|
# * <tt>:offset</tt> - An integer determining the offset from where the rows should be fetched. So at 5, it would skip rows 0 through 4.
|
474
|
-
# * <tt>:joins</tt> - Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed)
|
475
|
-
#
|
547
|
+
# * <tt>:joins</tt> - Either an SQL fragment for additional joins like "LEFT JOIN comments ON comments.post_id = id" (rarely needed),
|
548
|
+
# named associations in the same form used for the <tt>:include</tt> option, which will perform an <tt>INNER JOIN</tt> on the associated table(s),
|
549
|
+
# or an array containing a mixture of both strings and named associations.
|
476
550
|
# If the value is a string, then the records will be returned read-only since they will have attributes that do not correspond to the table's columns.
|
477
551
|
# Pass <tt>:readonly => false</tt> to override.
|
478
552
|
# * <tt>:include</tt> - Names associations that should be loaded alongside. The symbols named refer
|
479
553
|
# to already defined associations. See eager loading under Associations.
|
480
554
|
# * <tt>:select</tt> - By default, this is "*" as in "SELECT * FROM", but can be changed if you, for example, want to do a join but not
|
481
|
-
# include the joined columns.
|
555
|
+
# include the joined columns. Takes a string with the SELECT SQL fragment (e.g. "id, name").
|
482
556
|
# * <tt>:from</tt> - By default, this is the table name of the class, but can be changed to an alternate table name (or even the name
|
483
557
|
# of a database view).
|
484
558
|
# * <tt>:readonly</tt> - Mark the returned records read-only so they cannot be saved or updated.
|
@@ -503,6 +577,7 @@ module ActiveRecord #:nodoc:
|
|
503
577
|
# # find first
|
504
578
|
# Person.find(:first) # returns the first object fetched by SELECT * FROM people
|
505
579
|
# Person.find(:first, :conditions => [ "user_name = ?", user_name])
|
580
|
+
# Person.find(:first, :conditions => [ "user_name = :u", { :u => user_name }])
|
506
581
|
# Person.find(:first, :order => "created_on DESC", :offset => 5)
|
507
582
|
#
|
508
583
|
# # find last
|
@@ -562,8 +637,8 @@ module ActiveRecord #:nodoc:
|
|
562
637
|
|
563
638
|
# Executes a custom SQL query against your database and returns all the results. The results will
|
564
639
|
# be returned as an array with columns requested encapsulated as attributes of the model you call
|
565
|
-
# this method from. If you call
|
566
|
-
# object with the attributes you specified in the SQL query.
|
640
|
+
# this method from. If you call <tt>Product.find_by_sql</tt> then the results will be returned in
|
641
|
+
# a Product object with the attributes you specified in the SQL query.
|
567
642
|
#
|
568
643
|
# If you call a complicated SQL query which spans multiple tables the columns specified by the
|
569
644
|
# SELECT will be attributes of the model, whether or not they are columns of the corresponding
|
@@ -572,7 +647,7 @@ module ActiveRecord #:nodoc:
|
|
572
647
|
# The +sql+ parameter is a full SQL query as a string. It will be called as is, there will be
|
573
648
|
# no database agnostic conversions performed. This should be a last resort because using, for example,
|
574
649
|
# MySQL specific terms will lock you to using that particular database engine or require you to
|
575
|
-
# change your call if you switch engines
|
650
|
+
# change your call if you switch engines.
|
576
651
|
#
|
577
652
|
# ==== Examples
|
578
653
|
# # A simple SQL query spanning multiple tables
|
@@ -586,23 +661,32 @@ module ActiveRecord #:nodoc:
|
|
586
661
|
connection.select_all(sanitize_sql(sql), "#{name} Load").collect! { |record| instantiate(record) }
|
587
662
|
end
|
588
663
|
|
589
|
-
#
|
590
|
-
#
|
591
|
-
#
|
664
|
+
# Returns true if a record exists in the table that matches the +id+ or
|
665
|
+
# conditions given, or false otherwise. The argument can take five forms:
|
666
|
+
#
|
667
|
+
# * Integer - Finds the record with this primary key.
|
668
|
+
# * String - Finds the record with a primary key corresponding to this
|
669
|
+
# string (such as <tt>'5'</tt>).
|
670
|
+
# * Array - Finds the record that matches these +find+-style conditions
|
671
|
+
# (such as <tt>['color = ?', 'red']</tt>).
|
672
|
+
# * Hash - Finds the record that matches these +find+-style conditions
|
673
|
+
# (such as <tt>{:color => 'red'}</tt>).
|
674
|
+
# * No args - Returns false if the table is empty, true otherwise.
|
592
675
|
#
|
593
|
-
#
|
594
|
-
#
|
595
|
-
# an Array or a Hash.
|
676
|
+
# For more information about specifying conditions as a Hash or Array,
|
677
|
+
# see the Conditions section in the introduction to ActiveRecord::Base.
|
596
678
|
#
|
597
|
-
#
|
598
|
-
# sanitized and then queried against
|
679
|
+
# Note: You can't pass in a condition as a string (like <tt>name =
|
680
|
+
# 'Jamie'</tt>), since it would be sanitized and then queried against
|
681
|
+
# the primary key column, like <tt>id = 'name = \'Jamie\''</tt>.
|
599
682
|
#
|
600
683
|
# ==== Examples
|
601
684
|
# Person.exists?(5)
|
602
685
|
# Person.exists?('5')
|
603
686
|
# Person.exists?(:name => "David")
|
604
687
|
# Person.exists?(['name LIKE ?', "%#{query}%"])
|
605
|
-
|
688
|
+
# Person.exists?
|
689
|
+
def exists?(id_or_conditions = {})
|
606
690
|
connection.select_all(
|
607
691
|
construct_finder_sql(
|
608
692
|
:select => "#{quoted_table_name}.#{primary_key}",
|
@@ -649,7 +733,7 @@ module ActiveRecord #:nodoc:
|
|
649
733
|
# Updates an object (or multiple objects) and saves it to the database, if validations pass.
|
650
734
|
# The resulting object is returned whether the object was saved successfully to the database or not.
|
651
735
|
#
|
652
|
-
# ====
|
736
|
+
# ==== Parameters
|
653
737
|
#
|
654
738
|
# * +id+ - This should be the id or an array of ids to be updated.
|
655
739
|
# * +attributes+ - This should be a Hash of attributes to be set on the object, or an array of Hashes.
|
@@ -673,24 +757,26 @@ module ActiveRecord #:nodoc:
|
|
673
757
|
end
|
674
758
|
end
|
675
759
|
|
676
|
-
#
|
677
|
-
#
|
678
|
-
#
|
760
|
+
# Deletes the row with a primary key matching the +id+ argument, using a
|
761
|
+
# SQL +DELETE+ statement, and returns the number of rows deleted. Active
|
762
|
+
# Record objects are not instantiated, so the object's callbacks are not
|
763
|
+
# executed, including any <tt>:dependent</tt> association options or
|
764
|
+
# Observer methods.
|
679
765
|
#
|
680
|
-
#
|
766
|
+
# You can delete multiple rows at once by passing an Array of <tt>id</tt>s.
|
681
767
|
#
|
682
|
-
#
|
683
|
-
#
|
684
|
-
#
|
768
|
+
# Note: Although it is often much faster than the alternative,
|
769
|
+
# <tt>#destroy</tt>, skipping callbacks might bypass business logic in
|
770
|
+
# your application that ensures referential integrity or performs other
|
771
|
+
# essential jobs.
|
685
772
|
#
|
686
773
|
# ==== Examples
|
687
774
|
#
|
688
|
-
# # Delete a single
|
775
|
+
# # Delete a single row
|
689
776
|
# Todo.delete(1)
|
690
777
|
#
|
691
|
-
# # Delete multiple
|
692
|
-
#
|
693
|
-
# Todo.delete(todos)
|
778
|
+
# # Delete multiple rows
|
779
|
+
# Todo.delete([2,3,4])
|
694
780
|
def delete(id)
|
695
781
|
delete_all([ "#{connection.quote_column_name(primary_key)} IN (?)", id ])
|
696
782
|
end
|
@@ -702,7 +788,7 @@ module ActiveRecord #:nodoc:
|
|
702
788
|
# This essentially finds the object (or multiple objects) with the given id, creates a new object
|
703
789
|
# from the attributes, and then calls destroy on it.
|
704
790
|
#
|
705
|
-
# ====
|
791
|
+
# ==== Parameters
|
706
792
|
#
|
707
793
|
# * +id+ - Can be either an Integer or an Array of Integers.
|
708
794
|
#
|
@@ -723,14 +809,14 @@ module ActiveRecord #:nodoc:
|
|
723
809
|
end
|
724
810
|
|
725
811
|
# Updates all records with details given if they match a set of conditions supplied, limits and order can
|
726
|
-
# also be supplied.
|
812
|
+
# also be supplied. This method constructs a single SQL UPDATE statement and sends it straight to the
|
813
|
+
# database. It does not instantiate the involved models and it does not trigger Active Record callbacks.
|
727
814
|
#
|
728
|
-
# ====
|
815
|
+
# ==== Parameters
|
729
816
|
#
|
730
|
-
# * +updates+ - A
|
731
|
-
# * +conditions+ - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ].
|
732
|
-
#
|
733
|
-
# * +options+ - Additional options are <tt>:limit</tt> and/or <tt>:order</tt>, see the examples for usage.
|
817
|
+
# * +updates+ - A string of column and value pairs that will be set on any records that match conditions. This creates the SET clause of the generated SQL.
|
818
|
+
# * +conditions+ - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ]. See conditions in the intro for more info.
|
819
|
+
# * +options+ - Additional options are <tt>:limit</tt> and <tt>:order</tt>, see the examples for usage.
|
734
820
|
#
|
735
821
|
# ==== Examples
|
736
822
|
#
|
@@ -745,46 +831,74 @@ module ActiveRecord #:nodoc:
|
|
745
831
|
# :order => 'created_at', :limit => 5 )
|
746
832
|
def update_all(updates, conditions = nil, options = {})
|
747
833
|
sql = "UPDATE #{quoted_table_name} SET #{sanitize_sql_for_assignment(updates)} "
|
834
|
+
|
748
835
|
scope = scope(:find)
|
749
|
-
|
750
|
-
|
751
|
-
|
836
|
+
|
837
|
+
select_sql = ""
|
838
|
+
add_conditions!(select_sql, conditions, scope)
|
839
|
+
|
840
|
+
if options.has_key?(:limit) || (scope && scope[:limit])
|
841
|
+
# Only take order from scope if limit is also provided by scope, this
|
842
|
+
# is useful for updating a has_many association with a limit.
|
843
|
+
add_order!(select_sql, options[:order], scope)
|
844
|
+
|
845
|
+
add_limit!(select_sql, options, scope)
|
846
|
+
sql.concat(connection.limited_update_conditions(select_sql, quoted_table_name, connection.quote_column_name(primary_key)))
|
847
|
+
else
|
848
|
+
add_order!(select_sql, options[:order], nil)
|
849
|
+
sql.concat(select_sql)
|
850
|
+
end
|
851
|
+
|
752
852
|
connection.update(sql, "#{name} Update")
|
753
853
|
end
|
754
854
|
|
755
|
-
# Destroys the records matching +conditions+ by instantiating each
|
756
|
-
#
|
757
|
-
#
|
758
|
-
#
|
855
|
+
# Destroys the records matching +conditions+ by instantiating each
|
856
|
+
# record and calling its +destroy+ method. Each object's callbacks are
|
857
|
+
# executed (including <tt>:dependent</tt> association options and
|
858
|
+
# +before_destroy+/+after_destroy+ Observer methods). Returns the
|
859
|
+
# collection of objects that were destroyed; each will be frozen, to
|
860
|
+
# reflect that no changes should be made (since they can't be
|
861
|
+
# persisted).
|
759
862
|
#
|
760
|
-
#
|
863
|
+
# Note: Instantiation, callback execution, and deletion of each
|
864
|
+
# record can be time consuming when you're removing many records at
|
865
|
+
# once. It generates at least one SQL +DELETE+ query per record (or
|
866
|
+
# possibly more, to enforce your callbacks). If you want to delete many
|
867
|
+
# rows quickly, without concern for their associations or callbacks, use
|
868
|
+
# +delete_all+ instead.
|
761
869
|
#
|
762
|
-
#
|
870
|
+
# ==== Parameters
|
763
871
|
#
|
764
|
-
#
|
872
|
+
# * +conditions+ - A string, array, or hash that specifies which records
|
873
|
+
# to destroy. If omitted, all records are destroyed. See the
|
874
|
+
# Conditions section in the introduction to ActiveRecord::Base for
|
875
|
+
# more information.
|
765
876
|
#
|
766
|
-
#
|
877
|
+
# ==== Examples
|
767
878
|
#
|
768
|
-
#
|
769
|
-
#
|
879
|
+
# Person.destroy_all("last_login < '2004-04-04'")
|
880
|
+
# Person.destroy_all(:status => "inactive")
|
770
881
|
def destroy_all(conditions = nil)
|
771
882
|
find(:all, :conditions => conditions).each { |object| object.destroy }
|
772
883
|
end
|
773
884
|
|
774
885
|
# Deletes the records matching +conditions+ without instantiating the records first, and hence not
|
775
|
-
# calling the destroy method
|
776
|
-
# than destroy_all
|
886
|
+
# calling the +destroy+ method nor invoking callbacks. This is a single SQL DELETE statement that
|
887
|
+
# goes straight to the database, much more efficient than +destroy_all+. Be careful with relations
|
888
|
+
# though, in particular <tt>:dependent</tt> rules defined on associations are not honored. Returns
|
889
|
+
# the number of rows affected.
|
777
890
|
#
|
778
|
-
# ====
|
891
|
+
# ==== Parameters
|
779
892
|
#
|
780
893
|
# * +conditions+ - Conditions are specified the same way as with +find+ method.
|
781
894
|
#
|
782
895
|
# ==== Example
|
783
896
|
#
|
784
|
-
# Post.delete_all
|
897
|
+
# Post.delete_all("person_id = 5 AND (category = 'Something' OR category = 'Else')")
|
898
|
+
# Post.delete_all(["person_id = ? AND (category = ? OR category = ?)", 5, 'Something', 'Else'])
|
785
899
|
#
|
786
|
-
#
|
787
|
-
# associations or call your before_ or after_destroy callbacks, use the +destroy_all+ method instead.
|
900
|
+
# Both calls delete the affected posts all at once with a single DELETE statement. If you need to destroy dependent
|
901
|
+
# associations or call your <tt>before_*</tt> or +after_destroy+ callbacks, use the +destroy_all+ method instead.
|
788
902
|
def delete_all(conditions = nil)
|
789
903
|
sql = "DELETE FROM #{quoted_table_name} "
|
790
904
|
add_conditions!(sql, conditions, scope(:find))
|
@@ -795,7 +909,7 @@ module ActiveRecord #:nodoc:
|
|
795
909
|
# The use of this method should be restricted to complicated SQL queries that can't be executed
|
796
910
|
# using the ActiveRecord::Calculations class methods. Look into those before using this.
|
797
911
|
#
|
798
|
-
# ====
|
912
|
+
# ==== Parameters
|
799
913
|
#
|
800
914
|
# * +sql+ - An SQL statement which should return a count query from the database, see the example below.
|
801
915
|
#
|
@@ -813,9 +927,9 @@ module ActiveRecord #:nodoc:
|
|
813
927
|
# with the given ID, altering the given hash of counters by the amount
|
814
928
|
# given by the corresponding value:
|
815
929
|
#
|
816
|
-
# ====
|
930
|
+
# ==== Parameters
|
817
931
|
#
|
818
|
-
# * +id+ - The id of the object you wish to update a counter on.
|
932
|
+
# * +id+ - The id of the object you wish to update a counter on or an Array of ids.
|
819
933
|
# * +counters+ - An Array of Hashes containing the names of the fields
|
820
934
|
# to update as keys and the amount to update the field by as values.
|
821
935
|
#
|
@@ -829,12 +943,27 @@ module ActiveRecord #:nodoc:
|
|
829
943
|
# # SET comment_count = comment_count - 1,
|
830
944
|
# # action_count = action_count + 1
|
831
945
|
# # WHERE id = 5
|
946
|
+
#
|
947
|
+
# # For the Posts with id of 10 and 15, increment the comment_count by 1
|
948
|
+
# Post.update_counters [10, 15], :comment_count => 1
|
949
|
+
# # Executes the following SQL:
|
950
|
+
# # UPDATE posts
|
951
|
+
# # SET comment_count = comment_count + 1,
|
952
|
+
# # WHERE id IN (10, 15)
|
832
953
|
def update_counters(id, counters)
|
833
954
|
updates = counters.inject([]) { |list, (counter_name, increment)|
|
834
955
|
sign = increment < 0 ? "-" : "+"
|
835
956
|
list << "#{connection.quote_column_name(counter_name)} = COALESCE(#{connection.quote_column_name(counter_name)}, 0) #{sign} #{increment.abs}"
|
836
957
|
}.join(", ")
|
837
|
-
|
958
|
+
|
959
|
+
if id.is_a?(Array)
|
960
|
+
ids_list = id.map {|i| quote_value(i)}.join(', ')
|
961
|
+
condition = "IN (#{ids_list})"
|
962
|
+
else
|
963
|
+
condition = "= #{quote_value(id)}"
|
964
|
+
end
|
965
|
+
|
966
|
+
update_all(updates, "#{connection.quote_column_name(primary_key)} #{condition}")
|
838
967
|
end
|
839
968
|
|
840
969
|
# Increment a number field by one, usually representing a count.
|
@@ -843,7 +972,7 @@ module ActiveRecord #:nodoc:
|
|
843
972
|
# For example, a DiscussionBoard may cache post_count and comment_count otherwise every time the board is
|
844
973
|
# shown it would have to run an SQL query to find how many posts and comments there are.
|
845
974
|
#
|
846
|
-
# ====
|
975
|
+
# ==== Parameters
|
847
976
|
#
|
848
977
|
# * +counter_name+ - The name of the field that should be incremented.
|
849
978
|
# * +id+ - The id of the object that should be incremented.
|
@@ -860,7 +989,7 @@ module ActiveRecord #:nodoc:
|
|
860
989
|
#
|
861
990
|
# This works the same as increment_counter but reduces the column value by 1 instead of increasing it.
|
862
991
|
#
|
863
|
-
# ====
|
992
|
+
# ==== Parameters
|
864
993
|
#
|
865
994
|
# * +counter_name+ - The name of the field that should be decremented.
|
866
995
|
# * +id+ - The id of the object that should be decremented.
|
@@ -873,7 +1002,6 @@ module ActiveRecord #:nodoc:
|
|
873
1002
|
update_counters(id, counter_name => -1)
|
874
1003
|
end
|
875
1004
|
|
876
|
-
|
877
1005
|
# Attributes named in this macro are protected from mass-assignment,
|
878
1006
|
# such as <tt>new(attributes)</tt>,
|
879
1007
|
# <tt>update_attributes(attributes)</tt>, or
|
@@ -899,12 +1027,12 @@ module ActiveRecord #:nodoc:
|
|
899
1027
|
# To start from an all-closed default and enable attributes as needed,
|
900
1028
|
# have a look at +attr_accessible+.
|
901
1029
|
def attr_protected(*attributes)
|
902
|
-
write_inheritable_attribute(
|
1030
|
+
write_inheritable_attribute(:attr_protected, Set.new(attributes.map(&:to_s)) + (protected_attributes || []))
|
903
1031
|
end
|
904
1032
|
|
905
1033
|
# Returns an array of all the attributes that have been protected from mass-assignment.
|
906
1034
|
def protected_attributes # :nodoc:
|
907
|
-
read_inheritable_attribute(
|
1035
|
+
read_inheritable_attribute(:attr_protected)
|
908
1036
|
end
|
909
1037
|
|
910
1038
|
# Specifies a white list of model attributes that can be set via
|
@@ -932,22 +1060,22 @@ module ActiveRecord #:nodoc:
|
|
932
1060
|
# customer.credit_rating = "Average"
|
933
1061
|
# customer.credit_rating # => "Average"
|
934
1062
|
def attr_accessible(*attributes)
|
935
|
-
write_inheritable_attribute(
|
1063
|
+
write_inheritable_attribute(:attr_accessible, Set.new(attributes.map(&:to_s)) + (accessible_attributes || []))
|
936
1064
|
end
|
937
1065
|
|
938
1066
|
# Returns an array of all the attributes that have been made accessible to mass-assignment.
|
939
1067
|
def accessible_attributes # :nodoc:
|
940
|
-
read_inheritable_attribute(
|
1068
|
+
read_inheritable_attribute(:attr_accessible)
|
941
1069
|
end
|
942
1070
|
|
943
1071
|
# Attributes listed as readonly can be set for a new record, but will be ignored in database updates afterwards.
|
944
1072
|
def attr_readonly(*attributes)
|
945
|
-
write_inheritable_attribute(
|
1073
|
+
write_inheritable_attribute(:attr_readonly, Set.new(attributes.map(&:to_s)) + (readonly_attributes || []))
|
946
1074
|
end
|
947
1075
|
|
948
1076
|
# Returns an array of all the attributes that have been specified as readonly.
|
949
1077
|
def readonly_attributes
|
950
|
-
read_inheritable_attribute(
|
1078
|
+
read_inheritable_attribute(:attr_readonly)
|
951
1079
|
end
|
952
1080
|
|
953
1081
|
# If you have an attribute that needs to be saved to the database as an object, and retrieved as the same object,
|
@@ -955,7 +1083,7 @@ module ActiveRecord #:nodoc:
|
|
955
1083
|
# The serialization is done through YAML. If +class_name+ is specified, the serialized object must be of that
|
956
1084
|
# class on retrieval or SerializationTypeMismatch will be raised.
|
957
1085
|
#
|
958
|
-
# ====
|
1086
|
+
# ==== Parameters
|
959
1087
|
#
|
960
1088
|
# * +attr_name+ - The field name that should be serialized.
|
961
1089
|
# * +class_name+ - Optional, class name that the object type should be equal to.
|
@@ -971,10 +1099,9 @@ module ActiveRecord #:nodoc:
|
|
971
1099
|
|
972
1100
|
# Returns a hash of all the attributes that have been specified for serialization as keys and their class restriction as values.
|
973
1101
|
def serialized_attributes
|
974
|
-
read_inheritable_attribute(
|
1102
|
+
read_inheritable_attribute(:attr_serialized) or write_inheritable_attribute(:attr_serialized, {})
|
975
1103
|
end
|
976
1104
|
|
977
|
-
|
978
1105
|
# Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending
|
979
1106
|
# directly from ActiveRecord::Base. So if the hierarchy looks like: Reply < Message < ActiveRecord::Base, then Message is used
|
980
1107
|
# to guess the table name even when called on Reply. The rules used to do the guess are handled by the Inflector class
|
@@ -1182,7 +1309,32 @@ module ActiveRecord #:nodoc:
|
|
1182
1309
|
end
|
1183
1310
|
end
|
1184
1311
|
|
1185
|
-
# Resets all the cached information about columns, which will cause them
|
1312
|
+
# Resets all the cached information about columns, which will cause them
|
1313
|
+
# to be reloaded on the next request.
|
1314
|
+
#
|
1315
|
+
# The most common usage pattern for this method is probably in a migration,
|
1316
|
+
# when just after creating a table you want to populate it with some default
|
1317
|
+
# values, eg:
|
1318
|
+
#
|
1319
|
+
# class CreateJobLevels < ActiveRecord::Migration
|
1320
|
+
# def self.up
|
1321
|
+
# create_table :job_levels do |t|
|
1322
|
+
# t.integer :id
|
1323
|
+
# t.string :name
|
1324
|
+
#
|
1325
|
+
# t.timestamps
|
1326
|
+
# end
|
1327
|
+
#
|
1328
|
+
# JobLevel.reset_column_information
|
1329
|
+
# %w{assistant executive manager director}.each do |type|
|
1330
|
+
# JobLevel.create(:name => type)
|
1331
|
+
# end
|
1332
|
+
# end
|
1333
|
+
#
|
1334
|
+
# def self.down
|
1335
|
+
# drop_table :job_levels
|
1336
|
+
# end
|
1337
|
+
# end
|
1186
1338
|
def reset_column_information
|
1187
1339
|
generated_methods.each { |name| undef_method(name) }
|
1188
1340
|
@column_names = @columns = @columns_hash = @content_columns = @dynamic_methods_hash = @generated_methods = @inheritance_column = nil
|
@@ -1192,11 +1344,46 @@ module ActiveRecord #:nodoc:
|
|
1192
1344
|
subclasses.each { |klass| klass.reset_inheritable_attributes; klass.reset_column_information }
|
1193
1345
|
end
|
1194
1346
|
|
1347
|
+
def self_and_descendants_from_active_record#nodoc:
|
1348
|
+
klass = self
|
1349
|
+
classes = [klass]
|
1350
|
+
while klass != klass.base_class
|
1351
|
+
classes << klass = klass.superclass
|
1352
|
+
end
|
1353
|
+
classes
|
1354
|
+
rescue
|
1355
|
+
# OPTIMIZE this rescue is to fix this test: ./test/cases/reflection_test.rb:56:in `test_human_name_for_column'
|
1356
|
+
# Appearantly the method base_class causes some trouble.
|
1357
|
+
# It now works for sure.
|
1358
|
+
[self]
|
1359
|
+
end
|
1360
|
+
|
1195
1361
|
# Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example:
|
1196
1362
|
# Person.human_attribute_name("first_name") # => "First name"
|
1197
|
-
#
|
1198
|
-
|
1199
|
-
|
1363
|
+
# This used to be depricated in favor of humanize, but is now preferred, because it automatically uses the I18n
|
1364
|
+
# module now.
|
1365
|
+
# Specify +options+ with additional translating options.
|
1366
|
+
def human_attribute_name(attribute_key_name, options = {})
|
1367
|
+
defaults = self_and_descendants_from_active_record.map do |klass|
|
1368
|
+
:"#{klass.name.underscore}.#{attribute_key_name}"
|
1369
|
+
end
|
1370
|
+
defaults << options[:default] if options[:default]
|
1371
|
+
defaults.flatten!
|
1372
|
+
defaults << attribute_key_name.humanize
|
1373
|
+
options[:count] ||= 1
|
1374
|
+
I18n.translate(defaults.shift, options.merge(:default => defaults, :scope => [:activerecord, :attributes]))
|
1375
|
+
end
|
1376
|
+
|
1377
|
+
# Transform the modelname into a more humane format, using I18n.
|
1378
|
+
# Defaults to the basic humanize method.
|
1379
|
+
# Default scope of the translation is activerecord.models
|
1380
|
+
# Specify +options+ with additional translating options.
|
1381
|
+
def human_name(options = {})
|
1382
|
+
defaults = self_and_descendants_from_active_record.map do |klass|
|
1383
|
+
:"#{klass.name.underscore}"
|
1384
|
+
end
|
1385
|
+
defaults << self.name.humanize
|
1386
|
+
I18n.translate(defaults.shift, {:scope => [:activerecord, :models], :count => 1, :default => defaults}.merge(options))
|
1200
1387
|
end
|
1201
1388
|
|
1202
1389
|
# True if this isn't a concrete subclass needing a STI type condition.
|
@@ -1227,7 +1414,6 @@ module ActiveRecord #:nodoc:
|
|
1227
1414
|
end
|
1228
1415
|
end
|
1229
1416
|
|
1230
|
-
|
1231
1417
|
def quote_value(value, column = nil) #:nodoc:
|
1232
1418
|
connection.quote(value,column)
|
1233
1419
|
end
|
@@ -1253,8 +1439,8 @@ module ActiveRecord #:nodoc:
|
|
1253
1439
|
def benchmark(title, log_level = Logger::DEBUG, use_silence = true)
|
1254
1440
|
if logger && logger.level <= log_level
|
1255
1441
|
result = nil
|
1256
|
-
|
1257
|
-
logger.add(log_level,
|
1442
|
+
ms = Benchmark.ms { result = use_silence ? silence { yield } : yield }
|
1443
|
+
logger.add(log_level, '%s (%.1fms)' % [title, ms])
|
1258
1444
|
result
|
1259
1445
|
else
|
1260
1446
|
yield
|
@@ -1291,9 +1477,12 @@ module ActiveRecord #:nodoc:
|
|
1291
1477
|
end
|
1292
1478
|
|
1293
1479
|
def respond_to?(method_id, include_private = false)
|
1294
|
-
if match =
|
1295
|
-
return true if all_attributes_exists?(
|
1480
|
+
if match = DynamicFinderMatch.match(method_id)
|
1481
|
+
return true if all_attributes_exists?(match.attribute_names)
|
1482
|
+
elsif match = DynamicScopeMatch.match(method_id)
|
1483
|
+
return true if all_attributes_exists?(match.attribute_names)
|
1296
1484
|
end
|
1485
|
+
|
1297
1486
|
super
|
1298
1487
|
end
|
1299
1488
|
|
@@ -1301,6 +1490,20 @@ module ActiveRecord #:nodoc:
|
|
1301
1490
|
store_full_sti_class ? name : name.demodulize
|
1302
1491
|
end
|
1303
1492
|
|
1493
|
+
# Merges conditions so that the result is a valid +condition+
|
1494
|
+
def merge_conditions(*conditions)
|
1495
|
+
segments = []
|
1496
|
+
|
1497
|
+
conditions.each do |condition|
|
1498
|
+
unless condition.blank?
|
1499
|
+
sql = sanitize_sql(condition)
|
1500
|
+
segments << sql unless sql.blank?
|
1501
|
+
end
|
1502
|
+
end
|
1503
|
+
|
1504
|
+
"(#{segments.join(') AND (')})" unless segments.empty?
|
1505
|
+
end
|
1506
|
+
|
1304
1507
|
private
|
1305
1508
|
def find_initial(options)
|
1306
1509
|
options.update(:limit => 1)
|
@@ -1317,15 +1520,20 @@ module ActiveRecord #:nodoc:
|
|
1317
1520
|
end
|
1318
1521
|
|
1319
1522
|
if scoped?(:find, :order)
|
1320
|
-
|
1321
|
-
|
1523
|
+
scope = scope(:find)
|
1524
|
+
original_scoped_order = scope[:order]
|
1525
|
+
scope[:order] = reverse_sql_order(original_scoped_order)
|
1322
1526
|
end
|
1323
1527
|
|
1324
|
-
|
1528
|
+
begin
|
1529
|
+
find_initial(options.merge({ :order => order }))
|
1530
|
+
ensure
|
1531
|
+
scope[:order] = original_scoped_order if original_scoped_order
|
1532
|
+
end
|
1325
1533
|
end
|
1326
1534
|
|
1327
1535
|
def reverse_sql_order(order_query)
|
1328
|
-
reversed_query = order_query.split(/,/).each { |s|
|
1536
|
+
reversed_query = order_query.to_s.split(/,/).each { |s|
|
1329
1537
|
if s.match(/\s(asc|ASC)$/)
|
1330
1538
|
s.gsub!(/\s(asc|ASC)$/, ' DESC')
|
1331
1539
|
elsif s.match(/\s(desc|DESC)$/)
|
@@ -1467,15 +1675,23 @@ module ActiveRecord #:nodoc:
|
|
1467
1675
|
end
|
1468
1676
|
end
|
1469
1677
|
|
1678
|
+
def default_select(qualified)
|
1679
|
+
if qualified
|
1680
|
+
quoted_table_name + '.*'
|
1681
|
+
else
|
1682
|
+
'*'
|
1683
|
+
end
|
1684
|
+
end
|
1685
|
+
|
1470
1686
|
def construct_finder_sql(options)
|
1471
1687
|
scope = scope(:find)
|
1472
|
-
sql = "SELECT #{options[:select] || (scope && scope[:select]) || (
|
1473
|
-
sql << "FROM #{(scope && scope[:from]) ||
|
1688
|
+
sql = "SELECT #{options[:select] || (scope && scope[:select]) || default_select(options[:joins] || (scope && scope[:joins]))} "
|
1689
|
+
sql << "FROM #{options[:from] || (scope && scope[:from]) || quoted_table_name} "
|
1474
1690
|
|
1475
|
-
add_joins!(sql, options, scope)
|
1691
|
+
add_joins!(sql, options[:joins], scope)
|
1476
1692
|
add_conditions!(sql, options[:conditions], scope)
|
1477
1693
|
|
1478
|
-
add_group!(sql, options[:group], scope)
|
1694
|
+
add_group!(sql, options[:group], options[:having], scope)
|
1479
1695
|
add_order!(sql, options[:order], scope)
|
1480
1696
|
add_limit!(sql, options, scope)
|
1481
1697
|
add_lock!(sql, options, scope)
|
@@ -1488,18 +1704,20 @@ module ActiveRecord #:nodoc:
|
|
1488
1704
|
(safe_to_array(first) + safe_to_array(second)).uniq
|
1489
1705
|
end
|
1490
1706
|
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1707
|
+
def merge_joins(*joins)
|
1708
|
+
if joins.any?{|j| j.is_a?(String) || array_of_strings?(j) }
|
1709
|
+
joins = joins.collect do |join|
|
1710
|
+
join = [join] if join.is_a?(String)
|
1711
|
+
unless array_of_strings?(join)
|
1712
|
+
join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, join, nil)
|
1713
|
+
join = join_dependency.join_associations.collect { |assoc| assoc.association_join }
|
1714
|
+
end
|
1715
|
+
join
|
1499
1716
|
end
|
1717
|
+
joins.flatten.map{|j| j.strip}.uniq
|
1718
|
+
else
|
1719
|
+
joins.collect{|j| safe_to_array(j)}.flatten.uniq
|
1500
1720
|
end
|
1501
|
-
|
1502
|
-
"(#{segments.join(') AND (')})" unless segments.empty?
|
1503
1721
|
end
|
1504
1722
|
|
1505
1723
|
# Object#to_a is deprecated, though it does have the desired behavior
|
@@ -1514,24 +1732,32 @@ module ActiveRecord #:nodoc:
|
|
1514
1732
|
end
|
1515
1733
|
end
|
1516
1734
|
|
1735
|
+
def array_of_strings?(o)
|
1736
|
+
o.is_a?(Array) && o.all?{|obj| obj.is_a?(String)}
|
1737
|
+
end
|
1738
|
+
|
1517
1739
|
def add_order!(sql, order, scope = :auto)
|
1518
1740
|
scope = scope(:find) if :auto == scope
|
1519
1741
|
scoped_order = scope[:order] if scope
|
1520
1742
|
if order
|
1521
1743
|
sql << " ORDER BY #{order}"
|
1522
|
-
|
1744
|
+
if scoped_order && scoped_order != order
|
1745
|
+
sql << ", #{scoped_order}"
|
1746
|
+
end
|
1523
1747
|
else
|
1524
1748
|
sql << " ORDER BY #{scoped_order}" if scoped_order
|
1525
1749
|
end
|
1526
1750
|
end
|
1527
1751
|
|
1528
|
-
def add_group!(sql, group, scope = :auto)
|
1752
|
+
def add_group!(sql, group, having, scope = :auto)
|
1529
1753
|
if group
|
1530
1754
|
sql << " GROUP BY #{group}"
|
1755
|
+
sql << " HAVING #{sanitize_sql_for_conditions(having)}" if having
|
1531
1756
|
else
|
1532
1757
|
scope = scope(:find) if :auto == scope
|
1533
1758
|
if scope && (scoped_group = scope[:group])
|
1534
1759
|
sql << " GROUP BY #{scoped_group}"
|
1760
|
+
sql << " HAVING #{sanitize_sql_for_conditions(scope[:having])}" if scope[:having]
|
1535
1761
|
end
|
1536
1762
|
end
|
1537
1763
|
end
|
@@ -1557,16 +1783,19 @@ module ActiveRecord #:nodoc:
|
|
1557
1783
|
end
|
1558
1784
|
|
1559
1785
|
# The optional scope argument is for the current <tt>:find</tt> scope.
|
1560
|
-
def add_joins!(sql,
|
1786
|
+
def add_joins!(sql, joins, scope = :auto)
|
1561
1787
|
scope = scope(:find) if :auto == scope
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
sql <<
|
1788
|
+
merged_joins = scope && scope[:joins] && joins ? merge_joins(scope[:joins], joins) : (joins || scope && scope[:joins])
|
1789
|
+
case merged_joins
|
1790
|
+
when Symbol, Hash, Array
|
1791
|
+
if array_of_strings?(merged_joins)
|
1792
|
+
sql << merged_joins.join(' ') + " "
|
1567
1793
|
else
|
1568
|
-
|
1794
|
+
join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, merged_joins, nil)
|
1795
|
+
sql << " #{join_dependency.join_associations.collect { |assoc| assoc.association_join }.join} "
|
1569
1796
|
end
|
1797
|
+
when String
|
1798
|
+
sql << " #{merged_joins} "
|
1570
1799
|
end
|
1571
1800
|
end
|
1572
1801
|
|
@@ -1598,101 +1827,144 @@ module ActiveRecord #:nodoc:
|
|
1598
1827
|
table_name
|
1599
1828
|
end
|
1600
1829
|
|
1601
|
-
# Enables dynamic finders like find_by_user_name(user_name) and find_by_user_name_and_password(user_name, password)
|
1602
|
-
#
|
1603
|
-
#
|
1830
|
+
# Enables dynamic finders like <tt>find_by_user_name(user_name)</tt> and <tt>find_by_user_name_and_password(user_name, password)</tt>
|
1831
|
+
# that are turned into <tt>find(:first, :conditions => ["user_name = ?", user_name])</tt> and
|
1832
|
+
# <tt>find(:first, :conditions => ["user_name = ? AND password = ?", user_name, password])</tt> respectively. Also works for
|
1833
|
+
# <tt>find(:all)</tt> by using <tt>find_all_by_amount(50)</tt> that is turned into <tt>find(:all, :conditions => ["amount = ?", 50])</tt>.
|
1604
1834
|
#
|
1605
|
-
# It's even possible to use all the additional parameters to find
|
1606
|
-
# is actually find_all_by_amount(amount, options)
|
1835
|
+
# It's even possible to use all the additional parameters to +find+. For example, the full interface for +find_all_by_amount+
|
1836
|
+
# is actually <tt>find_all_by_amount(amount, options)</tt>.
|
1607
1837
|
#
|
1608
|
-
#
|
1609
|
-
#
|
1838
|
+
# Also enables dynamic scopes like scoped_by_user_name(user_name) and scoped_by_user_name_and_password(user_name, password) that
|
1839
|
+
# are turned into scoped(:conditions => ["user_name = ?", user_name]) and scoped(:conditions => ["user_name = ? AND password = ?", user_name, password])
|
1840
|
+
# respectively.
|
1610
1841
|
#
|
1611
|
-
# Each dynamic finder or initializer/creator is also defined in the class after it is first invoked, so that future
|
1842
|
+
# Each dynamic finder, scope or initializer/creator is also defined in the class after it is first invoked, so that future
|
1612
1843
|
# attempts to use it do not run through method_missing.
|
1613
|
-
def method_missing(method_id, *arguments)
|
1614
|
-
if match =
|
1615
|
-
|
1616
|
-
|
1617
|
-
attribute_names = extract_attribute_names_from_match(match)
|
1844
|
+
def method_missing(method_id, *arguments, &block)
|
1845
|
+
if match = DynamicFinderMatch.match(method_id)
|
1846
|
+
attribute_names = match.attribute_names
|
1618
1847
|
super unless all_attributes_exists?(attribute_names)
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1848
|
+
if match.finder?
|
1849
|
+
finder = match.finder
|
1850
|
+
bang = match.bang?
|
1851
|
+
# def self.find_by_login_and_activated(*args)
|
1852
|
+
# options = args.extract_options!
|
1853
|
+
# attributes = construct_attributes_from_arguments(
|
1854
|
+
# [:login,:activated],
|
1855
|
+
# args
|
1856
|
+
# )
|
1857
|
+
# finder_options = { :conditions => attributes }
|
1858
|
+
# validate_find_options(options)
|
1859
|
+
# set_readonly_option!(options)
|
1860
|
+
#
|
1861
|
+
# if options[:conditions]
|
1862
|
+
# with_scope(:find => finder_options) do
|
1863
|
+
# find(:first, options)
|
1864
|
+
# end
|
1865
|
+
# else
|
1866
|
+
# find(:first, options.merge(finder_options))
|
1867
|
+
# end
|
1868
|
+
# end
|
1869
|
+
self.class_eval %{
|
1870
|
+
def self.#{method_id}(*args)
|
1871
|
+
options = args.extract_options!
|
1872
|
+
attributes = construct_attributes_from_arguments(
|
1873
|
+
[:#{attribute_names.join(',:')}],
|
1874
|
+
args
|
1875
|
+
)
|
1876
|
+
finder_options = { :conditions => attributes }
|
1877
|
+
validate_find_options(options)
|
1878
|
+
set_readonly_option!(options)
|
1879
|
+
|
1880
|
+
#{'result = ' if bang}if options[:conditions]
|
1881
|
+
with_scope(:find => finder_options) do
|
1882
|
+
find(:#{finder}, options)
|
1883
|
+
end
|
1884
|
+
else
|
1885
|
+
find(:#{finder}, options.merge(finder_options))
|
1631
1886
|
end
|
1632
|
-
|
1633
|
-
ActiveSupport::Deprecation.silence { send(:#{finder}, options.merge(finder_options)) }
|
1634
|
-
end
|
1635
|
-
end
|
1636
|
-
}, __FILE__, __LINE__
|
1637
|
-
send(method_id, *arguments)
|
1638
|
-
elsif match = matches_dynamic_finder_with_initialize_or_create?(method_id)
|
1639
|
-
instantiator = determine_instantiator(match)
|
1640
|
-
attribute_names = extract_attribute_names_from_match(match)
|
1641
|
-
super unless all_attributes_exists?(attribute_names)
|
1642
|
-
|
1643
|
-
self.class_eval %{
|
1644
|
-
def self.#{method_id}(*args)
|
1645
|
-
guard_protected_attributes = false
|
1646
|
-
|
1647
|
-
if args[0].is_a?(Hash)
|
1648
|
-
guard_protected_attributes = true
|
1649
|
-
attributes = args[0].with_indifferent_access
|
1650
|
-
find_attributes = attributes.slice(*[:#{attribute_names.join(',:')}])
|
1651
|
-
else
|
1652
|
-
find_attributes = attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
|
1887
|
+
#{'result || raise(RecordNotFound, "Couldn\'t find #{name} with #{attributes.to_a.collect {|pair| "#{pair.first} = #{pair.second}"}.join(\', \')}")' if bang}
|
1653
1888
|
end
|
1889
|
+
}, __FILE__, __LINE__
|
1890
|
+
send(method_id, *arguments)
|
1891
|
+
elsif match.instantiator?
|
1892
|
+
instantiator = match.instantiator
|
1893
|
+
# def self.find_or_create_by_user_id(*args)
|
1894
|
+
# guard_protected_attributes = false
|
1895
|
+
#
|
1896
|
+
# if args[0].is_a?(Hash)
|
1897
|
+
# guard_protected_attributes = true
|
1898
|
+
# attributes = args[0].with_indifferent_access
|
1899
|
+
# find_attributes = attributes.slice(*[:user_id])
|
1900
|
+
# else
|
1901
|
+
# find_attributes = attributes = construct_attributes_from_arguments([:user_id], args)
|
1902
|
+
# end
|
1903
|
+
#
|
1904
|
+
# options = { :conditions => find_attributes }
|
1905
|
+
# set_readonly_option!(options)
|
1906
|
+
#
|
1907
|
+
# record = find(:first, options)
|
1908
|
+
#
|
1909
|
+
# if record.nil?
|
1910
|
+
# record = self.new { |r| r.send(:attributes=, attributes, guard_protected_attributes) }
|
1911
|
+
# yield(record) if block_given?
|
1912
|
+
# record.save
|
1913
|
+
# record
|
1914
|
+
# else
|
1915
|
+
# record
|
1916
|
+
# end
|
1917
|
+
# end
|
1918
|
+
self.class_eval %{
|
1919
|
+
def self.#{method_id}(*args)
|
1920
|
+
guard_protected_attributes = false
|
1921
|
+
|
1922
|
+
if args[0].is_a?(Hash)
|
1923
|
+
guard_protected_attributes = true
|
1924
|
+
attributes = args[0].with_indifferent_access
|
1925
|
+
find_attributes = attributes.slice(*[:#{attribute_names.join(',:')}])
|
1926
|
+
else
|
1927
|
+
find_attributes = attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
|
1928
|
+
end
|
1654
1929
|
|
1655
|
-
|
1656
|
-
|
1930
|
+
options = { :conditions => find_attributes }
|
1931
|
+
set_readonly_option!(options)
|
1657
1932
|
|
1658
|
-
|
1933
|
+
record = find(:first, options)
|
1659
1934
|
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1935
|
+
if record.nil?
|
1936
|
+
record = self.new { |r| r.send(:attributes=, attributes, guard_protected_attributes) }
|
1937
|
+
#{'yield(record) if block_given?'}
|
1938
|
+
#{'record.save' if instantiator == :create}
|
1939
|
+
record
|
1940
|
+
else
|
1941
|
+
record
|
1942
|
+
end
|
1667
1943
|
end
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1944
|
+
}, __FILE__, __LINE__
|
1945
|
+
send(method_id, *arguments, &block)
|
1946
|
+
end
|
1947
|
+
elsif match = DynamicScopeMatch.match(method_id)
|
1948
|
+
attribute_names = match.attribute_names
|
1949
|
+
super unless all_attributes_exists?(attribute_names)
|
1950
|
+
if match.scope?
|
1951
|
+
self.class_eval %{
|
1952
|
+
def self.#{method_id}(*args) # def self.scoped_by_user_name_and_password(*args)
|
1953
|
+
options = args.extract_options! # options = args.extract_options!
|
1954
|
+
attributes = construct_attributes_from_arguments( # attributes = construct_attributes_from_arguments(
|
1955
|
+
[:#{attribute_names.join(',:')}], args # [:user_name, :password], args
|
1956
|
+
) # )
|
1957
|
+
#
|
1958
|
+
scoped(:conditions => attributes) # scoped(:conditions => attributes)
|
1959
|
+
end # end
|
1960
|
+
}, __FILE__, __LINE__
|
1961
|
+
send(method_id, *arguments)
|
1962
|
+
end
|
1671
1963
|
else
|
1672
1964
|
super
|
1673
1965
|
end
|
1674
1966
|
end
|
1675
1967
|
|
1676
|
-
def matches_dynamic_finder?(method_id)
|
1677
|
-
/^find_(all_by|by)_([_a-zA-Z]\w*)$/.match(method_id.to_s)
|
1678
|
-
end
|
1679
|
-
|
1680
|
-
def matches_dynamic_finder_with_initialize_or_create?(method_id)
|
1681
|
-
/^find_or_(initialize|create)_by_([_a-zA-Z]\w*)$/.match(method_id.to_s)
|
1682
|
-
end
|
1683
|
-
|
1684
|
-
def determine_finder(match)
|
1685
|
-
match.captures.first == 'all_by' ? :find_every : :find_initial
|
1686
|
-
end
|
1687
|
-
|
1688
|
-
def determine_instantiator(match)
|
1689
|
-
match.captures.first == 'initialize' ? :new : :create
|
1690
|
-
end
|
1691
|
-
|
1692
|
-
def extract_attribute_names_from_match(match)
|
1693
|
-
match.captures.last.split('_and_')
|
1694
|
-
end
|
1695
|
-
|
1696
1968
|
def construct_attributes_from_arguments(attribute_names, arguments)
|
1697
1969
|
attributes = {}
|
1698
1970
|
attribute_names.each_with_index { |name, idx| attributes[name] = arguments[idx] }
|
@@ -1719,12 +1991,16 @@ module ActiveRecord #:nodoc:
|
|
1719
1991
|
attribute_names.all? { |name| column_methods_hash.include?(name.to_sym) }
|
1720
1992
|
end
|
1721
1993
|
|
1722
|
-
def attribute_condition(argument)
|
1994
|
+
def attribute_condition(quoted_column_name, argument)
|
1723
1995
|
case argument
|
1724
|
-
when nil then "IS ?"
|
1725
|
-
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope then "IN (?)"
|
1726
|
-
when Range then
|
1727
|
-
|
1996
|
+
when nil then "#{quoted_column_name} IS ?"
|
1997
|
+
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope then "#{quoted_column_name} IN (?)"
|
1998
|
+
when Range then if argument.exclude_end?
|
1999
|
+
"#{quoted_column_name} >= ? AND #{quoted_column_name} < ?"
|
2000
|
+
else
|
2001
|
+
"#{quoted_column_name} BETWEEN ? AND ?"
|
2002
|
+
end
|
2003
|
+
else "#{quoted_column_name} = ?"
|
1728
2004
|
end
|
1729
2005
|
end
|
1730
2006
|
|
@@ -1736,7 +2012,6 @@ module ActiveRecord #:nodoc:
|
|
1736
2012
|
end
|
1737
2013
|
end
|
1738
2014
|
|
1739
|
-
|
1740
2015
|
# Defines an "attribute" method (like +inheritance_column+ or
|
1741
2016
|
# +table_name+). A new (class) method will be created with the
|
1742
2017
|
# given name. If a value is specified, the new method will
|
@@ -1783,7 +2058,11 @@ module ActiveRecord #:nodoc:
|
|
1783
2058
|
# end
|
1784
2059
|
#
|
1785
2060
|
# In nested scopings, all previous parameters are overwritten by the innermost rule, with the exception of
|
1786
|
-
# <tt>:conditions</tt
|
2061
|
+
# <tt>:conditions</tt>, <tt>:include</tt>, and <tt>:joins</tt> options in <tt>:find</tt>, which are merged.
|
2062
|
+
#
|
2063
|
+
# <tt>:joins</tt> options are uniqued so multiple scopes can join in the same table without table aliasing
|
2064
|
+
# problems. If you need to join multiple tables, but still want one of the tables to be uniqued, use the
|
2065
|
+
# array of strings format for your joins.
|
1787
2066
|
#
|
1788
2067
|
# class Article < ActiveRecord::Base
|
1789
2068
|
# def self.find_with_scope
|
@@ -1809,6 +2088,9 @@ module ActiveRecord #:nodoc:
|
|
1809
2088
|
# end
|
1810
2089
|
# end
|
1811
2090
|
# end
|
2091
|
+
#
|
2092
|
+
# *Note*: the +:find+ scope also has effect on update and deletion methods,
|
2093
|
+
# like +update_all+ and +delete_all+.
|
1812
2094
|
def with_scope(method_scoping = {}, action = :merge, &block)
|
1813
2095
|
method_scoping = method_scoping.method_scoping if method_scoping.respond_to?(:method_scoping)
|
1814
2096
|
|
@@ -1826,7 +2108,7 @@ module ActiveRecord #:nodoc:
|
|
1826
2108
|
end
|
1827
2109
|
|
1828
2110
|
# Merge scopings
|
1829
|
-
if
|
2111
|
+
if [:merge, :reverse_merge].include?(action) && current_scoped_methods
|
1830
2112
|
method_scoping = current_scoped_methods.inject(method_scoping) do |hash, (method, params)|
|
1831
2113
|
case hash[method]
|
1832
2114
|
when Hash
|
@@ -1834,15 +2116,25 @@ module ActiveRecord #:nodoc:
|
|
1834
2116
|
(hash[method].keys + params.keys).uniq.each do |key|
|
1835
2117
|
merge = hash[method][key] && params[key] # merge if both scopes have the same key
|
1836
2118
|
if key == :conditions && merge
|
1837
|
-
|
2119
|
+
if params[key].is_a?(Hash) && hash[method][key].is_a?(Hash)
|
2120
|
+
hash[method][key] = merge_conditions(hash[method][key].deep_merge(params[key]))
|
2121
|
+
else
|
2122
|
+
hash[method][key] = merge_conditions(params[key], hash[method][key])
|
2123
|
+
end
|
1838
2124
|
elsif key == :include && merge
|
1839
2125
|
hash[method][key] = merge_includes(hash[method][key], params[key]).uniq
|
2126
|
+
elsif key == :joins && merge
|
2127
|
+
hash[method][key] = merge_joins(params[key], hash[method][key])
|
1840
2128
|
else
|
1841
2129
|
hash[method][key] = hash[method][key] || params[key]
|
1842
2130
|
end
|
1843
2131
|
end
|
1844
2132
|
else
|
1845
|
-
|
2133
|
+
if action == :reverse_merge
|
2134
|
+
hash[method] = hash[method].merge(params)
|
2135
|
+
else
|
2136
|
+
hash[method] = params.merge(hash[method])
|
2137
|
+
end
|
1846
2138
|
end
|
1847
2139
|
else
|
1848
2140
|
hash[method] = params
|
@@ -1852,7 +2144,6 @@ module ActiveRecord #:nodoc:
|
|
1852
2144
|
end
|
1853
2145
|
|
1854
2146
|
self.scoped_methods << method_scoping
|
1855
|
-
|
1856
2147
|
begin
|
1857
2148
|
yield
|
1858
2149
|
ensure
|
@@ -1870,10 +2161,20 @@ module ActiveRecord #:nodoc:
|
|
1870
2161
|
@@subclasses[self] + extra = @@subclasses[self].inject([]) {|list, subclass| list + subclass.subclasses }
|
1871
2162
|
end
|
1872
2163
|
|
2164
|
+
# Sets the default options for the model. The format of the
|
2165
|
+
# <tt>options</tt> argument is the same as in find.
|
2166
|
+
#
|
2167
|
+
# class Person < ActiveRecord::Base
|
2168
|
+
# default_scope :order => 'last_name, first_name'
|
2169
|
+
# end
|
2170
|
+
def default_scope(options = {})
|
2171
|
+
self.default_scoping << { :find => options, :create => (options.is_a?(Hash) && options.has_key?(:conditions)) ? options[:conditions] : {} }
|
2172
|
+
end
|
2173
|
+
|
1873
2174
|
# Test whether the given method and optional key are scoped.
|
1874
2175
|
def scoped?(method, key = nil) #:nodoc:
|
1875
2176
|
if current_scoped_methods && (scope = current_scoped_methods[method])
|
1876
|
-
!key || scope.
|
2177
|
+
!key || !scope[key].nil?
|
1877
2178
|
end
|
1878
2179
|
end
|
1879
2180
|
|
@@ -1884,38 +2185,29 @@ module ActiveRecord #:nodoc:
|
|
1884
2185
|
end
|
1885
2186
|
end
|
1886
2187
|
|
1887
|
-
def
|
1888
|
-
|
1889
|
-
scoped_methods[self] ||= []
|
1890
|
-
end
|
1891
|
-
|
1892
|
-
def single_threaded_scoped_methods #:nodoc:
|
1893
|
-
@scoped_methods ||= []
|
1894
|
-
end
|
1895
|
-
|
1896
|
-
# pick up the correct scoped_methods version from @@allow_concurrency
|
1897
|
-
if @@allow_concurrency
|
1898
|
-
alias_method :scoped_methods, :thread_safe_scoped_methods
|
1899
|
-
else
|
1900
|
-
alias_method :scoped_methods, :single_threaded_scoped_methods
|
2188
|
+
def scoped_methods #:nodoc:
|
2189
|
+
Thread.current[:"#{self}_scoped_methods"] ||= self.default_scoping.dup
|
1901
2190
|
end
|
1902
2191
|
|
1903
2192
|
def current_scoped_methods #:nodoc:
|
1904
2193
|
scoped_methods.last
|
1905
2194
|
end
|
1906
2195
|
|
1907
|
-
# Returns the class type of the record using the current module as a prefix. So
|
2196
|
+
# Returns the class type of the record using the current module as a prefix. So descendants of
|
1908
2197
|
# MyApp::Business::Account would appear as MyApp::Business::AccountSubclass.
|
1909
2198
|
def compute_type(type_name)
|
1910
2199
|
modularized_name = type_name_with_module(type_name)
|
1911
|
-
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
2200
|
+
silence_warnings do
|
2201
|
+
begin
|
2202
|
+
class_eval(modularized_name, __FILE__, __LINE__)
|
2203
|
+
rescue NameError
|
2204
|
+
class_eval(type_name, __FILE__, __LINE__)
|
2205
|
+
end
|
1915
2206
|
end
|
1916
2207
|
end
|
1917
2208
|
|
1918
|
-
# Returns the class descending directly from
|
2209
|
+
# Returns the class descending directly from ActiveRecord::Base or an
|
2210
|
+
# abstract class, if any, in the inheritance hierarchy.
|
1919
2211
|
def class_of_active_record_descendant(klass)
|
1920
2212
|
if klass.superclass == Base || klass.superclass.abstract_class?
|
1921
2213
|
klass
|
@@ -2002,24 +2294,28 @@ module ActiveRecord #:nodoc:
|
|
2002
2294
|
# # => "age BETWEEN 13 AND 18"
|
2003
2295
|
# { 'other_records.id' => 7 }
|
2004
2296
|
# # => "`other_records`.`id` = 7"
|
2297
|
+
# { :other_records => { :id => 7 } }
|
2298
|
+
# # => "`other_records`.`id` = 7"
|
2005
2299
|
# And for value objects on a composed_of relationship:
|
2006
2300
|
# { :address => Address.new("123 abc st.", "chicago") }
|
2007
2301
|
# # => "address_street='123 abc st.' and address_city='chicago'"
|
2008
|
-
def sanitize_sql_hash_for_conditions(attrs)
|
2302
|
+
def sanitize_sql_hash_for_conditions(attrs, table_name = quoted_table_name)
|
2009
2303
|
attrs = expand_hash_conditions_for_aggregates(attrs)
|
2010
2304
|
|
2011
2305
|
conditions = attrs.map do |attr, value|
|
2012
|
-
|
2306
|
+
unless value.is_a?(Hash)
|
2307
|
+
attr = attr.to_s
|
2308
|
+
|
2309
|
+
# Extract table name from qualified attribute names.
|
2310
|
+
if attr.include?('.')
|
2311
|
+
table_name, attr = attr.split('.', 2)
|
2312
|
+
table_name = connection.quote_table_name(table_name)
|
2313
|
+
end
|
2013
2314
|
|
2014
|
-
|
2015
|
-
if attr.include?('.')
|
2016
|
-
table_name, attr = attr.split('.', 2)
|
2017
|
-
table_name = connection.quote_table_name(table_name)
|
2315
|
+
attribute_condition("#{table_name}.#{connection.quote_column_name(attr)}", value)
|
2018
2316
|
else
|
2019
|
-
|
2317
|
+
sanitize_sql_hash_for_conditions(value, connection.quote_table_name(attr.to_s))
|
2020
2318
|
end
|
2021
|
-
|
2022
|
-
"#{table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}"
|
2023
2319
|
end.join(' AND ')
|
2024
2320
|
|
2025
2321
|
replace_bind_variables(conditions, expand_range_bind_variables(attrs.values))
|
@@ -2073,6 +2369,8 @@ module ActiveRecord #:nodoc:
|
|
2073
2369
|
expanded = []
|
2074
2370
|
|
2075
2371
|
bind_vars.each do |var|
|
2372
|
+
next if var.is_a?(Hash)
|
2373
|
+
|
2076
2374
|
if var.is_a?(Range)
|
2077
2375
|
expanded << var.first
|
2078
2376
|
expanded << var.last
|
@@ -2085,7 +2383,7 @@ module ActiveRecord #:nodoc:
|
|
2085
2383
|
end
|
2086
2384
|
|
2087
2385
|
def quote_bound_value(value) #:nodoc:
|
2088
|
-
if value.respond_to?(:map) && !value.
|
2386
|
+
if value.respond_to?(:map) && !value.acts_like?(:string)
|
2089
2387
|
if value.respond_to?(:empty?) && value.empty?
|
2090
2388
|
connection.quote(nil)
|
2091
2389
|
else
|
@@ -2103,7 +2401,7 @@ module ActiveRecord #:nodoc:
|
|
2103
2401
|
end
|
2104
2402
|
|
2105
2403
|
VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset,
|
2106
|
-
:order, :select, :readonly, :group, :from, :lock ]
|
2404
|
+
:order, :select, :readonly, :group, :having, :from, :lock ]
|
2107
2405
|
|
2108
2406
|
def validate_find_options(options) #:nodoc:
|
2109
2407
|
options.assert_valid_keys(VALID_FIND_OPTIONS)
|
@@ -2157,7 +2455,28 @@ module ActiveRecord #:nodoc:
|
|
2157
2455
|
|
2158
2456
|
end
|
2159
2457
|
|
2160
|
-
#
|
2458
|
+
# Returns a String, which Action Pack uses for constructing an URL to this
|
2459
|
+
# object. The default implementation returns this record's id as a String,
|
2460
|
+
# or nil if this record's unsaved.
|
2461
|
+
#
|
2462
|
+
# For example, suppose that you have a User model, and that you have a
|
2463
|
+
# <tt>map.resources :users</tt> route. Normally, +user_path+ will
|
2464
|
+
# construct a path with the user object's 'id' in it:
|
2465
|
+
#
|
2466
|
+
# user = User.find_by_name('Phusion')
|
2467
|
+
# user_path(user) # => "/users/1"
|
2468
|
+
#
|
2469
|
+
# You can override +to_param+ in your model to make +user_path+ construct
|
2470
|
+
# a path using the user's name instead of the user's id:
|
2471
|
+
#
|
2472
|
+
# class User < ActiveRecord::Base
|
2473
|
+
# def to_param # overridden
|
2474
|
+
# name
|
2475
|
+
# end
|
2476
|
+
# end
|
2477
|
+
#
|
2478
|
+
# user = User.find_by_name('Phusion')
|
2479
|
+
# user_path(user) # => "/users/Phusion"
|
2161
2480
|
def to_param
|
2162
2481
|
# We can't use alias_method here, because method 'id' optimizes itself on the fly.
|
2163
2482
|
(id = self.id) ? id.to_s : nil # Be sure to stringify the id for routes
|
@@ -2173,11 +2492,11 @@ module ActiveRecord #:nodoc:
|
|
2173
2492
|
def cache_key
|
2174
2493
|
case
|
2175
2494
|
when new_record?
|
2176
|
-
"#{self.class.
|
2177
|
-
when self[:updated_at]
|
2178
|
-
"#{self.class.
|
2495
|
+
"#{self.class.model_name.cache_key}/new"
|
2496
|
+
when timestamp = self[:updated_at]
|
2497
|
+
"#{self.class.model_name.cache_key}/#{id}-#{timestamp.to_s(:number)}"
|
2179
2498
|
else
|
2180
|
-
"#{self.class.
|
2499
|
+
"#{self.class.model_name.cache_key}/#{id}"
|
2181
2500
|
end
|
2182
2501
|
end
|
2183
2502
|
|
@@ -2194,37 +2513,73 @@ module ActiveRecord #:nodoc:
|
|
2194
2513
|
write_attribute(self.class.primary_key, value)
|
2195
2514
|
end
|
2196
2515
|
|
2197
|
-
# Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet.
|
2516
|
+
# Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet; otherwise, returns false.
|
2198
2517
|
def new_record?
|
2199
|
-
|
2518
|
+
@new_record || false
|
2200
2519
|
end
|
2201
2520
|
|
2202
|
-
#
|
2203
|
-
#
|
2521
|
+
# :call-seq:
|
2522
|
+
# save(perform_validation = true)
|
2523
|
+
#
|
2524
|
+
# Saves the model.
|
2525
|
+
#
|
2526
|
+
# If the model is new a record gets created in the database, otherwise
|
2527
|
+
# the existing record gets updated.
|
2204
2528
|
#
|
2205
|
-
#
|
2206
|
-
#
|
2207
|
-
#
|
2208
|
-
#
|
2209
|
-
#
|
2529
|
+
# If +perform_validation+ is true validations run. If any of them fail
|
2530
|
+
# the action is cancelled and +save+ returns +false+. If the flag is
|
2531
|
+
# false validations are bypassed altogether. See
|
2532
|
+
# ActiveRecord::Validations for more information.
|
2533
|
+
#
|
2534
|
+
# There's a series of callbacks associated with +save+. If any of the
|
2535
|
+
# <tt>before_*</tt> callbacks return +false+ the action is cancelled and
|
2536
|
+
# +save+ returns +false+. See ActiveRecord::Callbacks for further
|
2537
|
+
# details.
|
2210
2538
|
def save
|
2211
2539
|
create_or_update
|
2212
2540
|
end
|
2213
2541
|
|
2214
|
-
#
|
2215
|
-
#
|
2542
|
+
# Saves the model.
|
2543
|
+
#
|
2544
|
+
# If the model is new a record gets created in the database, otherwise
|
2545
|
+
# the existing record gets updated.
|
2546
|
+
#
|
2547
|
+
# With <tt>save!</tt> validations always run. If any of them fail
|
2548
|
+
# ActiveRecord::RecordInvalid gets raised. See ActiveRecord::Validations
|
2549
|
+
# for more information.
|
2550
|
+
#
|
2551
|
+
# There's a series of callbacks associated with <tt>save!</tt>. If any of
|
2552
|
+
# the <tt>before_*</tt> callbacks return +false+ the action is cancelled
|
2553
|
+
# and <tt>save!</tt> raises ActiveRecord::RecordNotSaved. See
|
2554
|
+
# ActiveRecord::Callbacks for further details.
|
2216
2555
|
def save!
|
2217
2556
|
create_or_update || raise(RecordNotSaved)
|
2218
2557
|
end
|
2219
2558
|
|
2559
|
+
# Deletes the record in the database and freezes this instance to
|
2560
|
+
# reflect that no changes should be made (since they can't be
|
2561
|
+
# persisted). Returns the frozen instance.
|
2562
|
+
#
|
2563
|
+
# The row is simply removed with a SQL +DELETE+ statement on the
|
2564
|
+
# record's primary key, and no callbacks are executed.
|
2565
|
+
#
|
2566
|
+
# To enforce the object's +before_destroy+ and +after_destroy+
|
2567
|
+
# callbacks, Observer methods, or any <tt>:dependent</tt> association
|
2568
|
+
# options, use <tt>#destroy</tt>.
|
2569
|
+
def delete
|
2570
|
+
self.class.delete(id) unless new_record?
|
2571
|
+
freeze
|
2572
|
+
end
|
2573
|
+
|
2220
2574
|
# Deletes the record in the database and freezes this instance to reflect that no changes should
|
2221
2575
|
# be made (since they can't be persisted).
|
2222
2576
|
def destroy
|
2223
2577
|
unless new_record?
|
2224
|
-
connection.delete
|
2225
|
-
DELETE FROM #{self.class.quoted_table_name}
|
2226
|
-
WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quoted_id}
|
2227
|
-
|
2578
|
+
connection.delete(
|
2579
|
+
"DELETE FROM #{self.class.quoted_table_name} " +
|
2580
|
+
"WHERE #{connection.quote_column_name(self.class.primary_key)} = #{quoted_id}",
|
2581
|
+
"#{self.class.name} Destroy"
|
2582
|
+
)
|
2228
2583
|
end
|
2229
2584
|
|
2230
2585
|
freeze
|
@@ -2258,12 +2613,12 @@ module ActiveRecord #:nodoc:
|
|
2258
2613
|
end
|
2259
2614
|
end
|
2260
2615
|
|
2261
|
-
# Updates a single attribute and saves the record
|
2262
|
-
#
|
2263
|
-
#
|
2616
|
+
# Updates a single attribute and saves the record without going through the normal validation procedure.
|
2617
|
+
# This is especially useful for boolean flags on existing records. The regular +update_attribute+ method
|
2618
|
+
# in Base is replaced with this when the validations module is mixed in, which it is by default.
|
2264
2619
|
def update_attribute(name, value)
|
2265
2620
|
send(name.to_s + '=', value)
|
2266
|
-
save
|
2621
|
+
save(false)
|
2267
2622
|
end
|
2268
2623
|
|
2269
2624
|
# Updates all the attributes from the passed-in Hash and saves the record. If the object is invalid, the saving will
|
@@ -2356,10 +2711,25 @@ module ActiveRecord #:nodoc:
|
|
2356
2711
|
end
|
2357
2712
|
|
2358
2713
|
# Allows you to set all the attributes at once by passing in a hash with keys
|
2359
|
-
# matching the attribute names (which again matches the column names).
|
2360
|
-
#
|
2361
|
-
#
|
2714
|
+
# matching the attribute names (which again matches the column names).
|
2715
|
+
#
|
2716
|
+
# If +guard_protected_attributes+ is true (the default), then sensitive
|
2717
|
+
# attributes can be protected from this form of mass-assignment by using
|
2718
|
+
# the +attr_protected+ macro. Or you can alternatively specify which
|
2719
|
+
# attributes *can* be accessed with the +attr_accessible+ macro. Then all the
|
2362
2720
|
# attributes not included in that won't be allowed to be mass-assigned.
|
2721
|
+
#
|
2722
|
+
# class User < ActiveRecord::Base
|
2723
|
+
# attr_protected :is_admin
|
2724
|
+
# end
|
2725
|
+
#
|
2726
|
+
# user = User.new
|
2727
|
+
# user.attributes = { :username => 'Phusion', :is_admin => true }
|
2728
|
+
# user.username # => "Phusion"
|
2729
|
+
# user.is_admin? # => false
|
2730
|
+
#
|
2731
|
+
# user.send(:attributes=, { :username => 'Phusion', :is_admin => true }, false)
|
2732
|
+
# user.is_admin? # => true
|
2363
2733
|
def attributes=(new_attributes, guard_protected_attributes = true)
|
2364
2734
|
return if new_attributes.nil?
|
2365
2735
|
attributes = new_attributes.dup
|
@@ -2369,13 +2739,16 @@ module ActiveRecord #:nodoc:
|
|
2369
2739
|
attributes = remove_attributes_protected_from_mass_assignment(attributes) if guard_protected_attributes
|
2370
2740
|
|
2371
2741
|
attributes.each do |k, v|
|
2372
|
-
k.include?("(")
|
2742
|
+
if k.include?("(")
|
2743
|
+
multi_parameter_attributes << [ k, v ]
|
2744
|
+
else
|
2745
|
+
respond_to?(:"#{k}=") ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}")
|
2746
|
+
end
|
2373
2747
|
end
|
2374
2748
|
|
2375
2749
|
assign_multiparameter_attributes(multi_parameter_attributes)
|
2376
2750
|
end
|
2377
2751
|
|
2378
|
-
|
2379
2752
|
# Returns a hash of all the attributes with their names as keys and the values of the attributes as values.
|
2380
2753
|
def attributes
|
2381
2754
|
self.attribute_names.inject({}) do |attrs, name|
|
@@ -2392,7 +2765,19 @@ module ActiveRecord #:nodoc:
|
|
2392
2765
|
end
|
2393
2766
|
end
|
2394
2767
|
|
2395
|
-
#
|
2768
|
+
# Returns an <tt>#inspect</tt>-like string for the value of the
|
2769
|
+
# attribute +attr_name+. String attributes are elided after 50
|
2770
|
+
# characters, and Date and Time attributes are returned in the
|
2771
|
+
# <tt>:db</tt> format. Other attributes return the value of
|
2772
|
+
# <tt>#inspect</tt> without modification.
|
2773
|
+
#
|
2774
|
+
# person = Person.create!(:name => "David Heinemeier Hansson " * 3)
|
2775
|
+
#
|
2776
|
+
# person.attribute_for_inspect(:name)
|
2777
|
+
# # => '"David Heinemeier Hansson David Heinemeier Hansson D..."'
|
2778
|
+
#
|
2779
|
+
# person.attribute_for_inspect(:created_at)
|
2780
|
+
# # => '"2009-01-12 04:48:57"'
|
2396
2781
|
def attribute_for_inspect(attr_name)
|
2397
2782
|
value = read_attribute(attr_name)
|
2398
2783
|
|
@@ -2521,7 +2906,7 @@ module ActiveRecord #:nodoc:
|
|
2521
2906
|
id
|
2522
2907
|
end
|
2523
2908
|
|
2524
|
-
# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base
|
2909
|
+
# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base descendant.
|
2525
2910
|
# Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to do Reply.new without having to
|
2526
2911
|
# set <tt>Reply[Reply.inheritance_column] = "Reply"</tt> yourself. No such attribute would be set for objects of the
|
2527
2912
|
# Message class in that example.
|
@@ -2532,11 +2917,14 @@ module ActiveRecord #:nodoc:
|
|
2532
2917
|
end
|
2533
2918
|
|
2534
2919
|
def convert_number_column_value(value)
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2920
|
+
if value == false
|
2921
|
+
0
|
2922
|
+
elsif value == true
|
2923
|
+
1
|
2924
|
+
elsif value.is_a?(String) && value.blank?
|
2925
|
+
nil
|
2926
|
+
else
|
2927
|
+
value
|
2540
2928
|
end
|
2541
2929
|
end
|
2542
2930
|
|
@@ -2555,7 +2943,7 @@ module ActiveRecord #:nodoc:
|
|
2555
2943
|
removed_attributes = attributes.keys - safe_attributes.keys
|
2556
2944
|
|
2557
2945
|
if removed_attributes.any?
|
2558
|
-
|
2946
|
+
log_protected_attribute_removal(removed_attributes)
|
2559
2947
|
end
|
2560
2948
|
|
2561
2949
|
safe_attributes
|
@@ -2570,6 +2958,10 @@ module ActiveRecord #:nodoc:
|
|
2570
2958
|
end
|
2571
2959
|
end
|
2572
2960
|
|
2961
|
+
def log_protected_attribute_removal(*attributes)
|
2962
|
+
logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
|
2963
|
+
end
|
2964
|
+
|
2573
2965
|
# The primary key and inheritance column can never be set by mass-assignment for security reasons.
|
2574
2966
|
def attributes_protected_by_default
|
2575
2967
|
default = [ self.class.primary_key, self.class.inheritance_column ]
|
@@ -2723,7 +3115,7 @@ module ActiveRecord #:nodoc:
|
|
2723
3115
|
end
|
2724
3116
|
|
2725
3117
|
def object_from_yaml(string)
|
2726
|
-
return string unless string.is_a?(String)
|
3118
|
+
return string unless string.is_a?(String) && string =~ /^---/
|
2727
3119
|
YAML::load(string) rescue string
|
2728
3120
|
end
|
2729
3121
|
|
@@ -2741,4 +3133,23 @@ module ActiveRecord #:nodoc:
|
|
2741
3133
|
value
|
2742
3134
|
end
|
2743
3135
|
end
|
3136
|
+
|
3137
|
+
Base.class_eval do
|
3138
|
+
extend QueryCache::ClassMethods
|
3139
|
+
include Validations
|
3140
|
+
include Locking::Optimistic, Locking::Pessimistic
|
3141
|
+
include AttributeMethods
|
3142
|
+
include Dirty
|
3143
|
+
include Callbacks, Observing, Timestamp
|
3144
|
+
include Associations, AssociationPreload, NamedScope
|
3145
|
+
|
3146
|
+
# AutosaveAssociation needs to be included before Transactions, because we want
|
3147
|
+
# #save_with_autosave_associations to be wrapped inside a transaction.
|
3148
|
+
include AutosaveAssociation, NestedAttributes
|
3149
|
+
|
3150
|
+
include Aggregations, Transactions, Reflection, Batches, Calculations, Serialization
|
3151
|
+
end
|
2744
3152
|
end
|
3153
|
+
|
3154
|
+
# TODO: Remove this and make it work with LAZY flag
|
3155
|
+
require 'active_record/connection_adapters/abstract_adapter'
|