radiant 0.6.9 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +105 -3
- data/CONTRIBUTORS +29 -0
- data/INSTALL +4 -2
- data/LICENSE +1 -1
- data/README +4 -0
- data/app/controllers/admin/abstract_model_controller.rb +4 -0
- data/app/controllers/admin/extensions_controller.rb +5 -0
- data/app/controllers/admin/layouts_controller.rb +6 -0
- data/app/controllers/admin/page_parts_controller.rb +9 -0
- data/app/controllers/admin/pages_controller.rb +56 -0
- data/app/controllers/admin/preferences_controller.rb +46 -0
- data/app/controllers/admin/references_controller.rb +7 -0
- data/app/controllers/admin/resource_controller.rb +180 -0
- data/app/controllers/admin/snippets_controller.rb +2 -0
- data/app/controllers/admin/users_controller.rb +21 -0
- data/app/controllers/admin/welcome_controller.rb +1 -1
- data/app/controllers/application.rb +7 -3
- data/app/controllers/site_controller.rb +0 -7
- data/app/helpers/admin/extensions_helper.rb +2 -0
- data/app/helpers/admin/layouts_helper.rb +2 -0
- data/app/helpers/admin/pages_helper.rb +59 -0
- data/app/helpers/admin/preferences_helper.rb +2 -0
- data/app/helpers/admin/references_helper.rb +42 -0
- data/app/helpers/admin/snippets_helper.rb +2 -0
- data/app/helpers/admin/users_helper.rb +8 -0
- data/app/helpers/application_helper.rb +12 -8
- data/app/models/page.rb +33 -3
- data/app/models/page_part.rb +5 -1
- data/app/models/radiant/config.rb +3 -3
- data/app/models/response_cache.rb +20 -12
- data/app/models/standard_tags.rb +285 -180
- data/app/models/user.rb +5 -1
- data/app/views/admin/extensions/index.html.haml +40 -0
- data/app/views/admin/layouts/_form.html.haml +36 -0
- data/app/views/admin/layouts/edit.html.haml +7 -0
- data/app/views/admin/layouts/index.html.haml +34 -0
- data/app/views/admin/layouts/new.html.haml +5 -0
- data/app/views/admin/layouts/remove.html.haml +16 -0
- data/app/views/admin/page_parts/_page_part.html.haml +15 -0
- data/app/views/admin/pages/_edit_styles.html.haml +15 -0
- data/app/views/admin/pages/_fields.html.haml +60 -0
- data/app/views/admin/pages/_meta_row.html.haml +6 -0
- data/app/views/admin/pages/_node.html.haml +25 -0
- data/app/views/admin/pages/_popups.html.haml +30 -0
- data/app/views/admin/pages/children.html.haml +2 -0
- data/app/views/admin/pages/edit.html.haml +9 -0
- data/app/views/admin/pages/index.html.haml +28 -0
- data/app/views/admin/pages/new.html.haml +9 -0
- data/app/views/admin/pages/remove.html.haml +21 -0
- data/app/views/admin/preferences/edit.html.haml +36 -0
- data/app/views/admin/references/_tag_reference.haml +3 -0
- data/app/views/admin/references/filters.js.erb +5 -0
- data/app/views/admin/references/tags.js.erb +5 -0
- data/app/views/admin/snippets/_form.html.haml +29 -0
- data/app/views/admin/snippets/edit.html.haml +5 -0
- data/app/views/admin/snippets/index.html.haml +30 -0
- data/app/views/admin/snippets/new.html.haml +5 -0
- data/app/views/admin/snippets/remove.html.haml +19 -0
- data/app/views/admin/users/_form.html.haml +74 -0
- data/app/views/admin/users/edit.html.haml +5 -0
- data/app/views/admin/users/index.html.haml +35 -0
- data/app/views/admin/users/new.html.haml +5 -0
- data/app/views/admin/users/remove.html.haml +18 -0
- data/app/views/layouts/application.html.haml +5 -5
- data/config/boot.rb +24 -7
- data/config/environment.rb +7 -3
- data/config/environments/development.rb +0 -1
- data/config/environments/test.rb +1 -5
- data/config/routes.rb +21 -49
- data/db/migrate/20081203140407_add_indexes.rb +19 -0
- data/db/schema.rb +10 -3
- data/db/templates/roasters.yml +1210 -0
- data/lib/generators/extension/templates/extension.rb +4 -2
- data/lib/generators/extension/templates/spec_helper.rb +2 -3
- data/lib/generators/extension/templates/tasks.rake +1 -1
- data/lib/generators/extension_controller/extension_controller_generator.rb +11 -3
- data/lib/generators/extension_controller/templates/controller.rb +0 -4
- data/lib/generators/extension_controller/templates/functional_test.rb +1 -7
- data/lib/generators/extension_controller/templates/{view.rhtml → view.html.erb} +0 -0
- data/lib/generators/extension_mailer/USAGE +17 -0
- data/lib/generators/extension_mailer/extension_mailer_generator.rb +68 -0
- data/lib/generators/extension_mailer/templates/fixture.erb +3 -0
- data/lib/generators/extension_mailer/templates/mailer.rb +15 -0
- data/lib/generators/extension_mailer/templates/unit_test.rb +21 -0
- data/lib/generators/extension_mailer/templates/view.erb +3 -0
- data/lib/generators/extension_migration/USAGE +34 -0
- data/lib/generators/extension_migration/extension_migration_generator.rb +25 -0
- data/lib/generators/extension_migration/templates/migration.rb +11 -0
- data/lib/generators/extension_model/extension_model_generator.rb +10 -2
- data/lib/generators/extension_model/templates/fixtures.yml +11 -3
- data/lib/generators/extension_model/templates/migration.rb +4 -1
- data/lib/generators/extension_model/templates/unit_test.rb +2 -4
- data/lib/generators/generator_base_extension.rb +0 -7
- data/lib/generators/instance/templates/instance_boot.rb +27 -7
- data/lib/generators/instance/templates/instance_environment.rb +1 -2
- data/lib/generators/instance/templates/instance_generate +2 -0
- data/lib/local_time.rb +2 -2
- data/lib/login_system.rb +18 -31
- data/lib/plugins/active_record_extensions/lib/active_record_extensions.rb +30 -1
- data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +1 -1
- data/lib/plugins/string_extensions/lib/string_extensions.rb +7 -0
- data/lib/radiant.rb +2 -2
- data/lib/radiant/admin_ui.rb +41 -3
- data/lib/radiant/compat.rb +10 -0
- data/lib/radiant/extension.rb +9 -10
- data/lib/radiant/extension/script.rb +103 -7
- data/lib/radiant/extension_loader.rb +1 -1
- data/lib/radiant/extension_migrator.rb +77 -38
- data/lib/radiant/initializer.rb +13 -1
- data/lib/radiant/legacy_routes.rb +72 -0
- data/lib/radiant/resource_responses.rb +115 -0
- data/lib/radiant/taggable.rb +17 -0
- data/lib/tasks/database.rake +0 -42
- data/lib/tasks/extensions.rake +1 -23
- data/lib/tasks/framework.rake +3 -1
- data/lib/tasks/instance.rake +7 -10
- data/lib/tasks/release.rake +22 -8
- data/lib/tasks/rspec.rake +173 -0
- data/lib/tasks/undefine.rake +1 -1
- data/public/javascripts/admin/admin.js +14 -16
- data/public/javascripts/admin/sitemap.js +1 -1
- data/public/javascripts/controls.js +4 -6
- data/public/javascripts/dragdrop.js +1 -3
- data/public/javascripts/effects.js +1 -3
- data/public/javascripts/prototype.js +132 -91
- data/public/stylesheets/admin/main.css +13 -1
- data/script/autospec +5 -0
- data/script/dbconsole +3 -0
- data/script/generate +2 -2
- data/script/performance/request +3 -0
- data/script/spec +3 -10
- data/script/spec_server +22 -5
- data/spec/controllers/admin/export_controller_spec.rb +1 -1
- data/spec/controllers/admin/extensions_controller_spec.rb +21 -0
- data/spec/controllers/admin/layouts_controller_spec.rb +56 -0
- data/spec/controllers/admin/pages_controller_spec.rb +187 -0
- data/spec/controllers/admin/preferences_controller_spec.rb +38 -0
- data/spec/controllers/admin/references_controller_spec.rb +15 -0
- data/spec/controllers/admin/snippets_controller_spec.rb +51 -0
- data/spec/controllers/admin/users_controller_spec.rb +48 -0
- data/spec/controllers/admin/welcome_controller_spec.rb +2 -2
- data/spec/controllers/application_controller_spec.rb +7 -3
- data/spec/controllers/site_controller_spec.rb +5 -38
- data/spec/datasets/file_not_found_dataset.rb +22 -0
- data/spec/datasets/home_page_dataset.rb +64 -0
- data/spec/datasets/layouts_dataset.rb +58 -0
- data/spec/datasets/markup_pages_dataset.rb +13 -0
- data/spec/datasets/pages_dataset.rb +56 -0
- data/spec/datasets/pages_with_layouts_dataset.rb +10 -0
- data/spec/datasets/snippets_dataset.rb +38 -0
- data/spec/datasets/users_and_pages_dataset.rb +9 -0
- data/spec/datasets/users_dataset.rb +43 -0
- data/spec/fixtures/example_extension/README +3 -0
- data/spec/fixtures/example_extension/Rakefile +120 -0
- data/spec/fixtures/example_extension/example_extension.rb +21 -0
- data/spec/fixtures/example_extension/lib/tasks/example_extension_tasks.rake +28 -0
- data/spec/fixtures/example_extension/spec/spec.opts +6 -0
- data/spec/fixtures/example_extension/spec/spec_helper.rb +36 -0
- data/spec/generators/extension_controller_generator_spec.rb +85 -0
- data/spec/generators/extension_generator_spec.rb +172 -0
- data/spec/generators/extension_generators_spec_helper.rb +139 -0
- data/spec/generators/extension_mailer_generator_spec.rb +60 -0
- data/spec/generators/extension_migration_generator_spec.rb +21 -0
- data/spec/generators/extension_model_generator_spec.rb +61 -0
- data/spec/helpers/admin/extensions_helper_spec.rb +4 -0
- data/spec/helpers/admin/layouts_helper_spec.rb +4 -0
- data/spec/helpers/admin/node_helper_spec.rb +33 -31
- data/spec/helpers/admin/pages_helper_spec.rb +63 -0
- data/spec/helpers/admin/preferences_helper_spec.rb +11 -0
- data/spec/helpers/admin/regions_helper_spec.rb +16 -13
- data/spec/helpers/admin/snippets_helper_spec.rb +4 -0
- data/spec/helpers/admin/users_helper_spec.rb +11 -0
- data/spec/helpers/application_helper_spec.rb +75 -61
- data/spec/integration/admin/content_negotiation_spec.rb +27 -0
- data/spec/integration/admin/pages_integration_spec.rb +118 -0
- data/spec/integration/admin/permission_integration_spec.rb +24 -0
- data/spec/integration/admin/snippets_integration_spec.rb +73 -0
- data/spec/integration/admin/user_management_integration_spec.rb +80 -0
- data/spec/integration/admin/user_preferences_integration_spec.rb +19 -0
- data/spec/integration/page_serving_spec.rb +37 -0
- data/spec/lib/autotest_spec.rb +1 -1
- data/spec/lib/core_ext/string_ext_spec.rb +10 -0
- data/spec/lib/login_system_spec.rb +143 -135
- data/spec/lib/radiant/admin_ui_spec.rb +33 -1
- data/spec/lib/radiant/extension/script_spec.rb +111 -4
- data/spec/lib/radiant/extension_migrator_spec.rb +31 -2
- data/spec/lib/radiant/extension_spec.rb +5 -1
- data/spec/lib/radiant/legacy_routes_spec.rb +14 -0
- data/spec/lib/radiant/resource_responses_spec.rb +207 -0
- data/spec/lib/radiant/taggable_spec.rb +38 -2
- data/{vendor/plugins/rspec/spec → spec/matchers}/autotest_matchers.rb +0 -0
- data/spec/matchers/generator_matchers.rb +237 -0
- data/spec/matchers/login_system_matcher.rb +1 -1
- data/spec/matchers/render_form_errors_matcher.rb +62 -0
- data/spec/matchers/render_matcher.rb +2 -2
- data/spec/models/file_not_found_page_spec.rb +1 -1
- data/spec/models/layout_spec.rb +1 -1
- data/spec/models/page_context_spec.rb +2 -4
- data/spec/models/page_part_spec.rb +24 -4
- data/spec/models/page_spec.rb +162 -110
- data/spec/models/radiant/exporter_spec.rb +1 -1
- data/spec/models/response_cache_spec.rb +28 -1
- data/spec/models/snippet_spec.rb +1 -1
- data/spec/models/standard_tags_spec.rb +52 -8
- data/spec/models/user_action_observer_spec.rb +1 -1
- data/spec/models/user_spec.rb +3 -3
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +45 -2
- data/test/fixtures/extensions/01_basic/basic_extension.rb +1 -1
- data/test/fixtures/extensions/01_basic/db/migrate/200812131420_create_initial_schema.rb +10 -0
- data/test/fixtures/extensions/01_basic/db/migrate/200812131421_modify_initial_schema.rb +10 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/01_first.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/02_second.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/03_pending.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/db/migrate/04_dont_run.rb +7 -0
- data/test/fixtures/extensions/03_upgrading/upgrading_extension.rb +2 -0
- data/test/fixtures/extensions/special_characters/db/migrate/001_create_initial_schema.rb +10 -0
- data/test/fixtures/extensions/special_characters/special_characters_extension.rb +3 -0
- data/test/helpers/page_test_helper.rb +3 -1
- data/vendor/extensions/archive/spec/datasets/archive_dataset.rb +51 -0
- data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +1 -1
- data/vendor/extensions/archive/spec/spec_helper.rb +2 -3
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +5 -4
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +33 -0
- data/vendor/extensions/markdown_filter/lib/smarty_pants_filter.rb +0 -2
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +18 -1
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +11 -4
- data/vendor/extensions/markdown_filter/spec/models/smarty_pants_filter_spec.rb +8 -1
- data/vendor/extensions/markdown_filter/spec/spec_helper.rb +2 -3
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/CHANGES +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/LICENSE +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/README +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/bin/bluecloth +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/install.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/lib/bluecloth.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/test.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/00_Class.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/05_Markdown.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/10_Bug.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/15_Contrib.tests.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/bctestcase.rb +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/antsugar.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/ml-announce.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/re-overflow.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/tests/data/re-overflow2.txt +0 -0
- data/vendor/{bluecloth → extensions/markdown_filter/vendor/bluecloth}/utils.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/README +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/Rakefile +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/install.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/rubypants.rb +0 -0
- data/vendor/{rubypants → extensions/markdown_filter/vendor/rubypants}/test_rubypants.rb +0 -0
- data/vendor/extensions/textile_filter/lib/textile_filter.rb +0 -2
- data/vendor/extensions/textile_filter/lib/textile_tags.rb +24 -0
- data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +9 -1
- data/vendor/extensions/textile_filter/spec/spec_helper.rb +2 -3
- data/vendor/extensions/textile_filter/textile_filter_extension.rb +3 -2
- data/vendor/plugins/dataset/History.txt +9 -0
- data/vendor/plugins/dataset/LICENSE +19 -0
- data/vendor/plugins/dataset/Manifest.txt +21 -0
- data/vendor/plugins/dataset/README.txt +111 -0
- data/vendor/plugins/dataset/Rakefile +20 -0
- data/vendor/plugins/dataset/TODO +19 -0
- data/vendor/plugins/dataset/lib/dataset.rb +123 -0
- data/vendor/plugins/dataset/lib/dataset/base.rb +157 -0
- data/vendor/plugins/dataset/lib/dataset/collection.rb +19 -0
- data/vendor/plugins/dataset/lib/dataset/database/base.rb +30 -0
- data/vendor/plugins/dataset/lib/dataset/database/mysql.rb +34 -0
- data/vendor/plugins/dataset/lib/dataset/database/postgresql.rb +34 -0
- data/vendor/plugins/dataset/lib/dataset/database/sqlite3.rb +32 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/rspec.rb +21 -0
- data/vendor/plugins/dataset/lib/dataset/extensions/test_unit.rb +60 -0
- data/vendor/plugins/dataset/lib/dataset/instance_methods.rb +10 -0
- data/vendor/plugins/dataset/lib/dataset/load.rb +47 -0
- data/vendor/plugins/dataset/lib/dataset/record/fixture.rb +54 -0
- data/vendor/plugins/dataset/lib/dataset/record/meta.rb +42 -0
- data/vendor/plugins/dataset/lib/dataset/record/model.rb +41 -0
- data/vendor/plugins/dataset/lib/dataset/resolver.rb +110 -0
- data/vendor/plugins/dataset/lib/dataset/session.rb +51 -0
- data/vendor/plugins/dataset/lib/dataset/session_binding.rb +299 -0
- data/vendor/plugins/dataset/lib/dataset/version.rb +9 -0
- data/vendor/plugins/dataset/spec/dataset/database/base_spec.rb +21 -0
- data/vendor/plugins/dataset/spec/dataset/resolver_spec.rb +110 -0
- data/vendor/plugins/dataset/spec/dataset/rspec_spec.rb +137 -0
- data/vendor/plugins/dataset/spec/dataset/session_binding_spec.rb +160 -0
- data/vendor/plugins/dataset/spec/dataset/session_spec.rb +299 -0
- data/vendor/plugins/dataset/spec/dataset/test_unit_spec.rb +209 -0
- data/vendor/plugins/{rspec/spec/spec/runner/empty_file.txt → dataset/spec/fixtures/datasets/constant_not_defined.rb} +0 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/ending_with_dataset.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/exact_name.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/datasets/not_a_dataset_base.rb +2 -0
- data/vendor/plugins/dataset/spec/fixtures/more_datasets/in_another_directory.rb +2 -0
- data/vendor/plugins/dataset/spec/models.rb +6 -0
- data/vendor/plugins/dataset/spec/schema.rb +24 -0
- data/vendor/plugins/{scenarios → dataset}/spec/spec.opts +0 -0
- data/vendor/plugins/dataset/spec/spec_helper.rb +49 -0
- data/vendor/plugins/dataset/tasks/dataset.rake +19 -0
- data/vendor/plugins/{scenarios → spec_integration}/LICENSE +0 -0
- data/vendor/plugins/spec_integration/README +117 -0
- data/vendor/plugins/spec_integration/Rakefile +10 -0
- data/vendor/plugins/spec_integration/lib/spec/integration.rb +10 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl.rb +11 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/form.rb +157 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/integration_example_group.rb +97 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/dsl/navigation.rb +102 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions.rb +8 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/action_controller.rb +25 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/extensions/hash.rb +48 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers.rb +1 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/display_object.rb +41 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/have_link_to.rb +35 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/navigate_successfully.rb +60 -0
- data/vendor/plugins/spec_integration/lib/spec/integration/matchers/showing.rb +44 -0
- data/vendor/plugins/spec_integration/spec/application.rb +3 -0
- data/vendor/plugins/spec_integration/spec/dispatcher.rb +24 -0
- data/vendor/plugins/spec_integration/spec/dsl/form_spec.rb +130 -0
- data/vendor/plugins/spec_integration/spec/dsl/integration_spec_spec.rb +38 -0
- data/vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb +35 -0
- data/vendor/plugins/spec_integration/spec/integration_dsl_controller.rb +5 -0
- data/vendor/plugins/spec_integration/spec/spec.opts +7 -0
- data/vendor/plugins/spec_integration/spec/spec_helper.rb +10 -0
- data/vendor/plugins/spec_integration/tasks/integration.rake +14 -0
- data/vendor/plugins/vizres/CHANGELOG +15 -0
- data/vendor/plugins/vizres/MIT-LICENSE +16 -0
- data/vendor/plugins/vizres/README +80 -0
- data/vendor/plugins/vizres/Rakefile +22 -0
- data/vendor/plugins/vizres/init.rb +1 -0
- data/vendor/plugins/vizres/lib/vizres.rb +33 -0
- data/vendor/plugins/vizres/lib/vizres/browser.rb +36 -0
- data/vendor/plugins/vizres/lib/vizres/scm.rb +27 -0
- data/vendor/plugins/vizres/test/vizres/browser_test.rb +76 -0
- data/vendor/plugins/vizres/test/vizres/scm_test.rb +41 -0
- data/vendor/plugins/vizres/test/vizres_test.rb +55 -0
- data/vendor/plugins/vizres/vizres.gemspec +26 -0
- data/vendor/rails/actionmailer/CHANGELOG +21 -0
- data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
- data/vendor/rails/actionmailer/README +14 -10
- data/vendor/rails/actionmailer/Rakefile +8 -4
- data/vendor/rails/actionmailer/lib/action_mailer.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/adv_attr_accessor.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +145 -101
- data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +7 -7
- data/vendor/rails/actionmailer/lib/action_mailer/part.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +3 -1
- data/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +15 -10
- data/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail.rb +5 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/address.rb +426 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +46 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/base64.rb +46 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/compat.rb +41 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/config.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/core_extensions.rb +63 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/encode.rb +581 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb +960 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/index.rb +9 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb +1130 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/loader.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb +578 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mailbox.rb +495 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/main.rb +6 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mbox.rb +3 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/net.rb +248 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/obsolete.rb +132 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +1476 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.1.0 → tmail-1.2.3}/tmail/port.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/quoting.rb +118 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/require_arch.rb +58 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner.rb +49 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/scanner_r.rb +261 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/stringio.rb +280 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/utils.rb +337 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/version.rb +39 -0
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/test/abstract_unit.rb +13 -6
- data/vendor/rails/actionmailer/test/delivery_method_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_helper_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_render_test.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_service_test.rb +50 -10
- data/vendor/rails/actionmailer/test/quoting_test.rb +19 -32
- data/vendor/rails/actionmailer/test/test_helper_test.rb +14 -2
- data/vendor/rails/actionmailer/test/tmail_test.rb +1 -1
- data/vendor/rails/actionmailer/test/url_test.rb +2 -2
- data/vendor/rails/actionpack/CHANGELOG +216 -0
- data/vendor/rails/actionpack/MIT-LICENSE +1 -1
- data/vendor/rails/actionpack/README +1 -1
- data/vendor/rails/actionpack/Rakefile +13 -8
- data/vendor/rails/actionpack/lib/action_controller.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +2 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +8 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +8 -5
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +56 -73
- data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/base.rb +115 -136
- data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +3 -3
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +41 -652
- data/vendor/rails/actionpack/lib/action_controller/caching/actions.rb +144 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +138 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/pages.rb +154 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb +18 -0
- data/vendor/rails/actionpack/lib/action_controller/caching/sweeping.rb +97 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +28 -24
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +6 -4
- data/vendor/rails/actionpack/lib/action_controller/components.rb +7 -6
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +31 -19
- data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +51 -84
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +294 -419
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +1 -6
- data/vendor/rails/actionpack/lib/action_controller/headers.rb +31 -0
- data/vendor/rails/actionpack/lib/action_controller/helpers.rb +26 -9
- data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +3 -5
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +68 -15
- data/vendor/rails/actionpack/lib/action_controller/layout.rb +38 -54
- data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +7 -3
- data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +26 -7
- data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +123 -20
- data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +30 -17
- data/vendor/rails/actionpack/lib/action_controller/request.rb +79 -45
- data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +48 -40
- data/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +44 -13
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +24 -24
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +66 -23
- data/vendor/rails/actionpack/lib/action_controller/response.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +120 -1232
- data/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +203 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/optimisations.rb +120 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb +162 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route.rb +240 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +436 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/routing_ext.rb +46 -0
- data/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +283 -0
- data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +18 -14
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +22 -20
- data/vendor/rails/actionpack/lib/action_controller/session_management.rb +10 -3
- data/vendor/rails/actionpack/lib/action_controller/streaming.rb +45 -31
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +5 -5
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/test_case.rb +41 -11
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +46 -40
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +44 -37
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +73 -57
- data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view.rb +11 -3
- data/vendor/rails/actionpack/lib/action_view/base.rb +86 -381
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +84 -63
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +126 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +50 -18
- data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +5 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +3 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +1 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +107 -85
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +156 -78
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +57 -24
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +47 -21
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +4 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +11 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +69 -37
- data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +23 -17
- data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +86 -60
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +4 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +153 -125
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +90 -41
- data/vendor/rails/actionpack/lib/action_view/inline_template.rb +20 -0
- data/vendor/rails/actionpack/lib/action_view/partial_template.rb +70 -0
- data/vendor/rails/actionpack/lib/action_view/partials.rb +31 -73
- data/vendor/rails/actionpack/lib/action_view/template.rb +127 -0
- data/vendor/rails/actionpack/lib/action_view/template_error.rb +18 -10
- data/vendor/rails/actionpack/lib/action_view/template_finder.rb +177 -0
- data/vendor/rails/actionpack/lib/action_view/template_handler.rb +18 -1
- data/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +10 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/compilable.rb +128 -0
- data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +37 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +14 -1
- data/vendor/rails/actionpack/lib/action_view/test_case.rb +58 -0
- data/vendor/rails/actionpack/test/abstract_unit.rb +1 -1
- data/vendor/rails/actionpack/test/active_record_unit.rb +3 -6
- data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +2 -3
- data/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +158 -41
- data/vendor/rails/actionpack/test/adv_attr_test.rb +20 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +57 -6
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +19 -7
- data/vendor/rails/actionpack/test/controller/base_test.rb +88 -3
- data/vendor/rails/actionpack/test/controller/benchmark_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/caching_test.rb +282 -21
- data/vendor/rails/actionpack/test/controller/capture_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/cgi_test.rb +5 -4
- data/vendor/rails/actionpack/test/controller/components_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/content_type_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +13 -2
- data/vendor/rails/actionpack/test/controller/custom_handler_test.rb +14 -10
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +33 -51
- data/vendor/rails/actionpack/test/controller/fake_controllers.rb +17 -0
- data/vendor/rails/actionpack/test/controller/fake_models.rb +6 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +14 -8
- data/vendor/rails/actionpack/test/controller/filters_test.rb +44 -19
- data/vendor/rails/actionpack/test/controller/flash_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/header_test.rb +14 -0
- data/vendor/rails/actionpack/test/controller/helper_test.rb +19 -15
- data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +26 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +15 -6
- data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +1 -2
- data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +2 -3
- data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +8 -2
- data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/integration_test.rb +14 -17
- data/vendor/rails/actionpack/test/controller/integration_upload_test.rb +43 -0
- data/vendor/rails/actionpack/test/controller/layout_test.rb +26 -6
- data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +39 -7
- data/vendor/rails/actionpack/test/controller/mime_type_test.rb +34 -5
- data/vendor/rails/actionpack/test/controller/new_render_test.rb +150 -37
- data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +153 -77
- data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +38 -2
- data/vendor/rails/actionpack/test/controller/redirect_test.rb +32 -1
- data/vendor/rails/actionpack/test/controller/render_test.rb +78 -15
- data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +101 -5
- data/vendor/rails/actionpack/test/controller/request_test.rb +103 -11
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +22 -6
- data/vendor/rails/actionpack/test/controller/resources_test.rb +117 -31
- data/vendor/rails/actionpack/test/controller/routing_test.rb +286 -25
- data/vendor/rails/actionpack/test/controller/selector_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +14 -3
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +16 -4
- data/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +3 -4
- data/vendor/rails/actionpack/test/controller/session_fixation_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/session_management_test.rb +23 -1
- data/vendor/rails/actionpack/test/controller/test_test.rb +82 -10
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +69 -5
- data/vendor/rails/actionpack/test/controller/verification_test.rb +35 -18
- data/vendor/rails/actionpack/test/controller/view_paths_test.rb +15 -12
- data/vendor/rails/actionpack/test/controller/webservice_test.rb +48 -3
- data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/company.rb +1 -0
- data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +6 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/functional_caching/js_fragment_cached_with_partial.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/good_customers/_good_customer.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +3 -0
- data/vendor/rails/actionpack/test/fixtures/mascot.rb +3 -0
- data/vendor/rails/actionpack/test/fixtures/mascots.yml +4 -0
- data/vendor/rails/actionpack/test/fixtures/mascots/_mascot.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +10 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/controls.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/dragdrop.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/effects.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/prototype.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/javascripts/version.1.0.js +1 -0
- data/vendor/rails/actionpack/test/fixtures/public/stylesheets/version.1.0.css +1 -0
- data/vendor/rails/actionpack/test/fixtures/reply.rb +1 -0
- data/vendor/rails/actionpack/test/fixtures/shared.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb +5 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_counter.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_form.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_labelling_form.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_raise.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/greeting.js.rjs +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/topics/_topic.html.erb +1 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +25 -8
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +117 -30
- data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +81 -3
- data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +10 -22
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +515 -162
- data/vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb +9 -0
- data/vendor/rails/actionpack/test/template/erb_util_test.rb +10 -42
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +192 -66
- data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +514 -477
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +42 -8
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +10 -13
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +7 -3
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +41 -46
- data/vendor/rails/actionpack/test/template/record_tag_helper_test.rb +54 -0
- data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +5 -6
- data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +7 -13
- data/vendor/rails/actionpack/test/template/tag_helper_test.rb +3 -6
- data/vendor/rails/actionpack/test/template/template_finder_test.rb +73 -0
- data/vendor/rails/actionpack/test/template/template_object_test.rb +95 -0
- data/vendor/rails/actionpack/test/template/test_test.rb +56 -0
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +75 -43
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +20 -12
- data/vendor/rails/actionpack/test/testing_sandbox.rb +8 -4
- data/vendor/rails/activerecord/CHANGELOG +235 -2
- data/vendor/rails/activerecord/README +27 -22
- data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +7 -4
- data/vendor/rails/activerecord/Rakefile +27 -26
- data/vendor/rails/activerecord/lib/active_record.rb +16 -12
- data/vendor/rails/activerecord/lib/active_record/aggregations.rb +21 -12
- data/vendor/rails/activerecord/lib/active_record/association_preload.rb +285 -0
- data/vendor/rails/activerecord/lib/active_record/associations.rb +696 -453
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +167 -39
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +73 -13
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +5 -3
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +5 -6
- data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +26 -79
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +19 -72
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +90 -120
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +9 -7
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb +32 -0
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +73 -22
- data/vendor/rails/activerecord/lib/active_record/base.rb +581 -308
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +52 -27
- data/vendor/rails/activerecord/lib/active_record/callbacks.rb +9 -38
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +4 -3
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +9 -4
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +6 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +248 -56
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +159 -37
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +10 -13
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +99 -36
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +204 -57
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +43 -16
- data/vendor/rails/activerecord/lib/active_record/dirty.rb +165 -0
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +144 -181
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +15 -11
- data/vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/migration.rb +187 -81
- data/vendor/rails/activerecord/lib/active_record/named_scope.rb +168 -0
- data/vendor/rails/activerecord/lib/active_record/observer.rb +24 -8
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +38 -14
- data/vendor/rails/activerecord/lib/active_record/schema.rb +7 -14
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +4 -4
- data/vendor/rails/activerecord/lib/active_record/serialization.rb +5 -5
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +37 -28
- data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +52 -29
- data/vendor/rails/activerecord/lib/active_record/test_case.rb +47 -0
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +4 -4
- data/vendor/rails/activerecord/lib/active_record/transactions.rb +6 -8
- data/vendor/rails/activerecord/lib/active_record/validations.rb +201 -255
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/test/{fixtures → assets}/example.log +0 -0
- data/vendor/rails/activerecord/test/{fixtures → assets}/flowers.jpg +0 -0
- data/vendor/rails/activerecord/test/cases/aaa_create_tables_test.rb +24 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +95 -0
- data/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb +24 -0
- data/vendor/rails/activerecord/test/cases/adapter_test.rb +127 -0
- data/vendor/rails/activerecord/test/cases/adapter_test_sqlserver.rb +95 -0
- data/vendor/rails/activerecord/test/cases/aggregations_test.rb +128 -0
- data/vendor/rails/activerecord/test/cases/ar_schema_test.rb +33 -0
- data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +431 -0
- data/vendor/rails/activerecord/test/cases/associations/callbacks_test.rb +161 -0
- data/vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +123 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb +36 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +83 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_singularization_test.rb +145 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +643 -0
- data/vendor/rails/activerecord/test/cases/associations/extension_test.rb +62 -0
- data/vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +706 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +1034 -0
- data/vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb +200 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb +345 -0
- data/vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb +113 -0
- data/vendor/rails/activerecord/test/cases/associations/inner_join_association_test.rb +88 -0
- data/vendor/rails/activerecord/test/cases/associations/join_model_test.rb +714 -0
- data/vendor/rails/activerecord/test/cases/associations_test.rb +262 -0
- data/vendor/rails/activerecord/test/cases/attribute_methods_test.rb +238 -0
- data/vendor/rails/activerecord/test/cases/base_test.rb +2015 -0
- data/vendor/rails/activerecord/test/cases/binary_test.rb +34 -0
- data/vendor/rails/activerecord/test/cases/calculations_test.rb +323 -0
- data/vendor/rails/activerecord/test/cases/callbacks_test.rb +400 -0
- data/vendor/rails/activerecord/test/cases/class_inheritable_attributes_test.rb +32 -0
- data/vendor/rails/activerecord/test/cases/column_alias_test.rb +17 -0
- data/vendor/rails/activerecord/test/cases/column_definition_test.rb +36 -0
- data/vendor/rails/activerecord/test/cases/connection_test_firebird.rb +8 -0
- data/vendor/rails/activerecord/test/cases/connection_test_mysql.rb +30 -0
- data/vendor/rails/activerecord/test/cases/copy_table_test_sqlite.rb +69 -0
- data/vendor/rails/activerecord/test/cases/database_statements_test.rb +12 -0
- data/vendor/rails/activerecord/test/cases/datatype_test_postgresql.rb +203 -0
- data/vendor/rails/activerecord/test/cases/date_time_test.rb +37 -0
- data/vendor/rails/activerecord/test/cases/default_test_firebird.rb +16 -0
- data/vendor/rails/activerecord/test/cases/defaults_test.rb +69 -0
- data/vendor/rails/activerecord/test/cases/deprecated_finder_test.rb +30 -0
- data/vendor/rails/activerecord/test/cases/dirty_test.rb +257 -0
- data/vendor/rails/activerecord/test/cases/finder_respond_to_test.rb +76 -0
- data/vendor/rails/activerecord/test/cases/finder_test.rb +898 -0
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +626 -0
- data/vendor/rails/activerecord/test/cases/helper.rb +47 -0
- data/vendor/rails/activerecord/test/cases/inheritance_test.rb +262 -0
- data/vendor/rails/activerecord/test/cases/invalid_date_test.rb +24 -0
- data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +205 -0
- data/vendor/rails/activerecord/test/cases/lifecycle_test.rb +193 -0
- data/vendor/rails/activerecord/test/cases/locking_test.rb +309 -0
- data/vendor/rails/activerecord/test/cases/method_scoping_test.rb +462 -0
- data/vendor/rails/activerecord/test/cases/migration_test.rb +1444 -0
- data/vendor/rails/activerecord/test/cases/migration_test_firebird.rb +124 -0
- data/vendor/rails/activerecord/test/cases/mixin_test.rb +96 -0
- data/vendor/rails/activerecord/test/cases/modules_test.rb +39 -0
- data/vendor/rails/activerecord/test/cases/multiple_db_test.rb +60 -0
- data/vendor/rails/activerecord/test/cases/named_scope_test.rb +206 -0
- data/vendor/rails/activerecord/test/cases/pk_test.rb +101 -0
- data/vendor/rails/activerecord/test/cases/query_cache_test.rb +127 -0
- data/vendor/rails/activerecord/test/cases/readonly_test.rb +107 -0
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +176 -0
- data/vendor/rails/activerecord/test/cases/reserved_word_test_mysql.rb +176 -0
- data/vendor/rails/activerecord/test/cases/schema_authorization_test_postgresql.rb +75 -0
- data/vendor/rails/activerecord/test/cases/schema_dumper_test.rb +184 -0
- data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +102 -0
- data/vendor/rails/activerecord/test/cases/serialization_test.rb +47 -0
- data/vendor/rails/activerecord/test/cases/synonym_test_oracle.rb +17 -0
- data/vendor/rails/activerecord/test/cases/table_name_test_sqlserver.rb +23 -0
- data/vendor/rails/activerecord/test/cases/threaded_connections_test.rb +48 -0
- data/vendor/rails/activerecord/test/cases/transactions_test.rb +307 -0
- data/vendor/rails/activerecord/test/cases/unconnected_test.rb +32 -0
- data/vendor/rails/activerecord/test/cases/validations_test.rb +1541 -0
- data/vendor/rails/activerecord/test/cases/xml_serialization_test.rb +202 -0
- data/vendor/rails/activerecord/test/config.rb +5 -0
- data/vendor/rails/activerecord/test/connections/native_db2/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_firebird/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_frontbase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_openbase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_oracle/connection.rb +1 -1
- data/vendor/rails/activerecord/test/connections/native_postgresql/connection.rb +1 -3
- data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +2 -2
- data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +2 -2
- data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +3 -3
- data/vendor/rails/activerecord/test/connections/native_sybase/connection.rb +1 -1
- data/vendor/rails/activerecord/test/fixtures/author_addresses.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/authors.yml +2 -0
- data/vendor/rails/activerecord/test/fixtures/clubs.yml +6 -0
- data/vendor/rails/activerecord/test/fixtures/jobs.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/members.yml +4 -0
- data/vendor/rails/activerecord/test/fixtures/memberships.yml +20 -0
- data/vendor/rails/activerecord/test/fixtures/owners.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/people.yml +4 -1
- data/vendor/rails/activerecord/test/fixtures/pets.yml +14 -0
- data/vendor/rails/activerecord/test/fixtures/posts.yml +1 -0
- data/vendor/rails/activerecord/test/fixtures/price_estimates.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/readers.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/references.yml +17 -0
- data/vendor/rails/activerecord/test/fixtures/sponsors.yml +9 -0
- data/vendor/rails/activerecord/test/fixtures/subscribers.yml +7 -0
- data/vendor/rails/activerecord/test/fixtures/subscriptions.yml +12 -0
- data/vendor/rails/activerecord/test/fixtures/taggings.yml +4 -1
- data/vendor/rails/activerecord/test/fixtures/topics.yml +22 -2
- data/vendor/rails/activerecord/test/fixtures/warehouse-things.yml +3 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_decimal → migrations/decimal}/1_give_me_big_numbers.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/duplicate/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_duplicate → migrations/duplicate}/3_foo.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations → migrations/duplicate}/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507052938_chunky.rb +7 -0
- data/vendor/rails/activerecord/test/migrations/duplicate_names/20080507053028_chunky.rb +7 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_duplicate → migrations/interleaved/pass_1}/3_innocent_jointable.rb +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_2/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/{fixtures/migrations_with_missing_versions/4_innocent_jointable.rb → migrations/interleaved/pass_2/3_innocent_jointable.rb} +0 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/2_i_raise_on_down.rb +8 -0
- data/vendor/rails/activerecord/test/migrations/interleaved/pass_3/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/missing/1000_people_have_middle_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/missing/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/missing/3_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/missing/4_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/valid/1_people_have_last_names.rb +9 -0
- data/vendor/rails/activerecord/test/migrations/valid/2_we_need_reminders.rb +12 -0
- data/vendor/rails/activerecord/test/migrations/valid/3_innocent_jointable.rb +12 -0
- data/vendor/rails/activerecord/test/models/author.rb +137 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/auto_id.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/binary.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/book.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/categorization.rb +0 -0
- data/vendor/rails/activerecord/test/models/category.rb +30 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/citation.rb +0 -0
- data/vendor/rails/activerecord/test/models/club.rb +7 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/column_name.rb +0 -0
- data/vendor/rails/activerecord/test/models/comment.rb +25 -0
- data/vendor/rails/activerecord/test/models/company.rb +132 -0
- data/vendor/rails/activerecord/test/models/company_in_module.rb +61 -0
- data/vendor/rails/activerecord/test/models/computer.rb +3 -0
- data/vendor/rails/activerecord/test/models/contact.rb +16 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/course.rb +0 -0
- data/vendor/rails/activerecord/test/models/customer.rb +55 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/default.rb +0 -0
- data/vendor/rails/activerecord/test/models/developer.rb +79 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/edge.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/entrant.rb +0 -0
- data/vendor/rails/activerecord/test/models/guid.rb +2 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/item.rb +0 -0
- data/vendor/rails/activerecord/test/models/job.rb +5 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/joke.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/keyboard.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/legacy_thing.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/matey.rb +0 -0
- data/vendor/rails/activerecord/test/models/member.rb +9 -0
- data/vendor/rails/activerecord/test/models/membership.rb +9 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/minimalistic.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/mixed_case_monkey.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/movie.rb +0 -0
- data/vendor/rails/activerecord/test/models/order.rb +4 -0
- data/vendor/rails/activerecord/test/models/owner.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/parrot.rb +0 -0
- data/vendor/rails/activerecord/test/models/person.rb +10 -0
- data/vendor/rails/activerecord/test/models/pet.rb +4 -0
- data/vendor/rails/activerecord/test/models/pirate.rb +9 -0
- data/vendor/rails/activerecord/test/models/post.rb +85 -0
- data/vendor/rails/activerecord/test/models/price_estimate.rb +3 -0
- data/vendor/rails/activerecord/test/models/project.rb +29 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/reader.rb +0 -0
- data/vendor/rails/activerecord/test/models/reference.rb +4 -0
- data/vendor/rails/activerecord/test/models/reply.rb +39 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/ship.rb +0 -0
- data/vendor/rails/activerecord/test/models/sponsor.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/subject.rb +0 -0
- data/vendor/rails/activerecord/test/models/subscriber.rb +8 -0
- data/vendor/rails/activerecord/test/models/subscription.rb +4 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/tag.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/tagging.rb +0 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/task.rb +0 -0
- data/vendor/rails/activerecord/test/models/topic.rb +66 -0
- data/vendor/rails/activerecord/test/models/treasure.rb +6 -0
- data/vendor/rails/activerecord/test/{fixtures → models}/vertex.rb +0 -0
- data/vendor/rails/activerecord/test/models/warehouse_thing.rb +5 -0
- data/vendor/rails/activerecord/test/schema/mysql_specific_schema.rb +12 -0
- data/vendor/rails/activerecord/test/schema/postgresql_specific_schema.rb +103 -0
- data/vendor/rails/activerecord/test/schema/schema.rb +429 -0
- data/vendor/rails/activerecord/test/schema/schema2.rb +6 -0
- data/vendor/rails/activerecord/test/schema/sqlite_specific_schema.rb +25 -0
- data/vendor/rails/activerecord/test/schema/sqlserver_specific_schema.rb +5 -0
- data/vendor/rails/activeresource/CHANGELOG +33 -0
- data/vendor/rails/activeresource/Rakefile +9 -5
- data/vendor/rails/activeresource/lib/active_resource.rb +1 -1
- data/vendor/rails/activeresource/lib/active_resource/base.rb +309 -160
- data/vendor/rails/activeresource/lib/active_resource/connection.rb +41 -6
- data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +58 -44
- data/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +1 -1
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +82 -12
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +2 -2
- data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
- data/vendor/rails/activeresource/test/abstract_unit.rb +17 -1
- data/vendor/rails/activeresource/test/authorization_test.rb +45 -5
- data/vendor/rails/activeresource/test/base/custom_methods_test.rb +6 -3
- data/vendor/rails/activeresource/test/base/equality_test.rb +1 -1
- data/vendor/rails/activeresource/test/base/load_test.rb +36 -1
- data/vendor/rails/activeresource/test/base_errors_test.rb +1 -1
- data/vendor/rails/activeresource/test/base_test.rb +422 -28
- data/vendor/rails/activeresource/test/connection_test.rb +22 -2
- data/vendor/rails/activeresource/test/fixtures/customer.rb +3 -0
- data/vendor/rails/activeresource/test/format_test.rb +43 -2
- data/vendor/rails/activeresource/test/setter_trap.rb +1 -1
- data/vendor/rails/activesupport/CHANGELOG +214 -2
- data/vendor/rails/activesupport/lib/active_support.rb +13 -1
- data/vendor/rails/activesupport/lib/active_support/base64.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/basic_object.rb +23 -4
- data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +17 -3
- data/vendor/rails/activesupport/lib/active_support/cache.rb +147 -0
- data/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/cache/drb_store.rb +15 -0
- data/vendor/rails/activesupport/lib/active_support/cache/file_store.rb +70 -0
- data/vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb +100 -0
- data/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/callbacks.rb +275 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +2 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +89 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +3 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/base64/encoding.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +39 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +5 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +28 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +13 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +2 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +37 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +41 -19
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +19 -13
- data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +6 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +27 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +6 -8
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +4 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +10 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/daemonizing.rb +2 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_internal.rb +4 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +11 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/inclusion.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +56 -16
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/loading.rb +10 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +3 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/process.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/process/daemon.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +16 -6
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +5 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb +36 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +5 -10
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb +72 -48
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/filters.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb +58 -63
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/iterators.rb +4 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +12 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +54 -30
- data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +24 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +75 -23
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +33 -38
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/zones.rb +86 -0
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +418 -405
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +29 -10
- data/vendor/rails/activesupport/lib/active_support/duration.rb +4 -4
- data/vendor/rails/activesupport/lib/active_support/gzip.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +51 -49
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +267 -236
- data/vendor/rails/activesupport/lib/active_support/json.rb +17 -25
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +9 -6
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +3 -6
- data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +8 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +10 -14
- data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +11 -11
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +43 -0
- data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +13 -43
- data/vendor/rails/activesupport/lib/active_support/string_inquirer.rb +11 -0
- data/vendor/rails/activesupport/lib/active_support/test_case.rb +10 -2
- data/vendor/rails/activesupport/lib/active_support/testing/default.rb +3 -6
- data/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb +93 -0
- data/vendor/rails/activesupport/lib/active_support/time_with_zone.rb +304 -0
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +378 -163
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +12 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb +849 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/data_timezone.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/data_timezone_info.rb +228 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Casablanca.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +166 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Argentina/San_Juan.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Bogota.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Caracas.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Chicago.rb +283 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Denver.rb +204 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Godthab.rb +161 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Halifax.rb +274 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Juneau.rb +194 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Lima.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/New_York.rb +282 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Regina.rb +74 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Santiago.rb +205 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Dhaka.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Karachi.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Katmandu.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/London.rb +288 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/info_timezone.rb +52 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/linked_timezone.rb +51 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/linked_timezone_info.rb +44 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/offset_rationals.rb +98 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/ruby_core_support.rb +56 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/time_or_datetime.rb +292 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone.rb +508 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_definition.rb +56 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_info.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_offset_info.rb +94 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_period.rb +198 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.11/tzinfo/timezone_transition_info.rb +129 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +30 -10
- data/vendor/rails/railties/CHANGELOG +148 -0
- data/vendor/rails/railties/MIT-LICENSE +1 -1
- data/vendor/rails/railties/README +67 -14
- data/vendor/rails/railties/Rakefile +15 -21
- data/vendor/rails/railties/bin/about +2 -1
- data/vendor/rails/railties/bin/dbconsole +3 -0
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +22 -20
- data/vendor/rails/railties/builtin/rails_info/rails/info_controller.rb +1 -1
- data/vendor/rails/railties/configs/databases/frontbase.yml +2 -2
- data/vendor/rails/railties/configs/databases/mysql.yml +2 -2
- data/vendor/rails/railties/configs/databases/oracle.yml +3 -3
- data/vendor/rails/railties/configs/databases/postgresql.yml +2 -2
- data/vendor/rails/railties/configs/databases/sqlite2.yml +2 -2
- data/vendor/rails/railties/configs/databases/sqlite3.yml +2 -2
- data/vendor/rails/railties/configs/initializers/inflections.rb +1 -1
- data/vendor/rails/railties/configs/initializers/new_rails_defaults.rb +17 -0
- data/vendor/rails/railties/configs/routes.rb +8 -0
- data/vendor/rails/railties/dispatches/gateway.cgi +2 -2
- data/vendor/rails/railties/environments/boot.rb +6 -6
- data/vendor/rails/railties/environments/development.rb +0 -1
- data/vendor/rails/railties/environments/environment.rb +15 -7
- data/vendor/rails/railties/environments/production.rb +3 -0
- data/vendor/rails/railties/environments/test.rb +1 -1
- data/vendor/rails/railties/helpers/application.rb +5 -0
- data/vendor/rails/railties/html/images/rails.png +0 -0
- data/vendor/rails/railties/html/index.html +6 -9
- data/vendor/rails/railties/html/javascripts/controls.js +1 -1
- data/vendor/rails/railties/html/javascripts/dragdrop.js +1 -1
- data/vendor/rails/railties/html/javascripts/effects.js +1 -1
- data/vendor/rails/railties/lib/commands/about.rb +1 -0
- data/vendor/rails/railties/lib/commands/console.rb +5 -5
- data/vendor/rails/railties/lib/commands/dbconsole.rb +67 -0
- data/vendor/rails/railties/lib/commands/performance/profiler.rb +1 -1
- data/vendor/rails/railties/lib/commands/plugin.rb +30 -3
- data/vendor/rails/railties/lib/commands/server.rb +2 -2
- data/vendor/rails/railties/lib/commands/servers/lighttpd.rb +1 -1
- data/vendor/rails/railties/lib/commands/servers/mongrel.rb +9 -9
- data/vendor/rails/railties/lib/commands/servers/new_mongrel.rb +16 -0
- data/vendor/rails/railties/lib/commands/servers/webrick.rb +1 -1
- data/vendor/rails/railties/lib/console_app.rb +2 -2
- data/vendor/rails/railties/lib/console_sandbox.rb +2 -2
- data/vendor/rails/railties/lib/console_with_helpers.rb +1 -1
- data/vendor/rails/railties/lib/dispatcher.rb +1 -1
- data/vendor/rails/railties/lib/fcgi_handler.rb +32 -16
- data/vendor/rails/railties/lib/initializer.rb +303 -70
- data/vendor/rails/railties/lib/rails/gem_builder.rb +21 -0
- data/vendor/rails/railties/lib/rails/gem_dependency.rb +129 -0
- data/vendor/rails/railties/lib/rails/mongrel_server/commands.rb +342 -0
- data/vendor/rails/railties/lib/rails/mongrel_server/handler.rb +55 -0
- data/vendor/rails/railties/lib/rails/plugin.rb +51 -19
- data/vendor/rails/railties/lib/rails/plugin/loader.rb +4 -2
- data/vendor/rails/railties/lib/rails/plugin/locator.rb +24 -2
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/base.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/commands.rb +85 -54
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +9 -10
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/controller.rb +1 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +2 -6
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/mailer.rb +8 -6
- data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +4 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +4 -3
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -20
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +3 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +3 -4
- data/vendor/rails/railties/lib/rails_generator/lookup.rb +9 -4
- data/vendor/rails/railties/lib/rails_generator/options.rb +7 -0
- data/vendor/rails/railties/lib/rails_generator/scripts.rb +8 -5
- data/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +12 -8
- data/vendor/rails/railties/lib/source_annotation_extractor.rb +40 -0
- data/vendor/rails/railties/lib/tasks/databases.rake +81 -55
- data/vendor/rails/railties/lib/tasks/documentation.rake +4 -4
- data/vendor/rails/railties/lib/tasks/framework.rake +23 -27
- data/vendor/rails/railties/lib/tasks/gems.rake +64 -0
- data/vendor/rails/railties/lib/tasks/misc.rake +47 -0
- data/vendor/rails/railties/lib/tasks/rails.rb +1 -1
- data/vendor/rails/railties/lib/tasks/testing.rake +3 -3
- data/vendor/rails/railties/lib/test_help.rb +8 -0
- metadata +788 -1204
- data/app/controllers/admin/extension_controller.rb +0 -5
- data/app/controllers/admin/layout_controller.rb +0 -21
- data/app/controllers/admin/page_controller.rb +0 -115
- data/app/controllers/admin/snippet_controller.rb +0 -3
- data/app/controllers/admin/user_controller.rb +0 -44
- data/app/helpers/admin/extension_helper.rb +0 -2
- data/app/helpers/admin/layout_helper.rb +0 -2
- data/app/helpers/admin/page_helper.rb +0 -69
- data/app/helpers/admin/snippet_helper.rb +0 -2
- data/app/helpers/admin/user_helper.rb +0 -8
- data/app/models/radiant/extension_meta.rb +0 -5
- data/app/views/admin/extension/index.html.haml +0 -28
- data/app/views/admin/layout/edit.html.haml +0 -44
- data/app/views/admin/layout/index.html.haml +0 -25
- data/app/views/admin/layout/remove.html.haml +0 -16
- data/app/views/admin/page/_meta_row.html.haml +0 -6
- data/app/views/admin/page/_node.html.haml +0 -25
- data/app/views/admin/page/_part.html.haml +0 -17
- data/app/views/admin/page/_tag_reference.html.haml +0 -3
- data/app/views/admin/page/children.html.haml +0 -2
- data/app/views/admin/page/edit.html.haml +0 -115
- data/app/views/admin/page/filter_reference.rjs +0 -5
- data/app/views/admin/page/index.html.haml +0 -28
- data/app/views/admin/page/remove.html.haml +0 -20
- data/app/views/admin/page/tag_reference.rjs +0 -5
- data/app/views/admin/snippet/edit.html.haml +0 -36
- data/app/views/admin/snippet/index.html.haml +0 -20
- data/app/views/admin/snippet/remove.html.haml +0 -19
- data/app/views/admin/user/edit.html.haml +0 -80
- data/app/views/admin/user/index.html.haml +0 -23
- data/app/views/admin/user/preferences.html.haml +0 -28
- data/app/views/admin/user/remove.html.haml +0 -18
- data/lib/plugins/dependencies_fix/init.rb +0 -6
- data/lib/plugins/string_io/init.rb +0 -2
- data/spec/controllers/admin/abstract_model_controller_spec.rb +0 -265
- data/spec/controllers/admin/extension_controller_spec.rb +0 -21
- data/spec/controllers/admin/layout_controller_spec.rb +0 -42
- data/spec/controllers/admin/page_controller_spec.rb +0 -287
- data/spec/controllers/admin/snippet_controller_spec.rb +0 -27
- data/spec/controllers/admin/user_controller_spec.rb +0 -72
- data/spec/helpers/admin/extension_helper_spec.rb +0 -4
- data/spec/helpers/admin/layout_helper_spec.rb +0 -4
- data/spec/helpers/admin/page_helper_spec.rb +0 -45
- data/spec/helpers/admin/snippet_helper_spec.rb +0 -4
- data/spec/helpers/admin/user_helper_spec.rb +0 -11
- data/spec/scenarios/file_not_found_scenario.rb +0 -19
- data/spec/scenarios/home_page_scenario.rb +0 -64
- data/spec/scenarios/layouts_scenario.rb +0 -58
- data/spec/scenarios/markup_pages_scenario.rb +0 -13
- data/spec/scenarios/pages_scenario.rb +0 -56
- data/spec/scenarios/pages_with_layouts_scenario.rb +0 -10
- data/spec/scenarios/snippets_scenario.rb +0 -38
- data/spec/scenarios/users_and_pages_scenario.rb +0 -9
- data/spec/scenarios/users_scenario.rb +0 -43
- data/test/fixtures/extensions/01_basic/db/migrate/001_create_initial_schema.rb +0 -8
- data/test/fixtures/extensions/01_basic/db/migrate/002_modify_initial_schema.rb +0 -8
- data/test/fixtures/layouts.yml +0 -26
- data/test/fixtures/page_parts.yml +0 -119
- data/test/fixtures/pages.yml +0 -353
- data/test/fixtures/sample.txt +0 -1
- data/test/fixtures/snippets.yml +0 -26
- data/test/fixtures/users.yml +0 -35
- data/test/helpers/caching_test_helper.rb +0 -42
- data/test/helpers/difference_test_helper.rb +0 -13
- data/test/helpers/extension_fixture_test_helper.rb +0 -40
- data/test/helpers/extension_tag_test_helper.rb +0 -17
- data/test/helpers/layout_test_helper.rb +0 -35
- data/test/helpers/logging_test_helper.rb +0 -20
- data/test/helpers/login_test_helper.rb +0 -23
- data/test/helpers/page_part_test_helper.rb +0 -49
- data/test/helpers/routing_test_helper.rb +0 -19
- data/test/helpers/snippet_test_helper.rb +0 -32
- data/vendor/extensions/archive/spec/scenarios/archive_scenario.rb +0 -51
- data/vendor/plugins/rspec/CHANGES +0 -1079
- data/vendor/plugins/rspec/MIT-LICENSE +0 -20
- data/vendor/plugins/rspec/README +0 -71
- data/vendor/plugins/rspec/Rakefile +0 -279
- data/vendor/plugins/rspec/TODO +0 -2
- data/vendor/plugins/rspec/UPGRADE +0 -31
- data/vendor/plugins/rspec/bin/spec +0 -4
- data/vendor/plugins/rspec/bin/spec_translator +0 -8
- data/vendor/plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/examples/pure/before_and_after_example.rb +0 -40
- data/vendor/plugins/rspec/examples/pure/behave_as_example.rb +0 -45
- data/vendor/plugins/rspec/examples/pure/custom_expectation_matchers.rb +0 -54
- data/vendor/plugins/rspec/examples/pure/custom_formatter.rb +0 -12
- data/vendor/plugins/rspec/examples/pure/dynamic_spec.rb +0 -9
- data/vendor/plugins/rspec/examples/pure/file_accessor.rb +0 -19
- data/vendor/plugins/rspec/examples/pure/file_accessor_spec.rb +0 -38
- data/vendor/plugins/rspec/examples/pure/greeter_spec.rb +0 -31
- data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +0 -14
- data/vendor/plugins/rspec/examples/pure/io_processor.rb +0 -8
- data/vendor/plugins/rspec/examples/pure/io_processor_spec.rb +0 -21
- data/vendor/plugins/rspec/examples/pure/legacy_spec.rb +0 -11
- data/vendor/plugins/rspec/examples/pure/mocking_example.rb +0 -27
- data/vendor/plugins/rspec/examples/pure/multi_threaded_behaviour_runner.rb +0 -28
- data/vendor/plugins/rspec/examples/pure/nested_classes_example.rb +0 -36
- data/vendor/plugins/rspec/examples/pure/partial_mock_example.rb +0 -28
- data/vendor/plugins/rspec/examples/pure/pending_example.rb +0 -20
- data/vendor/plugins/rspec/examples/pure/predicate_example.rb +0 -27
- data/vendor/plugins/rspec/examples/pure/priority.txt +0 -1
- data/vendor/plugins/rspec/examples/pure/shared_example_group_example.rb +0 -81
- data/vendor/plugins/rspec/examples/pure/shared_stack_examples.rb +0 -38
- data/vendor/plugins/rspec/examples/pure/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/examples/pure/stack.rb +0 -36
- data/vendor/plugins/rspec/examples/pure/stack_spec.rb +0 -63
- data/vendor/plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +0 -67
- data/vendor/plugins/rspec/examples/pure/stubbing_example.rb +0 -69
- data/vendor/plugins/rspec/examples/stories/adder.rb +0 -13
- data/vendor/plugins/rspec/examples/stories/addition +0 -34
- data/vendor/plugins/rspec/examples/stories/addition.rb +0 -9
- data/vendor/plugins/rspec/examples/stories/calculator.rb +0 -65
- data/vendor/plugins/rspec/examples/stories/game-of-life/README.txt +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/everything.rb +0 -6
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/examples.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +0 -35
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +0 -66
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +0 -21
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +0 -42
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +0 -42
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +0 -17
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +0 -53
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +0 -52
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/helper.rb +0 -6
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +0 -26
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/steps.rb +0 -5
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.txt +0 -22
- data/vendor/plugins/rspec/examples/stories/game-of-life/life.rb +0 -3
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/game.rb +0 -23
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/grid.rb +0 -43
- data/vendor/plugins/rspec/examples/stories/helper.rb +0 -9
- data/vendor/plugins/rspec/examples/stories/steps/addition_steps.rb +0 -18
- data/vendor/plugins/rspec/failing_examples/README.txt +0 -7
- data/vendor/plugins/rspec/failing_examples/diffing_spec.rb +0 -36
- data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +0 -19
- data/vendor/plugins/rspec/failing_examples/failure_in_setup.rb +0 -10
- data/vendor/plugins/rspec/failing_examples/failure_in_teardown.rb +0 -10
- data/vendor/plugins/rspec/failing_examples/mocking_example.rb +0 -40
- data/vendor/plugins/rspec/failing_examples/mocking_with_flexmock.rb +0 -26
- data/vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb +0 -25
- data/vendor/plugins/rspec/failing_examples/mocking_with_rr.rb +0 -27
- data/vendor/plugins/rspec/failing_examples/partial_mock_example.rb +0 -20
- data/vendor/plugins/rspec/failing_examples/predicate_example.rb +0 -29
- data/vendor/plugins/rspec/failing_examples/raising_example.rb +0 -47
- data/vendor/plugins/rspec/failing_examples/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/failing_examples/syntax_error_example.rb +0 -7
- data/vendor/plugins/rspec/failing_examples/team_spec.rb +0 -44
- data/vendor/plugins/rspec/failing_examples/timeout_behaviour.rb +0 -7
- data/vendor/plugins/rspec/init.rb +0 -9
- data/vendor/plugins/rspec/lib/autotest/discover.rb +0 -3
- data/vendor/plugins/rspec/lib/autotest/rspec.rb +0 -72
- data/vendor/plugins/rspec/lib/spec.rb +0 -30
- data/vendor/plugins/rspec/lib/spec/example.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/example/configuration.rb +0 -144
- data/vendor/plugins/rspec/lib/spec/example/errors.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/example/example_group.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/example/example_group_factory.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb +0 -433
- data/vendor/plugins/rspec/lib/spec/example/example_matcher.rb +0 -42
- data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +0 -110
- data/vendor/plugins/rspec/lib/spec/example/module_reopening_fix.rb +0 -21
- data/vendor/plugins/rspec/lib/spec/example/pending.rb +0 -18
- data/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/expectations.rb +0 -56
- data/vendor/plugins/rspec/lib/spec/expectations/differs/default.rb +0 -66
- data/vendor/plugins/rspec/lib/spec/expectations/errors.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/expectations/extensions.rb +0 -2
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb +0 -71
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/string_and_symbol.rb +0 -17
- data/vendor/plugins/rspec/lib/spec/expectations/handler.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/extensions.rb +0 -4
- data/vendor/plugins/rspec/lib/spec/extensions/class.rb +0 -24
- data/vendor/plugins/rspec/lib/spec/extensions/main.rb +0 -102
- data/vendor/plugins/rspec/lib/spec/extensions/metaclass.rb +0 -7
- data/vendor/plugins/rspec/lib/spec/extensions/object.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test.rb +0 -12
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +0 -61
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +0 -6
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +0 -34
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +0 -61
- data/vendor/plugins/rspec/lib/spec/matchers.rb +0 -156
- data/vendor/plugins/rspec/lib/spec/matchers/be.rb +0 -224
- data/vendor/plugins/rspec/lib/spec/matchers/be_close.rb +0 -37
- data/vendor/plugins/rspec/lib/spec/matchers/change.rb +0 -144
- data/vendor/plugins/rspec/lib/spec/matchers/eql.rb +0 -43
- data/vendor/plugins/rspec/lib/spec/matchers/equal.rb +0 -43
- data/vendor/plugins/rspec/lib/spec/matchers/exist.rb +0 -17
- data/vendor/plugins/rspec/lib/spec/matchers/has.rb +0 -34
- data/vendor/plugins/rspec/lib/spec/matchers/have.rb +0 -145
- data/vendor/plugins/rspec/lib/spec/matchers/include.rb +0 -70
- data/vendor/plugins/rspec/lib/spec/matchers/match.rb +0 -41
- data/vendor/plugins/rspec/lib/spec/matchers/operator_matcher.rb +0 -73
- data/vendor/plugins/rspec/lib/spec/matchers/raise_error.rb +0 -132
- data/vendor/plugins/rspec/lib/spec/matchers/respond_to.rb +0 -45
- data/vendor/plugins/rspec/lib/spec/matchers/satisfy.rb +0 -47
- data/vendor/plugins/rspec/lib/spec/matchers/simple_matcher.rb +0 -29
- data/vendor/plugins/rspec/lib/spec/matchers/throw_symbol.rb +0 -74
- data/vendor/plugins/rspec/lib/spec/mocks.rb +0 -211
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +0 -31
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb.orig +0 -27
- data/vendor/plugins/rspec/lib/spec/mocks/argument_expectation.rb +0 -209
- data/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb +0 -84
- data/vendor/plugins/rspec/lib/spec/mocks/errors.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/mocks/extensions/object.rb +0 -3
- data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +0 -269
- data/vendor/plugins/rspec/lib/spec/mocks/methods.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/mocks/mock.rb +0 -50
- data/vendor/plugins/rspec/lib/spec/mocks/order_group.rb +0 -29
- data/vendor/plugins/rspec/lib/spec/mocks/proxy.rb +0 -166
- data/vendor/plugins/rspec/lib/spec/mocks/space.rb +0 -28
- data/vendor/plugins/rspec/lib/spec/mocks/spec_methods.rb +0 -38
- data/vendor/plugins/rspec/lib/spec/rake/spectask.rb +0 -235
- data/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/runner.rb +0 -202
- data/vendor/plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +0 -57
- data/vendor/plugins/rspec/lib/spec/runner/class_and_arguments_parser.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/runner/command_line.rb +0 -28
- data/vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb +0 -20
- data/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb +0 -59
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +0 -77
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +0 -130
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +0 -33
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +0 -20
- data/vendor/plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +0 -333
- data/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +0 -47
- data/vendor/plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +0 -30
- data/vendor/plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +0 -52
- data/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +0 -128
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +0 -131
- data/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +0 -16
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner.rb +0 -72
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner_unsupported.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/runner/option_parser.rb +0 -205
- data/vendor/plugins/rspec/lib/spec/runner/options.rb +0 -288
- data/vendor/plugins/rspec/lib/spec/runner/reporter.rb +0 -147
- data/vendor/plugins/rspec/lib/spec/runner/spec_parser.rb +0 -71
- data/vendor/plugins/rspec/lib/spec/story.rb +0 -10
- data/vendor/plugins/rspec/lib/spec/story/extensions.rb +0 -3
- data/vendor/plugins/rspec/lib/spec/story/extensions/main.rb +0 -86
- data/vendor/plugins/rspec/lib/spec/story/extensions/regexp.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/story/extensions/string.rb +0 -9
- data/vendor/plugins/rspec/lib/spec/story/given_scenario.rb +0 -14
- data/vendor/plugins/rspec/lib/spec/story/runner.rb +0 -56
- data/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +0 -48
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_collector.rb +0 -18
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb +0 -48
- data/vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb +0 -123
- data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +0 -227
- data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +0 -70
- data/vendor/plugins/rspec/lib/spec/story/scenario.rb +0 -14
- data/vendor/plugins/rspec/lib/spec/story/step.rb +0 -58
- data/vendor/plugins/rspec/lib/spec/story/step_group.rb +0 -89
- data/vendor/plugins/rspec/lib/spec/story/step_mother.rb +0 -37
- data/vendor/plugins/rspec/lib/spec/story/story.rb +0 -39
- data/vendor/plugins/rspec/lib/spec/story/world.rb +0 -124
- data/vendor/plugins/rspec/lib/spec/translator.rb +0 -114
- data/vendor/plugins/rspec/lib/spec/version.rb +0 -22
- data/vendor/plugins/rspec/plugins/mock_frameworks/flexmock.rb +0 -23
- data/vendor/plugins/rspec/plugins/mock_frameworks/mocha.rb +0 -19
- data/vendor/plugins/rspec/plugins/mock_frameworks/rr.rb +0 -21
- data/vendor/plugins/rspec/plugins/mock_frameworks/rspec.rb +0 -18
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit.rb +0 -4
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb +0 -50
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +0 -54
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +0 -111
- data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +0 -314
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +0 -15
- data/vendor/plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +0 -51
- data/vendor/plugins/rspec/pre_commit/spec/spec_helper.rb +0 -3
- data/vendor/plugins/rspec/pre_commit/spec/spec_suite.rb +0 -11
- data/vendor/plugins/rspec/rake_tasks/examples.rake +0 -7
- data/vendor/plugins/rspec/rake_tasks/examples_with_rcov.rake +0 -9
- data/vendor/plugins/rspec/rake_tasks/failing_examples_with_html.rake +0 -9
- data/vendor/plugins/rspec/rake_tasks/verify_rcov.rake +0 -7
- data/vendor/plugins/rspec/spec/README.jruby +0 -15
- data/vendor/plugins/rspec/spec/autotest/discover_spec.rb +0 -19
- data/vendor/plugins/rspec/spec/autotest/rspec_spec.rb +0 -197
- data/vendor/plugins/rspec/spec/autotest_helper.rb +0 -6
- data/vendor/plugins/rspec/spec/rspec_suite.rb +0 -7
- data/vendor/plugins/rspec/spec/ruby_forker.rb +0 -13
- data/vendor/plugins/rspec/spec/spec.opts +0 -6
- data/vendor/plugins/rspec/spec/spec/example/configuration_spec.rb +0 -282
- data/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb +0 -48
- data/vendor/plugins/rspec/spec/spec/example/example_group_factory_spec.rb +0 -135
- data/vendor/plugins/rspec/spec/spec/example/example_group_methods_spec.rb +0 -523
- data/vendor/plugins/rspec/spec/spec/example/example_group_spec.rb +0 -711
- data/vendor/plugins/rspec/spec/spec/example/example_matcher_spec.rb +0 -96
- data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +0 -115
- data/vendor/plugins/rspec/spec/spec/example/example_runner_spec.rb +0 -194
- data/vendor/plugins/rspec/spec/spec/example/example_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb +0 -71
- data/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +0 -21
- data/vendor/plugins/rspec/spec/spec/example/shared_example_group_spec.rb +0 -265
- data/vendor/plugins/rspec/spec/spec/example/subclassing_example_group_spec.rb +0 -25
- data/vendor/plugins/rspec/spec/spec/expectations/differs/default_spec.rb +0 -127
- data/vendor/plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +0 -107
- data/vendor/plugins/rspec/spec/spec/expectations/fail_with_spec.rb +0 -71
- data/vendor/plugins/rspec/spec/spec/extensions/main_spec.rb +0 -76
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +0 -10
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +0 -38
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +0 -9
- data/vendor/plugins/rspec/spec/spec/matchers/be_close_spec.rb +0 -39
- data/vendor/plugins/rspec/spec/spec/matchers/be_spec.rb +0 -248
- data/vendor/plugins/rspec/spec/spec/matchers/change_spec.rb +0 -319
- data/vendor/plugins/rspec/spec/spec/matchers/description_generation_spec.rb +0 -153
- data/vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb +0 -28
- data/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb +0 -28
- data/vendor/plugins/rspec/spec/spec/matchers/exist_spec.rb +0 -57
- data/vendor/plugins/rspec/spec/spec/matchers/handler_spec.rb +0 -129
- data/vendor/plugins/rspec/spec/spec/matchers/has_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/matchers/have_spec.rb +0 -291
- data/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +0 -37
- data/vendor/plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +0 -78
- data/vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb +0 -24
- data/vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +0 -158
- data/vendor/plugins/rspec/spec/spec/matchers/raise_error_spec.rb +0 -315
- data/vendor/plugins/rspec/spec/spec/matchers/respond_to_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb +0 -36
- data/vendor/plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +0 -29
- data/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb +0 -23
- data/vendor/plugins/rspec/spec/spec/mocks/at_least_spec.rb +0 -97
- data/vendor/plugins/rspec/spec/spec/mocks/at_most_spec.rb +0 -93
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10260_spec.rb +0 -8
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb +0 -24
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +0 -33
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +0 -30
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +0 -19
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb +0 -22
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8165_spec.rb +0 -31
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +0 -26
- data/vendor/plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +0 -123
- data/vendor/plugins/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +0 -32
- data/vendor/plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +0 -84
- data/vendor/plugins/rspec/spec/spec/mocks/mock_space_spec.rb +0 -54
- data/vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb +0 -481
- data/vendor/plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +0 -113
- data/vendor/plugins/rspec/spec/spec/mocks/null_object_mock_spec.rb +0 -40
- data/vendor/plugins/rspec/spec/spec/mocks/once_counts_spec.rb +0 -53
- data/vendor/plugins/rspec/spec/spec/mocks/options_hash_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +0 -106
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +0 -66
- data/vendor/plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +0 -160
- data/vendor/plugins/rspec/spec/spec/mocks/precise_counts_spec.rb +0 -52
- data/vendor/plugins/rspec/spec/spec/mocks/record_messages_spec.rb +0 -26
- data/vendor/plugins/rspec/spec/spec/mocks/stub_spec.rb +0 -181
- data/vendor/plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +0 -67
- data/vendor/plugins/rspec/spec/spec/package/bin_spec_spec.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +0 -23
- data/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb +0 -147
- data/vendor/plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +0 -92
- data/vendor/plugins/rspec/spec/spec/runner/examples.txt +0 -2
- data/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb +0 -37
- data/vendor/plugins/rspec/spec/spec/runner/failed.txt +0 -3
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +0 -33
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +0 -365
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +0 -387
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +0 -381
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +0 -66
- data/vendor/plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +0 -65
- data/vendor/plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +0 -137
- data/vendor/plugins/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +0 -18
- data/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +0 -103
- data/vendor/plugins/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +0 -129
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +0 -61
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +0 -335
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +0 -365
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +0 -371
- data/vendor/plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +0 -78
- data/vendor/plugins/rspec/spec/spec/runner/heckler_spec.rb +0 -13
- data/vendor/plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +0 -45
- data/vendor/plugins/rspec/spec/spec/runner/option_parser_spec.rb +0 -384
- data/vendor/plugins/rspec/spec/spec/runner/options_spec.rb +0 -386
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture.rb +0 -7
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +0 -8
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_spec.rb +0 -16
- data/vendor/plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +0 -56
- data/vendor/plugins/rspec/spec/spec/runner/reporter_spec.rb +0 -192
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_bar.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_foo.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_spec.rb +0 -1
- data/vendor/plugins/rspec/spec/spec/runner/spec.opts +0 -2
- data/vendor/plugins/rspec/spec/spec/runner/spec_drb.opts +0 -1
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser/spec_parser_fixture.rb +0 -70
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser_spec.rb +0 -79
- data/vendor/plugins/rspec/spec/spec/runner/spec_spaced.opts +0 -2
- data/vendor/plugins/rspec/spec/spec/runner_spec.rb +0 -11
- data/vendor/plugins/rspec/spec/spec/spec_classes.rb +0 -133
- data/vendor/plugins/rspec/spec/spec/story/builders.rb +0 -46
- data/vendor/plugins/rspec/spec/spec/story/extensions/main_spec.rb +0 -161
- data/vendor/plugins/rspec/spec/spec/story/extensions_spec.rb +0 -14
- data/vendor/plugins/rspec/spec/spec/story/given_scenario_spec.rb +0 -27
- data/vendor/plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +0 -92
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +0 -27
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +0 -191
- data/vendor/plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +0 -133
- data/vendor/plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +0 -384
- data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +0 -294
- data/vendor/plugins/rspec/spec/spec/story/runner_spec.rb +0 -106
- data/vendor/plugins/rspec/spec/spec/story/scenario_spec.rb +0 -20
- data/vendor/plugins/rspec/spec/spec/story/step_group_spec.rb +0 -157
- data/vendor/plugins/rspec/spec/spec/story/step_mother_spec.rb +0 -72
- data/vendor/plugins/rspec/spec/spec/story/step_spec.rb +0 -200
- data/vendor/plugins/rspec/spec/spec/story/story_helper.rb +0 -2
- data/vendor/plugins/rspec/spec/spec/story/story_spec.rb +0 -86
- data/vendor/plugins/rspec/spec/spec/story/world_spec.rb +0 -423
- data/vendor/plugins/rspec/spec/spec/translator_spec.rb +0 -265
- data/vendor/plugins/rspec/spec/spec_helper.rb +0 -103
- data/vendor/plugins/rspec/stories/all.rb +0 -5
- data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +0 -45
- data/vendor/plugins/rspec/stories/example_groups/example_group_with_should_methods +0 -17
- data/vendor/plugins/rspec/stories/example_groups/nested_groups +0 -17
- data/vendor/plugins/rspec/stories/example_groups/output +0 -25
- data/vendor/plugins/rspec/stories/example_groups/stories.rb +0 -7
- data/vendor/plugins/rspec/stories/helper.rb +0 -6
- data/vendor/plugins/rspec/stories/interop/examples_and_tests_together +0 -30
- data/vendor/plugins/rspec/stories/interop/stories.rb +0 -7
- data/vendor/plugins/rspec/stories/interop/test_case_with_should_methods +0 -17
- data/vendor/plugins/rspec/stories/pending_stories/README +0 -3
- data/vendor/plugins/rspec/stories/resources/helpers/cmdline.rb +0 -9
- data/vendor/plugins/rspec/stories/resources/helpers/story_helper.rb +0 -16
- data/vendor/plugins/rspec/stories/resources/matchers/smart_match.rb +0 -37
- data/vendor/plugins/rspec/stories/resources/spec/example_group_with_should_methods.rb +0 -12
- data/vendor/plugins/rspec/stories/resources/spec/simple_spec.rb +0 -8
- data/vendor/plugins/rspec/stories/resources/steps/running_rspec.rb +0 -50
- data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +0 -15
- data/vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb +0 -57
- data/vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +0 -30
- data/vendor/plugins/rspec/story_server/prototype/javascripts/builder.js +0 -136
- data/vendor/plugins/rspec/story_server/prototype/javascripts/controls.js +0 -972
- data/vendor/plugins/rspec/story_server/prototype/javascripts/dragdrop.js +0 -976
- data/vendor/plugins/rspec/story_server/prototype/javascripts/effects.js +0 -1117
- data/vendor/plugins/rspec/story_server/prototype/javascripts/prototype.js +0 -4140
- data/vendor/plugins/rspec/story_server/prototype/javascripts/rspec.js +0 -149
- data/vendor/plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +0 -58
- data/vendor/plugins/rspec/story_server/prototype/javascripts/slider.js +0 -276
- data/vendor/plugins/rspec/story_server/prototype/javascripts/sound.js +0 -55
- data/vendor/plugins/rspec/story_server/prototype/javascripts/unittest.js +0 -568
- data/vendor/plugins/rspec/story_server/prototype/lib/server.rb +0 -24
- data/vendor/plugins/rspec/story_server/prototype/stories.html +0 -176
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/rspec.css +0 -136
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/test.css +0 -90
- data/vendor/plugins/rspec_on_rails/MIT-LICENSE +0 -31
- data/vendor/plugins/rspec_on_rails/README +0 -3
- data/vendor/plugins/rspec_on_rails/Rakefile +0 -9
- data/vendor/plugins/rspec_on_rails/generators/rspec/CHANGES +0 -1
- data/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb +0 -35
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/all_stories.rb +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/previous_failures.txt +0 -0
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +0 -2
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +0 -102
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts +0 -4
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb +0 -39
- data/vendor/plugins/rspec_on_rails/generators/rspec/templates/stories_helper.rb +0 -3
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/USAGE +0 -33
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/rspec_controller_generator.rb +0 -49
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb +0 -25
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +0 -12
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/USAGE +0 -18
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb +0 -30
- data/vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +0 -167
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +0 -313
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +0 -25
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +0 -22
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +0 -26
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +0 -61
- data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +0 -22
- data/vendor/plugins/rspec_on_rails/init.rb +0 -9
- data/vendor/plugins/rspec_on_rails/lib/autotest/discover.rb +0 -1
- data/vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +0 -81
- data/vendor/plugins/rspec_on_rails/lib/spec/rails.rb +0 -51
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb +0 -46
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb +0 -43
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +0 -269
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb +0 -59
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +0 -130
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/model_example_group.rb +0 -14
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +0 -98
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +0 -90
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +0 -178
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb +0 -12
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +0 -14
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/rescue.rb +0 -21
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb +0 -11
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb +0 -27
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb +0 -30
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/object.rb +0 -5
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb +0 -66
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +0 -21
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb +0 -29
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +0 -130
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +0 -55
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb +0 -113
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +0 -70
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +0 -71
- data/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +0 -23
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +0 -36
- data/vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb +0 -8
- data/vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb +0 -60
- data/vendor/plugins/rspec_on_rails/spec/rails/example/configuration_spec.rb +0 -83
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +0 -43
- data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +0 -195
- data/vendor/plugins/rspec_on_rails/spec/rails/example/example_group_factory_spec.rb +0 -112
- data/vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +0 -133
- data/vendor/plugins/rspec_on_rails/spec/rails/example/model_spec_spec.rb +0 -18
- data/vendor/plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +0 -16
- data/vendor/plugins/rspec_on_rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +0 -33
- data/vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +0 -264
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +0 -54
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +0 -48
- data/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +0 -14
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +0 -783
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +0 -37
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb +0 -13
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +0 -62
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +0 -209
- data/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +0 -169
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/ar_classes.rb +0 -10
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +0 -55
- data/vendor/plugins/rspec_on_rails/spec/rails/mocks/stub_model_spec.rb +0 -54
- data/vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb +0 -7
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb +0 -89
- data/vendor/plugins/rspec_on_rails/spec/rails/spec_spec.rb +0 -11
- data/vendor/plugins/rspec_on_rails/spec/rails_suite.rb +0 -7
- data/vendor/plugins/rspec_on_rails/spec/spec_helper.rb +0 -46
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/action_view_base_spec_controller.rb +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +0 -68
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +0 -59
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +0 -26
- data/vendor/plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +0 -58
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +0 -10
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/more_explicit_helper.rb +0 -5
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/plugin_application_helper.rb +0 -6
- data/vendor/plugins/rspec_on_rails/spec_resources/helpers/view_spec_helper.rb +0 -13
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/_partial.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_template.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/_a_partial.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.js.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_div.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_page_element.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/insert_html.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_effect.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/no_tags.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_used_twice.rhtml +0 -0
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_local_variable.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_spacer.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/entry_form.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/explicit_helper.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/foo/show.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/implicit_helper.rhtml +0 -2
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/multiple_helpers.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial.rhtml +0 -5
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +0 -3
- data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +0 -1
- data/vendor/plugins/rspec_on_rails/stories/all.rb +0 -10
- data/vendor/plugins/rspec_on_rails/stories/helper.rb +0 -5
- data/vendor/plugins/rspec_on_rails/stories/steps/people.rb +0 -8
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback +0 -15
- data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb +0 -25
- data/vendor/plugins/rspec_on_rails/tasks/rspec.rake +0 -137
- data/vendor/plugins/scenarios/README +0 -262
- data/vendor/plugins/scenarios/Rakefile +0 -66
- data/vendor/plugins/scenarios/TODO +0 -1
- data/vendor/plugins/scenarios/lib/scenarios.rb +0 -34
- data/vendor/plugins/scenarios/lib/scenarios/base.rb +0 -73
- data/vendor/plugins/scenarios/lib/scenarios/builtin/blank_scenario.rb +0 -18
- data/vendor/plugins/scenarios/lib/scenarios/configuration.rb +0 -55
- data/vendor/plugins/scenarios/lib/scenarios/extensions.rb +0 -5
- data/vendor/plugins/scenarios/lib/scenarios/extensions/active_record.rb +0 -14
- data/vendor/plugins/scenarios/lib/scenarios/extensions/delegating_attributes.rb +0 -40
- data/vendor/plugins/scenarios/lib/scenarios/extensions/object.rb +0 -5
- data/vendor/plugins/scenarios/lib/scenarios/extensions/string.rb +0 -22
- data/vendor/plugins/scenarios/lib/scenarios/extensions/symbol.rb +0 -14
- data/vendor/plugins/scenarios/lib/scenarios/extensions/test_case.rb +0 -76
- data/vendor/plugins/scenarios/lib/scenarios/loading.rb +0 -51
- data/vendor/plugins/scenarios/lib/scenarios/table_blasting.rb +0 -20
- data/vendor/plugins/scenarios/lib/scenarios/table_methods.rb +0 -205
- data/vendor/plugins/scenarios/spec/scenarios/complex_composite_scenario.rb +0 -9
- data/vendor/plugins/scenarios/spec/scenarios/composite_scenario.rb +0 -9
- data/vendor/plugins/scenarios/spec/scenarios/empty_scenario.rb +0 -4
- data/vendor/plugins/scenarios/spec/scenarios/people_scenario.rb +0 -26
- data/vendor/plugins/scenarios/spec/scenarios/places_scenario.rb +0 -22
- data/vendor/plugins/scenarios/spec/scenarios/things_scenario.rb +0 -22
- data/vendor/plugins/scenarios/spec/scenarios_spec.rb +0 -189
- data/vendor/plugins/scenarios/spec/spec_helper.rb +0 -6
- data/vendor/plugins/scenarios/tasks/scenario.rake +0 -21
- data/vendor/plugins/scenarios/test/scenarios_test.rb +0 -39
- data/vendor/plugins/scenarios/test/test_helper.rb +0 -5
- data/vendor/plugins/scenarios/testing/application.rb +0 -2
- data/vendor/plugins/scenarios/testing/database.yml +0 -9
- data/vendor/plugins/scenarios/testing/environment.rb +0 -68
- data/vendor/plugins/scenarios/testing/library.rb +0 -128
- data/vendor/plugins/scenarios/testing/models.rb +0 -14
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3014.patch +0 -52
- data/vendor/plugins/scenarios/testing/rspec_on_rails_3119.patch +0 -53
- data/vendor/plugins/scenarios/testing/schema.rb +0 -31
- data/vendor/rails/Rakefile +0 -21
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb +0 -4
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile +0 -19
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb +0 -245
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb +0 -47
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb +0 -52
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb +0 -39
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb +0 -71
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb +0 -67
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb +0 -481
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/facade.rb +0 -552
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb +0 -931
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/info.rb +0 -35
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb +0 -540
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/loader.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb +0 -462
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb +0 -435
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mbox.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb +0 -282
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb +0 -137
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb +0 -1475
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y +0 -381
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb +0 -142
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb +0 -43
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb +0 -263
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb +0 -279
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/tmail.rb +0 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb +0 -281
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb +0 -38
- data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/path.with.dots/multipart_with_template_path_with_dots.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string +0 -0
- data/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string +0 -1
- data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -0
- data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -0
- data/vendor/rails/actionpack/lib/action_controller/routing_optimisation.rb +0 -119
- data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +0 -69
- data/vendor/rails/actionpack/test/action_view_test.rb +0 -44
- data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +0 -47
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +0 -193
- data/vendor/rails/activemodel/CHANGES +0 -12
- data/vendor/rails/activemodel/README +0 -21
- data/vendor/rails/activemodel/Rakefile +0 -4
- data/vendor/rails/activemodel/lib/active_model.rb +0 -17
- data/vendor/rails/activemodel/lib/active_model/base.rb +0 -4
- data/vendor/rails/activemodel/lib/active_model/callbacks.rb +0 -5
- data/vendor/rails/activemodel/lib/active_model/observing.rb +0 -100
- data/vendor/rails/activemodel/lib/active_model/validations.rb +0 -4
- data/vendor/rails/activemodel/spec/observing_spec.rb +0 -120
- data/vendor/rails/activemodel/spec/spec_helper.rb +0 -17
- data/vendor/rails/activerecord/MIT-LICENSE +0 -20
- data/vendor/rails/activerecord/lib/active_record/vendor/db2.rb +0 -362
- data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +0 -72
- data/vendor/rails/activerecord/test/abstract_unit.rb +0 -84
- data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +0 -43
- data/vendor/rails/activerecord/test/adapter_test.rb +0 -105
- data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +0 -95
- data/vendor/rails/activerecord/test/aggregations_test.rb +0 -128
- data/vendor/rails/activerecord/test/all.sh +0 -8
- data/vendor/rails/activerecord/test/ar_schema_test.rb +0 -33
- data/vendor/rails/activerecord/test/association_inheritance_reload.rb +0 -14
- data/vendor/rails/activerecord/test/associations/callbacks_test.rb +0 -147
- data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +0 -110
- data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +0 -145
- data/vendor/rails/activerecord/test/associations/eager_test.rb +0 -442
- data/vendor/rails/activerecord/test/associations/extension_test.rb +0 -47
- data/vendor/rails/activerecord/test/associations/inner_join_association_test.rb +0 -88
- data/vendor/rails/activerecord/test/associations/join_model_test.rb +0 -559
- data/vendor/rails/activerecord/test/associations_test.rb +0 -2147
- data/vendor/rails/activerecord/test/attribute_methods_test.rb +0 -146
- data/vendor/rails/activerecord/test/base_test.rb +0 -1745
- data/vendor/rails/activerecord/test/binary_test.rb +0 -32
- data/vendor/rails/activerecord/test/calculations_test.rb +0 -251
- data/vendor/rails/activerecord/test/callbacks_test.rb +0 -400
- data/vendor/rails/activerecord/test/class_inheritable_attributes_test.rb +0 -32
- data/vendor/rails/activerecord/test/column_alias_test.rb +0 -17
- data/vendor/rails/activerecord/test/connection_test_firebird.rb +0 -8
- data/vendor/rails/activerecord/test/connection_test_mysql.rb +0 -30
- data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +0 -69
- data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +0 -203
- data/vendor/rails/activerecord/test/date_time_test.rb +0 -37
- data/vendor/rails/activerecord/test/default_test_firebird.rb +0 -16
- data/vendor/rails/activerecord/test/defaults_test.rb +0 -67
- data/vendor/rails/activerecord/test/deprecated_finder_test.rb +0 -30
- data/vendor/rails/activerecord/test/finder_test.rb +0 -650
- data/vendor/rails/activerecord/test/fixtures/author.rb +0 -109
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_numeric_first_char +0 -1
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/attr_with_spaces +0 -1
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/blank_line +0 -3
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/duplicate_attributes +0 -3
- data/vendor/rails/activerecord/test/fixtures/bad_fixtures/missing_value +0 -1
- data/vendor/rails/activerecord/test/fixtures/category.rb +0 -26
- data/vendor/rails/activerecord/test/fixtures/comment.rb +0 -23
- data/vendor/rails/activerecord/test/fixtures/company.rb +0 -114
- data/vendor/rails/activerecord/test/fixtures/company_in_module.rb +0 -59
- data/vendor/rails/activerecord/test/fixtures/computer.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/contact.rb +0 -16
- data/vendor/rails/activerecord/test/fixtures/customer.rb +0 -55
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +0 -235
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/db22.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +0 -65
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +0 -310
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird2.sql +0 -6
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +0 -273
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.drop.sql +0 -1
- data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase2.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +0 -318
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.sql +0 -7
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +0 -67
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +0 -330
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle2.sql +0 -6
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +0 -44
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +0 -292
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +0 -354
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema2.rb +0 -11
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +0 -33
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +0 -219
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.drop.sql +0 -2
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +0 -35
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +0 -222
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.drop.sql +0 -4
- data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase2.sql +0 -5
- data/vendor/rails/activerecord/test/fixtures/developer.rb +0 -72
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_action_controller +0 -3
- data/vendor/rails/activerecord/test/fixtures/developers_projects/david_active_record +0 -3
- data/vendor/rails/activerecord/test/fixtures/developers_projects/jamis_active_record +0 -2
- data/vendor/rails/activerecord/test/fixtures/migrations/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations/2_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_duplicate/2_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1000_people_have_middle_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/1_people_have_last_names.rb +0 -9
- data/vendor/rails/activerecord/test/fixtures/migrations_with_missing_versions/3_we_need_reminders.rb +0 -12
- data/vendor/rails/activerecord/test/fixtures/order.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/person.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures/pirate.rb +0 -5
- data/vendor/rails/activerecord/test/fixtures/post.rb +0 -59
- data/vendor/rails/activerecord/test/fixtures/project.rb +0 -28
- data/vendor/rails/activerecord/test/fixtures/reply.rb +0 -37
- data/vendor/rails/activerecord/test/fixtures/subscriber.rb +0 -6
- data/vendor/rails/activerecord/test/fixtures/subscribers/first +0 -2
- data/vendor/rails/activerecord/test/fixtures/subscribers/second +0 -2
- data/vendor/rails/activerecord/test/fixtures/topic.rb +0 -37
- data/vendor/rails/activerecord/test/fixtures/treasure.rb +0 -4
- data/vendor/rails/activerecord/test/fixtures_test.rb +0 -602
- data/vendor/rails/activerecord/test/inheritance_test.rb +0 -211
- data/vendor/rails/activerecord/test/json_serialization_test.rb +0 -180
- data/vendor/rails/activerecord/test/lifecycle_test.rb +0 -137
- data/vendor/rails/activerecord/test/locking_test.rb +0 -282
- data/vendor/rails/activerecord/test/method_scoping_test.rb +0 -416
- data/vendor/rails/activerecord/test/migration_test.rb +0 -933
- data/vendor/rails/activerecord/test/migration_test_firebird.rb +0 -124
- data/vendor/rails/activerecord/test/mixin_test.rb +0 -95
- data/vendor/rails/activerecord/test/modules_test.rb +0 -34
- data/vendor/rails/activerecord/test/multiple_db_test.rb +0 -60
- data/vendor/rails/activerecord/test/pk_test.rb +0 -101
- data/vendor/rails/activerecord/test/query_cache_test.rb +0 -104
- data/vendor/rails/activerecord/test/readonly_test.rb +0 -107
- data/vendor/rails/activerecord/test/reflection_test.rb +0 -175
- data/vendor/rails/activerecord/test/reserved_word_test_mysql.rb +0 -177
- data/vendor/rails/activerecord/test/schema_authorization_test_postgresql.rb +0 -75
- data/vendor/rails/activerecord/test/schema_dumper_test.rb +0 -131
- data/vendor/rails/activerecord/test/schema_test_postgresql.rb +0 -64
- data/vendor/rails/activerecord/test/serialization_test.rb +0 -47
- data/vendor/rails/activerecord/test/synonym_test_oracle.rb +0 -17
- data/vendor/rails/activerecord/test/table_name_test_sqlserver.rb +0 -23
- data/vendor/rails/activerecord/test/threaded_connections_test.rb +0 -48
- data/vendor/rails/activerecord/test/transactions_test.rb +0 -281
- data/vendor/rails/activerecord/test/unconnected_test.rb +0 -32
- data/vendor/rails/activerecord/test/validations_test.rb +0 -1395
- data/vendor/rails/activerecord/test/xml_serialization_test.rb +0 -202
- data/vendor/rails/activeresource/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/Rakefile +0 -83
- data/vendor/rails/activesupport/install.rb +0 -30
- data/vendor/rails/activesupport/lib/active_support/testing.rb +0 -1
- data/vendor/rails/activesupport/test/abstract_unit.rb +0 -20
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
- data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
- data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
- data/vendor/rails/activesupport/test/buffered_logger_test.rb +0 -107
- data/vendor/rails/activesupport/test/clean_logger_test.rb +0 -57
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -250
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -19
- data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
- data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
- data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -224
- data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +0 -105
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -46
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -196
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -230
- data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +0 -22
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -21
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -61
- data/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -64
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -29
- data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +0 -25
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -743
- data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
- data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
- data/vendor/rails/activesupport/test/core_ext/load_error_tests.rb +0 -16
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
- data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
- data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
- data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -58
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -293
- data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -24
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -147
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -242
- data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
- data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -63
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -180
- data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -420
- data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
- data/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies_test.rb +0 -751
- data/vendor/rails/activesupport/test/deprecation_test.rb +0 -151
- data/vendor/rails/activesupport/test/inflector_test.rb +0 -248
- data/vendor/rails/activesupport/test/inflector_test_cases.rb +0 -208
- data/vendor/rails/activesupport/test/json/decoding_test.rb +0 -41
- data/vendor/rails/activesupport/test/json/encoding_test.rb +0 -111
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -173
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -141
- data/vendor/rails/activesupport/test/multibyte_handler_test.rb +0 -367
- data/vendor/rails/activesupport/test/option_merger_test.rb +0 -50
- data/vendor/rails/activesupport/test/ordered_options_test.rb +0 -84
- data/vendor/rails/activesupport/test/test_test.rb +0 -73
- data/vendor/rails/activesupport/test/time_zone_test.rb +0 -98
- data/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -38
- data/vendor/rails/cleanlogs.sh +0 -1
- data/vendor/rails/pushgems.rb +0 -15
- data/vendor/rails/railties/lib/tasks/tmp.rake +0 -37
- data/vendor/rails/railties/test/abstract_unit.rb +0 -24
- data/vendor/rails/railties/test/boot_test.rb +0 -179
- data/vendor/rails/railties/test/console_app_test.rb +0 -29
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -265
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
- data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
- data/vendor/rails/railties/test/generators/generator_test_helper.rb +0 -195
- data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +0 -109
- data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +0 -106
- data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +0 -185
- data/vendor/rails/railties/test/initializer_test.rb +0 -218
- data/vendor/rails/railties/test/mocks/routes.rb +0 -6
- data/vendor/rails/railties/test/plugin_loader_test.rb +0 -140
- data/vendor/rails/railties/test/plugin_locator_test.rb +0 -69
- data/vendor/rails/railties/test/plugin_test.rb +0 -141
- data/vendor/rails/railties/test/plugin_test_helper.rb +0 -29
- data/vendor/rails/railties/test/rails_generator_test.rb +0 -137
- data/vendor/rails/railties/test/rails_info_controller_test.rb +0 -48
- data/vendor/rails/railties/test/rails_info_test.rb +0 -105
- data/vendor/rails/railties/test/secret_key_generation_test.rb +0 -35
- data/vendor/rails/release.rb +0 -25
@@ -21,8 +21,8 @@ module ActiveRecord
|
|
21
21
|
def replace(obj, dont_save = false)
|
22
22
|
load_target
|
23
23
|
|
24
|
-
unless @target.nil?
|
25
|
-
if dependent? && !dont_save
|
24
|
+
unless @target.nil? || @target == obj
|
25
|
+
if dependent? && !dont_save
|
26
26
|
@target.destroy unless @target.new_record?
|
27
27
|
@owner.clear_association_cache
|
28
28
|
else
|
@@ -51,9 +51,11 @@ module ActiveRecord
|
|
51
51
|
private
|
52
52
|
def find_target
|
53
53
|
@reflection.klass.find(:first,
|
54
|
-
:conditions => @finder_sql,
|
54
|
+
:conditions => @finder_sql,
|
55
|
+
:select => @reflection.options[:select],
|
55
56
|
:order => @reflection.options[:order],
|
56
|
-
:include => @reflection.options[:include]
|
57
|
+
:include => @reflection.options[:include],
|
58
|
+
:readonly => @reflection.options[:readonly]
|
57
59
|
)
|
58
60
|
end
|
59
61
|
|
@@ -61,10 +63,10 @@ module ActiveRecord
|
|
61
63
|
case
|
62
64
|
when @reflection.options[:as]
|
63
65
|
@finder_sql =
|
64
|
-
"#{@reflection.
|
65
|
-
"#{@reflection.
|
66
|
+
"#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_id = #{@owner.quoted_id} AND " +
|
67
|
+
"#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}"
|
66
68
|
else
|
67
|
-
@finder_sql = "#{@reflection.
|
69
|
+
@finder_sql = "#{@reflection.quoted_table_name}.#{@reflection.primary_key_name} = #{@owner.quoted_id}"
|
68
70
|
end
|
69
71
|
@finder_sql << " AND (#{conditions})" if conditions
|
70
72
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module Associations
|
3
|
+
class HasOneThroughAssociation < HasManyThroughAssociation
|
4
|
+
|
5
|
+
def create_through_record(new_value) #nodoc:
|
6
|
+
klass = @reflection.through_reflection.klass
|
7
|
+
|
8
|
+
current_object = @owner.send(@reflection.through_reflection.name)
|
9
|
+
|
10
|
+
if current_object
|
11
|
+
klass.destroy(current_object)
|
12
|
+
@owner.clear_association_cache
|
13
|
+
end
|
14
|
+
|
15
|
+
@owner.send(@reflection.through_reflection.name, klass.send(:create, construct_join_attributes(new_value)))
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
def find(*args)
|
20
|
+
super(args.merge(:limit => 1))
|
21
|
+
end
|
22
|
+
|
23
|
+
def find_target
|
24
|
+
super.first
|
25
|
+
end
|
26
|
+
|
27
|
+
def reset_target!
|
28
|
+
@target = nil
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -5,23 +5,31 @@ module ActiveRecord
|
|
5
5
|
|
6
6
|
def self.included(base)
|
7
7
|
base.extend ClassMethods
|
8
|
-
base.attribute_method_suffix
|
8
|
+
base.attribute_method_suffix(*DEFAULT_SUFFIXES)
|
9
9
|
base.cattr_accessor :attribute_types_cached_by_default, :instance_writer => false
|
10
10
|
base.attribute_types_cached_by_default = ATTRIBUTE_TYPES_CACHED_BY_DEFAULT
|
11
|
+
base.cattr_accessor :time_zone_aware_attributes, :instance_writer => false
|
12
|
+
base.time_zone_aware_attributes = false
|
13
|
+
base.cattr_accessor :skip_time_zone_conversion_for_attributes, :instance_writer => false
|
14
|
+
base.skip_time_zone_conversion_for_attributes = []
|
11
15
|
end
|
12
16
|
|
13
17
|
# Declare and check for suffixed attribute methods.
|
14
18
|
module ClassMethods
|
15
|
-
#
|
16
|
-
# Uses method_missing and respond_to
|
19
|
+
# Declares a method available for all attributes with the given suffix.
|
20
|
+
# Uses +method_missing+ and <tt>respond_to?</tt> to rewrite the method
|
21
|
+
#
|
17
22
|
# #{attr}#{suffix}(*args, &block)
|
23
|
+
#
|
18
24
|
# to
|
25
|
+
#
|
19
26
|
# attribute#{suffix}(#{attr}, *args, &block)
|
20
27
|
#
|
21
|
-
# An attribute#{suffix} instance method must exist and accept at least
|
22
|
-
# the attr argument.
|
28
|
+
# An <tt>attribute#{suffix}</tt> instance method must exist and accept at least
|
29
|
+
# the +attr+ argument.
|
23
30
|
#
|
24
31
|
# For example:
|
32
|
+
#
|
25
33
|
# class Person < ActiveRecord::Base
|
26
34
|
# attribute_method_suffix '_changed?'
|
27
35
|
#
|
@@ -56,21 +64,27 @@ module ActiveRecord
|
|
56
64
|
!generated_methods.empty?
|
57
65
|
end
|
58
66
|
|
59
|
-
#
|
60
|
-
# accessors, mutators and query methods
|
67
|
+
# Generates all the attribute related methods for columns in the database
|
68
|
+
# accessors, mutators and query methods.
|
61
69
|
def define_attribute_methods
|
62
70
|
return if generated_methods?
|
63
71
|
columns_hash.each do |name, column|
|
64
72
|
unless instance_method_already_implemented?(name)
|
65
73
|
if self.serialized_attributes[name]
|
66
74
|
define_read_method_for_serialized_attribute(name)
|
75
|
+
elsif create_time_zone_conversion_attribute?(name, column)
|
76
|
+
define_read_method_for_time_zone_conversion(name)
|
67
77
|
else
|
68
78
|
define_read_method(name.to_sym, name, column)
|
69
79
|
end
|
70
80
|
end
|
71
81
|
|
72
82
|
unless instance_method_already_implemented?("#{name}=")
|
73
|
-
|
83
|
+
if create_time_zone_conversion_attribute?(name, column)
|
84
|
+
define_write_method_for_time_zone_conversion(name)
|
85
|
+
else
|
86
|
+
define_write_method(name.to_sym)
|
87
|
+
end
|
74
88
|
end
|
75
89
|
|
76
90
|
unless instance_method_already_implemented?("#{name}?")
|
@@ -79,12 +93,14 @@ module ActiveRecord
|
|
79
93
|
end
|
80
94
|
end
|
81
95
|
|
82
|
-
#
|
83
|
-
#
|
96
|
+
# Checks whether the method is defined in the model or any of its subclasses
|
97
|
+
# that also derive from Active Record. Raises DangerousAttributeError if the
|
98
|
+
# method is defined by Active Record though.
|
84
99
|
def instance_method_already_implemented?(method_name)
|
100
|
+
method_name = method_name.to_s
|
85
101
|
return true if method_name =~ /^id(=$|\?$|$)/
|
86
|
-
@_defined_class_methods ||=
|
87
|
-
@@_defined_activerecord_methods ||=
|
102
|
+
@_defined_class_methods ||= ancestors.first(ancestors.index(ActiveRecord::Base)).sum([]) { |m| m.public_instance_methods(false) | m.private_instance_methods(false) | m.protected_instance_methods(false) }.map(&:to_s).to_set
|
103
|
+
@@_defined_activerecord_methods ||= (ActiveRecord::Base.public_instance_methods(false) | ActiveRecord::Base.private_instance_methods(false) | ActiveRecord::Base.protected_instance_methods(false)).map(&:to_s).to_set
|
88
104
|
raise DangerousAttributeError, "#{method_name} is defined by ActiveRecord" if @@_defined_activerecord_methods.include?(method_name)
|
89
105
|
@_defined_class_methods.include?(method_name)
|
90
106
|
end
|
@@ -93,17 +109,19 @@ module ActiveRecord
|
|
93
109
|
|
94
110
|
# +cache_attributes+ allows you to declare which converted attribute values should
|
95
111
|
# be cached. Usually caching only pays off for attributes with expensive conversion
|
96
|
-
# methods, like
|
112
|
+
# methods, like time related columns (e.g. +created_at+, +updated_at+).
|
97
113
|
def cache_attributes(*attribute_names)
|
98
114
|
attribute_names.each {|attr| cached_attributes << attr.to_s}
|
99
115
|
end
|
100
116
|
|
101
|
-
#
|
117
|
+
# Returns the attributes which are cached. By default time related columns
|
118
|
+
# with datatype <tt>:datetime, :timestamp, :time, :date</tt> are cached.
|
102
119
|
def cached_attributes
|
103
120
|
@cached_attributes ||=
|
104
121
|
columns.select{|c| attribute_types_cached_by_default.include?(c.type)}.map(&:name).to_set
|
105
122
|
end
|
106
123
|
|
124
|
+
# Returns +true+ if the provided attribute is being cached.
|
107
125
|
def cache_attribute?(attr_name)
|
108
126
|
cached_attributes.include?(attr_name)
|
109
127
|
end
|
@@ -120,6 +138,10 @@ module ActiveRecord
|
|
120
138
|
@@attribute_method_suffixes ||= []
|
121
139
|
end
|
122
140
|
|
141
|
+
def create_time_zone_conversion_attribute?(name, column)
|
142
|
+
time_zone_aware_attributes && !skip_time_zone_conversion_for_attributes.include?(name.to_sym) && [:datetime, :timestamp].include?(column.type)
|
143
|
+
end
|
144
|
+
|
123
145
|
# Define an attribute reader method. Cope with nil column.
|
124
146
|
def define_read_method(symbol, attr_name, column)
|
125
147
|
cast_code = column.type_cast_code('v') if column
|
@@ -139,8 +161,22 @@ module ActiveRecord
|
|
139
161
|
def define_read_method_for_serialized_attribute(attr_name)
|
140
162
|
evaluate_attribute_method attr_name, "def #{attr_name}; unserialize_attribute('#{attr_name}'); end"
|
141
163
|
end
|
164
|
+
|
165
|
+
# Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
|
166
|
+
# This enhanced read method automatically converts the UTC time stored in the database to the time zone stored in Time.zone.
|
167
|
+
def define_read_method_for_time_zone_conversion(attr_name)
|
168
|
+
method_body = <<-EOV
|
169
|
+
def #{attr_name}(reload = false)
|
170
|
+
cached = @attributes_cache['#{attr_name}']
|
171
|
+
return cached if cached && !reload
|
172
|
+
time = read_attribute('#{attr_name}')
|
173
|
+
@attributes_cache['#{attr_name}'] = time.acts_like?(:time) ? time.in_time_zone : time
|
174
|
+
end
|
175
|
+
EOV
|
176
|
+
evaluate_attribute_method attr_name, method_body
|
177
|
+
end
|
142
178
|
|
143
|
-
#
|
179
|
+
# Defines a predicate method <tt>attr_name?</tt>.
|
144
180
|
def define_question_method(attr_name)
|
145
181
|
evaluate_attribute_method attr_name, "def #{attr_name}?; query_attribute('#{attr_name}'); end", "#{attr_name}?"
|
146
182
|
end
|
@@ -148,6 +184,21 @@ module ActiveRecord
|
|
148
184
|
def define_write_method(attr_name)
|
149
185
|
evaluate_attribute_method attr_name, "def #{attr_name}=(new_value);write_attribute('#{attr_name}', new_value);end", "#{attr_name}="
|
150
186
|
end
|
187
|
+
|
188
|
+
# Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
|
189
|
+
# This enhanced write method will automatically convert the time passed to it to the zone stored in Time.zone.
|
190
|
+
def define_write_method_for_time_zone_conversion(attr_name)
|
191
|
+
method_body = <<-EOV
|
192
|
+
def #{attr_name}=(time)
|
193
|
+
unless time.acts_like?(:time)
|
194
|
+
time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time
|
195
|
+
end
|
196
|
+
time = time.in_time_zone rescue nil if time
|
197
|
+
write_attribute(:#{attr_name}, time)
|
198
|
+
end
|
199
|
+
EOV
|
200
|
+
evaluate_attribute_method attr_name, method_body, "#{attr_name}="
|
201
|
+
end
|
151
202
|
|
152
203
|
# Evaluate the definition for an attribute related method
|
153
204
|
def evaluate_attribute_method(attr_name, method_definition, method_name=attr_name)
|
@@ -170,14 +221,14 @@ module ActiveRecord
|
|
170
221
|
end # ClassMethods
|
171
222
|
|
172
223
|
|
173
|
-
# Allows access to the object attributes, which are held in the
|
224
|
+
# Allows access to the object attributes, which are held in the <tt>@attributes</tt> hash, as though they
|
174
225
|
# were first-class methods. So a Person class with a name attribute can use Person#name and
|
175
226
|
# Person#name= and never directly use the attributes hash -- except for multiple assigns with
|
176
227
|
# ActiveRecord#attributes=. A Milestone class can also ask Milestone#completed? to test that
|
177
|
-
# the completed attribute is not nil or 0.
|
228
|
+
# the completed attribute is not +nil+ or 0.
|
178
229
|
#
|
179
230
|
# It's also possible to instantiate related objects, so a Client class belonging to the clients
|
180
|
-
# table with a master_id foreign key can instantiate master through Client#master.
|
231
|
+
# table with a +master_id+ foreign key can instantiate master through Client#master.
|
181
232
|
def method_missing(method_id, *args, &block)
|
182
233
|
method_name = method_id.to_s
|
183
234
|
|
@@ -248,7 +299,7 @@ module ActiveRecord
|
|
248
299
|
|
249
300
|
|
250
301
|
# Updates the attribute identified by <tt>attr_name</tt> with the specified +value+. Empty strings for fixnum and float
|
251
|
-
# columns are turned into nil
|
302
|
+
# columns are turned into +nil+.
|
252
303
|
def write_attribute(attr_name, value)
|
253
304
|
attr_name = attr_name.to_s
|
254
305
|
@attributes_cache.delete(attr_name)
|
@@ -279,8 +330,9 @@ module ActiveRecord
|
|
279
330
|
end
|
280
331
|
end
|
281
332
|
|
282
|
-
# A Person object with a name attribute can ask person.respond_to?("name")
|
283
|
-
# person.respond_to?("name
|
333
|
+
# A Person object with a name attribute can ask <tt>person.respond_to?("name")</tt>,
|
334
|
+
# <tt>person.respond_to?("name=")</tt>, and <tt>person.respond_to?("name?")</tt>
|
335
|
+
# which will all return +true+.
|
284
336
|
alias :respond_to_without_attributes? :respond_to?
|
285
337
|
def respond_to?(method, include_priv = false)
|
286
338
|
method_name = method.to_s
|
@@ -302,7 +354,6 @@ module ActiveRecord
|
|
302
354
|
end
|
303
355
|
super
|
304
356
|
end
|
305
|
-
|
306
357
|
|
307
358
|
private
|
308
359
|
|
@@ -1,9 +1,8 @@
|
|
1
|
-
require 'base64'
|
2
1
|
require 'yaml'
|
3
2
|
require 'set'
|
4
3
|
|
5
4
|
module ActiveRecord #:nodoc:
|
6
|
-
# Generic
|
5
|
+
# Generic Active Record exception class.
|
7
6
|
class ActiveRecordError < StandardError
|
8
7
|
end
|
9
8
|
|
@@ -12,22 +11,18 @@ module ActiveRecord #:nodoc:
|
|
12
11
|
class SubclassNotFound < ActiveRecordError #:nodoc:
|
13
12
|
end
|
14
13
|
|
15
|
-
# Raised when object assigned to association
|
14
|
+
# Raised when an object assigned to an association has an incorrect type.
|
16
15
|
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# has_many :patches
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# class Patch < ActiveRecord::Base
|
24
|
-
# belongs_to :ticket
|
25
|
-
# end
|
16
|
+
# class Ticket < ActiveRecord::Base
|
17
|
+
# has_many :patches
|
18
|
+
# end
|
26
19
|
#
|
27
|
-
#
|
20
|
+
# class Patch < ActiveRecord::Base
|
21
|
+
# belongs_to :ticket
|
22
|
+
# end
|
28
23
|
#
|
29
|
-
#
|
30
|
-
#
|
24
|
+
# # Comments are not patches, this assignment raises AssociationTypeMismatch.
|
25
|
+
# @ticket.patches << Comment.new(:content => "Please attach tests to your patch.")
|
31
26
|
class AssociationTypeMismatch < ActiveRecordError
|
32
27
|
end
|
33
28
|
|
@@ -35,19 +30,19 @@ module ActiveRecord #:nodoc:
|
|
35
30
|
class SerializationTypeMismatch < ActiveRecordError
|
36
31
|
end
|
37
32
|
|
38
|
-
# Raised when adapter not specified on connection (or configuration file config/database.yml misses adapter field).
|
33
|
+
# Raised when adapter not specified on connection (or configuration file <tt>config/database.yml</tt> misses adapter field).
|
39
34
|
class AdapterNotSpecified < ActiveRecordError
|
40
35
|
end
|
41
36
|
|
42
|
-
# Raised when
|
37
|
+
# Raised when Active Record cannot find database adapter specified in <tt>config/database.yml</tt> or programmatically.
|
43
38
|
class AdapterNotFound < ActiveRecordError
|
44
39
|
end
|
45
40
|
|
46
|
-
# Raised when connection to the database could not been established (for example when connection
|
41
|
+
# Raised when connection to the database could not been established (for example when <tt>connection=</tt> is given a nil object).
|
47
42
|
class ConnectionNotEstablished < ActiveRecordError
|
48
43
|
end
|
49
44
|
|
50
|
-
# Raised when
|
45
|
+
# Raised when Active Record cannot find record by given id or set of ids.
|
51
46
|
class RecordNotFound < ActiveRecordError
|
52
47
|
end
|
53
48
|
|
@@ -60,14 +55,14 @@ module ActiveRecord #:nodoc:
|
|
60
55
|
class StatementInvalid < ActiveRecordError
|
61
56
|
end
|
62
57
|
|
63
|
-
# Raised when number of bind variables in statement given to
|
58
|
+
# Raised when number of bind variables in statement given to <tt>:condition</tt> key (for example, when using +find+ method)
|
64
59
|
# does not match number of expected variables.
|
65
60
|
#
|
66
|
-
#
|
61
|
+
# For example, in
|
67
62
|
#
|
68
|
-
#
|
63
|
+
# Location.find :all, :conditions => ["lat = ? AND lng = ?", 53.7362]
|
69
64
|
#
|
70
|
-
#
|
65
|
+
# two placeholders are given but only one variable to fill them.
|
71
66
|
class PreparedStatementInvalid < ActiveRecordError
|
72
67
|
end
|
73
68
|
|
@@ -75,7 +70,7 @@ module ActiveRecord #:nodoc:
|
|
75
70
|
# instantiation, for example, when two users edit the same wiki page and one starts editing and saves
|
76
71
|
# the page before the other.
|
77
72
|
#
|
78
|
-
# Read more about optimistic locking in
|
73
|
+
# Read more about optimistic locking in ActiveRecord::Locking module RDoc.
|
79
74
|
class StaleObjectError < ActiveRecordError
|
80
75
|
end
|
81
76
|
|
@@ -88,22 +83,24 @@ module ActiveRecord #:nodoc:
|
|
88
83
|
class ReadOnlyRecord < ActiveRecordError
|
89
84
|
end
|
90
85
|
|
91
|
-
# Used by
|
86
|
+
# Used by Active Record transaction mechanism to distinguish rollback from other exceptional situations.
|
92
87
|
# You can use it to roll your transaction back explicitly in the block passed to +transaction+ method.
|
93
88
|
class Rollback < ActiveRecordError
|
94
89
|
end
|
95
90
|
|
96
|
-
# Raised when attribute has a name reserved by
|
91
|
+
# Raised when attribute has a name reserved by Active Record (when attribute has name of one of Active Record instance methods).
|
97
92
|
class DangerousAttributeError < ActiveRecordError
|
98
93
|
end
|
99
94
|
|
100
|
-
# Raised when you've tried to access a column which wasn't
|
101
|
-
#
|
102
|
-
# has been specified
|
95
|
+
# Raised when you've tried to access a column which wasn't loaded by your finder.
|
96
|
+
# Typically this is because <tt>:select</tt> has been specified.
|
103
97
|
class MissingAttributeError < NoMethodError
|
104
98
|
end
|
105
99
|
|
106
|
-
|
100
|
+
# Raised when an error occured while doing a mass assignment to an attribute through the
|
101
|
+
# <tt>attributes=</tt> method. The exception has an +attribute+ property that is the name of the
|
102
|
+
# offending attribute.
|
103
|
+
class AttributeAssignmentError < ActiveRecordError
|
107
104
|
attr_reader :exception, :attribute
|
108
105
|
def initialize(message, exception, attribute)
|
109
106
|
@exception = exception
|
@@ -112,7 +109,10 @@ module ActiveRecord #:nodoc:
|
|
112
109
|
end
|
113
110
|
end
|
114
111
|
|
115
|
-
|
112
|
+
# Raised when there are multiple errors while doing a mass assignment through the +attributes+
|
113
|
+
# method. The exception has an +errors+ property that contains an array of AttributeAssignmentError
|
114
|
+
# objects, each corresponding to the error while assigning to an attribute.
|
115
|
+
class MultiparameterAssignmentErrors < ActiveRecordError
|
116
116
|
attr_reader :errors
|
117
117
|
def initialize(errors)
|
118
118
|
@errors = errors
|
@@ -192,18 +192,22 @@ module ActiveRecord #:nodoc:
|
|
192
192
|
#
|
193
193
|
# Student.find(:all, :conditions => { :grade => 9..12 })
|
194
194
|
#
|
195
|
+
# An array may be used in the hash to use the SQL IN operator:
|
196
|
+
#
|
197
|
+
# Student.find(:all, :conditions => { :grade => [9,11,12] })
|
198
|
+
#
|
195
199
|
# == Overwriting default accessors
|
196
200
|
#
|
197
201
|
# All column values are automatically available through basic accessors on the Active Record object, but sometimes you
|
198
202
|
# want to specialize this behavior. This can be done by overwriting the default accessors (using the same
|
199
|
-
# name as the attribute) and calling read_attribute(attr_name) and write_attribute(attr_name, value) to actually change things.
|
203
|
+
# name as the attribute) and calling <tt>read_attribute(attr_name)</tt> and <tt>write_attribute(attr_name, value)</tt> to actually change things.
|
200
204
|
# Example:
|
201
205
|
#
|
202
206
|
# class Song < ActiveRecord::Base
|
203
207
|
# # Uses an integer of seconds to hold the length of the song
|
204
208
|
#
|
205
209
|
# def length=(minutes)
|
206
|
-
# write_attribute(:length, minutes * 60)
|
210
|
+
# write_attribute(:length, minutes.to_i * 60)
|
207
211
|
# end
|
208
212
|
#
|
209
213
|
# def length
|
@@ -211,8 +215,8 @@ module ActiveRecord #:nodoc:
|
|
211
215
|
# end
|
212
216
|
# end
|
213
217
|
#
|
214
|
-
# You can alternatively use self[:attribute]=(value) and self[:attribute] instead of write_attribute(:attribute, value) and
|
215
|
-
# read_attribute(:attribute) as a shorter form.
|
218
|
+
# You can alternatively use <tt>self[:attribute]=(value)</tt> and <tt>self[:attribute]</tt> instead of <tt>write_attribute(:attribute, value)</tt> and
|
219
|
+
# <tt>read_attribute(:attribute)</tt> as a shorter form.
|
216
220
|
#
|
217
221
|
# == Attribute query methods
|
218
222
|
#
|
@@ -231,8 +235,8 @@ module ActiveRecord #:nodoc:
|
|
231
235
|
# == Accessing attributes before they have been typecasted
|
232
236
|
#
|
233
237
|
# Sometimes you want to be able to read the raw attribute data without having the column-determined typecast run its course first.
|
234
|
-
# That can be done by using the <attribute>_before_type_cast accessors that all attributes have. For example, if your Account model
|
235
|
-
# has a balance attribute, you can call account.balance_before_type_cast or account.id_before_type_cast
|
238
|
+
# That can be done by using the <tt><attribute>_before_type_cast</tt> accessors that all attributes have. For example, if your Account model
|
239
|
+
# has a <tt>balance</tt> attribute, you can call <tt>account.balance_before_type_cast</tt> or <tt>account.id_before_type_cast</tt>.
|
236
240
|
#
|
237
241
|
# This is especially useful in validation situations where the user might supply a string for an integer field and you want to display
|
238
242
|
# the original string back in an error message. Accessing the attribute normally would typecast the string to 0, which isn't what you
|
@@ -241,8 +245,8 @@ module ActiveRecord #:nodoc:
|
|
241
245
|
# == Dynamic attribute-based finders
|
242
246
|
#
|
243
247
|
# Dynamic attribute-based finders are a cleaner way of getting (and/or creating) objects by simple queries without turning to SQL. They work by
|
244
|
-
# appending the name of an attribute to <tt>find_by_</tt> or <tt>find_all_by_</tt>, so you get finders like Person.find_by_user_name
|
245
|
-
# Person.find_all_by_last_name
|
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>,
|
249
|
+
# <tt>Person.find_all_by_last_name</tt>, and <tt>Payment.find_by_transaction_id</tt>. So instead of writing
|
246
250
|
# <tt>Person.find(:first, :conditions => ["user_name = ?", user_name])</tt>, you just do <tt>Person.find_by_user_name(user_name)</tt>.
|
247
251
|
# 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>.
|
248
252
|
#
|
@@ -251,12 +255,12 @@ module ActiveRecord #:nodoc:
|
|
251
255
|
# <tt>Person.find(:first, :conditions => ["user_name = ? AND password = ?", user_name, password])</tt>, you just do
|
252
256
|
# <tt>Person.find_by_user_name_and_password(user_name, password)</tt>.
|
253
257
|
#
|
254
|
-
# It's even possible to use all the additional parameters to find. For example, the full interface for Payment.find_all_by_amount
|
255
|
-
# is actually Payment.find_all_by_amount(amount, options)
|
256
|
-
# actually Person.find_by_user_name(user_name, options)
|
258
|
+
# 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
|
+
# 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
|
+
# 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>.
|
257
261
|
#
|
258
262
|
# The same dynamic finder style can be used to create the object if it doesn't already exist. This dynamic finder is called with
|
259
|
-
# <tt>find_or_create_by_</tt> and will return the object if it already exists and otherwise creates it, then returns it.
|
263
|
+
# <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:
|
260
264
|
#
|
261
265
|
# # No 'Summer' tag exists
|
262
266
|
# Tag.find_or_create_by_name("Summer") # equal to Tag.create(:name => "Summer")
|
@@ -264,7 +268,10 @@ module ActiveRecord #:nodoc:
|
|
264
268
|
# # Now the 'Summer' tag does exist
|
265
269
|
# Tag.find_or_create_by_name("Summer") # equal to Tag.find_by_name("Summer")
|
266
270
|
#
|
267
|
-
#
|
271
|
+
# # Now 'Bob' exist and is an 'admin'
|
272
|
+
# User.find_or_create_by_name('Bob', :age => 40) { |u| u.admin = true }
|
273
|
+
#
|
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 setted unless they are given in a block. For example:
|
268
275
|
#
|
269
276
|
# # No 'Winter' tag exists
|
270
277
|
# winter = Tag.find_or_initialize_by_name("Winter")
|
@@ -309,8 +316,8 @@ module ActiveRecord #:nodoc:
|
|
309
316
|
# class Client < Company; end
|
310
317
|
# class PriorityClient < Client; end
|
311
318
|
#
|
312
|
-
# When you do Firm.create(:name => "37signals")
|
313
|
-
# fetch this row again using Company.find(:first, "name = '37signals'") and it will return a Firm object.
|
319
|
+
# When you do <tt>Firm.create(:name => "37signals")</tt>, this record will be saved in the companies table with type = "Firm". You can then
|
320
|
+
# fetch this row again using <tt>Company.find(:first, "name = '37signals'")</tt> and it will return a Firm object.
|
314
321
|
#
|
315
322
|
# If you don't have a type column defined in your table, single-table inheritance won't be triggered. In that case, it'll work just
|
316
323
|
# like normal subclasses with no special magic for differentiating between them or reloading the right type with find.
|
@@ -322,34 +329,34 @@ module ActiveRecord #:nodoc:
|
|
322
329
|
#
|
323
330
|
# Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection.
|
324
331
|
# All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection.
|
325
|
-
# For example, if Course is an ActiveRecord::Base, but resides in a different database, you can just say Course.establish_connection
|
326
|
-
# and Course
|
332
|
+
# For example, if Course is an ActiveRecord::Base, but resides in a different database, you can just say <tt>Course.establish_connection</tt>
|
333
|
+
# and Course and all of its subclasses will use this connection instead.
|
327
334
|
#
|
328
335
|
# This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is
|
329
336
|
# requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool.
|
330
337
|
#
|
331
338
|
# == Exceptions
|
332
339
|
#
|
333
|
-
# *
|
334
|
-
# *
|
340
|
+
# * ActiveRecordError - Generic error class and superclass of all other errors raised by Active Record.
|
341
|
+
# * AdapterNotSpecified - The configuration hash used in <tt>establish_connection</tt> didn't include an
|
335
342
|
# <tt>:adapter</tt> key.
|
336
|
-
# *
|
343
|
+
# * AdapterNotFound - The <tt>:adapter</tt> key used in <tt>establish_connection</tt> specified a non-existent adapter
|
337
344
|
# (or a bad spelling of an existing one).
|
338
|
-
# *
|
339
|
-
# *
|
340
|
-
# *
|
341
|
-
# *
|
342
|
-
#
|
343
|
-
#
|
344
|
-
#
|
345
|
-
# *
|
346
|
-
#
|
345
|
+
# * AssociationTypeMismatch - The object assigned to the association wasn't of the type specified in the association definition.
|
346
|
+
# * SerializationTypeMismatch - The serialized object wasn't of the class specified as the second parameter.
|
347
|
+
# * ConnectionNotEstablished+ - No connection has been established. Use <tt>establish_connection</tt> before querying.
|
348
|
+
# * RecordNotFound - No record responded to the +find+ method. Either the row with the given ID doesn't exist
|
349
|
+
# or the row didn't meet the additional restrictions. Some +find+ calls do not raise this exception to signal
|
350
|
+
# nothing was found, please check its documentation for further details.
|
351
|
+
# * StatementInvalid - The database server rejected the SQL statement. The precise error is added in the message.
|
352
|
+
# * MultiparameterAssignmentErrors - Collection of errors that occurred during a mass assignment using the
|
353
|
+
# <tt>attributes=</tt> method. The +errors+ property of this exception contains an array of AttributeAssignmentError
|
347
354
|
# objects that should be inspected to determine which attributes triggered the errors.
|
348
|
-
# *
|
355
|
+
# * AttributeAssignmentError - An error occurred while doing a mass assignment through the <tt>attributes=</tt> method.
|
349
356
|
# You can inspect the +attribute+ property of the exception object to determine which attribute triggered the error.
|
350
357
|
#
|
351
358
|
# *Note*: The attributes listed are class-level attributes (accessible from both the class and instance level).
|
352
|
-
# So it's possible to assign a logger to the class through Base.logger
|
359
|
+
# So it's possible to assign a logger to the class through <tt>Base.logger=</tt> which will then be used by all
|
353
360
|
# instances in the current object space.
|
354
361
|
class Base
|
355
362
|
# Accepts a logger conforming to the interface of Log4r or the default Ruby 1.8+ Logger class, which is then passed
|
@@ -365,7 +372,7 @@ module ActiveRecord #:nodoc:
|
|
365
372
|
def self.reset_subclasses #:nodoc:
|
366
373
|
nonreloadables = []
|
367
374
|
subclasses.each do |klass|
|
368
|
-
unless Dependencies.autoloaded? klass
|
375
|
+
unless ActiveSupport::Dependencies.autoloaded? klass
|
369
376
|
nonreloadables << klass
|
370
377
|
next
|
371
378
|
end
|
@@ -400,7 +407,7 @@ module ActiveRecord #:nodoc:
|
|
400
407
|
@@table_name_suffix = ""
|
401
408
|
|
402
409
|
# Indicates whether table names should be the pluralized versions of the corresponding class names.
|
403
|
-
# If true, the default table name for a
|
410
|
+
# If true, the default table name for a Product class will be +products+. If false, it would just be +product+.
|
404
411
|
# See table_name for the full rules on table/class naming. This is true, by default.
|
405
412
|
cattr_accessor :pluralize_table_names, :instance_writer => false
|
406
413
|
@@pluralize_table_names = true
|
@@ -417,7 +424,9 @@ module ActiveRecord #:nodoc:
|
|
417
424
|
@@default_timezone = :local
|
418
425
|
|
419
426
|
# Determines whether to use a connection for each thread, or a single shared connection for all threads.
|
420
|
-
# Defaults to false.
|
427
|
+
# Defaults to false. If you're writing a threaded application, set to true
|
428
|
+
# and periodically call verify_active_connections! to clear out connections
|
429
|
+
# assigned to stale threads.
|
421
430
|
cattr_accessor :allow_concurrency, :instance_writer => false
|
422
431
|
@@allow_concurrency = false
|
423
432
|
|
@@ -430,37 +439,55 @@ module ActiveRecord #:nodoc:
|
|
430
439
|
cattr_accessor :schema_format , :instance_writer => false
|
431
440
|
@@schema_format = :ruby
|
432
441
|
|
442
|
+
# Specify whether or not to use timestamps for migration numbers
|
443
|
+
cattr_accessor :timestamped_migrations , :instance_writer => false
|
444
|
+
@@timestamped_migrations = true
|
445
|
+
|
446
|
+
# Determine whether to store the full constant name including namespace when using STI
|
447
|
+
superclass_delegating_accessor :store_full_sti_class
|
448
|
+
self.store_full_sti_class = false
|
449
|
+
|
433
450
|
class << self # Class methods
|
434
|
-
# Find operates with
|
451
|
+
# Find operates with four different retrieval approaches:
|
435
452
|
#
|
436
|
-
# * Find by id
|
453
|
+
# * Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]).
|
437
454
|
# If no record can be found for all of the listed ids, then RecordNotFound will be raised.
|
438
|
-
# * Find first
|
439
|
-
# conditions or merely an order. If no record can be matched, nil is returned.
|
440
|
-
#
|
441
|
-
#
|
442
|
-
#
|
443
|
-
#
|
444
|
-
# *
|
445
|
-
#
|
446
|
-
# *
|
447
|
-
#
|
448
|
-
#
|
449
|
-
#
|
450
|
-
#
|
455
|
+
# * Find first - This will return the first record matched by the options used. These options can either be specific
|
456
|
+
# conditions or merely an order. If no record can be matched, +nil+ is returned. Use
|
457
|
+
# <tt>Model.find(:first, *args)</tt> or its shortcut <tt>Model.first(*args)</tt>.
|
458
|
+
# * Find last - This will return the last record matched by the options used. These options can either be specific
|
459
|
+
# conditions or merely an order. If no record can be matched, +nil+ is returned. Use
|
460
|
+
# <tt>Model.find(:last, *args)</tt> or its shortcut <tt>Model.last(*args)</tt>.
|
461
|
+
# * Find all - This will return all the records matched by the options used.
|
462
|
+
# If no records are found, an empty array is returned. Use
|
463
|
+
# <tt>Model.find(:all, *args)</tt> or its shortcut <tt>Model.all(*args)</tt>.
|
464
|
+
#
|
465
|
+
# All approaches accept an options hash as their last parameter.
|
466
|
+
#
|
467
|
+
# ==== Attributes
|
468
|
+
#
|
469
|
+
# * <tt>:conditions</tt> - An SQL fragment like "administrator = 1" or <tt>[ "user_name = ?", username ]</tt>. See conditions in the intro.
|
470
|
+
# * <tt>:order</tt> - An SQL fragment like "created_at DESC, name".
|
471
|
+
# * <tt>:group</tt> - An attribute name by which the result should be grouped. Uses the <tt>GROUP BY</tt> SQL-clause.
|
472
|
+
# * <tt>:limit</tt> - An integer determining the limit on the number of rows that should be returned.
|
473
|
+
# * <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
|
+
# or 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).
|
451
476
|
# 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.
|
452
|
-
# Pass
|
453
|
-
# * <tt>:include</tt
|
477
|
+
# Pass <tt>:readonly => false</tt> to override.
|
478
|
+
# * <tt>:include</tt> - Names associations that should be loaded alongside. The symbols named refer
|
454
479
|
# to already defined associations. See eager loading under Associations.
|
455
|
-
# * <tt>:select</tt
|
480
|
+
# * <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
|
456
481
|
# include the joined columns.
|
457
|
-
# * <tt>:from</tt
|
482
|
+
# * <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
|
458
483
|
# of a database view).
|
459
|
-
# * <tt>:readonly</tt
|
460
|
-
# * <tt>:lock</tt
|
461
|
-
#
|
484
|
+
# * <tt>:readonly</tt> - Mark the returned records read-only so they cannot be saved or updated.
|
485
|
+
# * <tt>:lock</tt> - An SQL fragment like "FOR UPDATE" or "LOCK IN SHARE MODE".
|
486
|
+
# <tt>:lock => true</tt> gives connection's default exclusive lock, usually "FOR UPDATE".
|
462
487
|
#
|
463
|
-
# Examples
|
488
|
+
# ==== Examples
|
489
|
+
#
|
490
|
+
# # find by id
|
464
491
|
# Person.find(1) # returns the object for ID = 1
|
465
492
|
# Person.find(1, 2, 6) # returns an array for objects with IDs in (1, 2, 6)
|
466
493
|
# Person.find([7, 17]) # returns an array for objects with IDs in (7, 17)
|
@@ -468,26 +495,35 @@ module ActiveRecord #:nodoc:
|
|
468
495
|
# Person.find(1, :conditions => "administrator = 1", :order => "created_on DESC")
|
469
496
|
#
|
470
497
|
# Note that returned records may not be in the same order as the ids you
|
471
|
-
# provide since database rows are unordered. Give an explicit
|
498
|
+
# provide since database rows are unordered. Give an explicit <tt>:order</tt>
|
472
499
|
# to ensure the results are sorted.
|
473
500
|
#
|
474
|
-
# Examples
|
501
|
+
# ==== Examples
|
502
|
+
#
|
503
|
+
# # find first
|
475
504
|
# Person.find(:first) # returns the first object fetched by SELECT * FROM people
|
476
505
|
# Person.find(:first, :conditions => [ "user_name = ?", user_name])
|
477
506
|
# Person.find(:first, :order => "created_on DESC", :offset => 5)
|
478
507
|
#
|
479
|
-
#
|
508
|
+
# # find last
|
509
|
+
# Person.find(:last) # returns the last object fetched by SELECT * FROM people
|
510
|
+
# Person.find(:last, :conditions => [ "user_name = ?", user_name])
|
511
|
+
# Person.find(:last, :order => "created_on DESC", :offset => 5)
|
512
|
+
#
|
513
|
+
# # find all
|
480
514
|
# Person.find(:all) # returns an array of objects for all the rows fetched by SELECT * FROM people
|
481
515
|
# Person.find(:all, :conditions => [ "category IN (?)", categories], :limit => 50)
|
516
|
+
# Person.find(:all, :conditions => { :friends => ["Bob", "Steve", "Fred"] }
|
482
517
|
# Person.find(:all, :offset => 10, :limit => 10)
|
483
518
|
# Person.find(:all, :include => [ :account, :friends ])
|
484
519
|
# Person.find(:all, :group => "category")
|
485
520
|
#
|
486
|
-
# Example for find with a lock
|
487
|
-
# each will read person.visits == 2
|
488
|
-
# in two saves of person.visits = 3
|
521
|
+
# Example for find with a lock: Imagine two concurrent transactions:
|
522
|
+
# each will read <tt>person.visits == 2</tt>, add 1 to it, and save, resulting
|
523
|
+
# in two saves of <tt>person.visits = 3</tt>. By locking the row, the second
|
489
524
|
# transaction has to wait until the first is finished; we get the
|
490
|
-
# expected person.visits == 4
|
525
|
+
# expected <tt>person.visits == 4</tt>.
|
526
|
+
#
|
491
527
|
# Person.transaction do
|
492
528
|
# person = Person.find(1, :lock => true)
|
493
529
|
# person.visits += 1
|
@@ -500,13 +536,31 @@ module ActiveRecord #:nodoc:
|
|
500
536
|
|
501
537
|
case args.first
|
502
538
|
when :first then find_initial(options)
|
539
|
+
when :last then find_last(options)
|
503
540
|
when :all then find_every(options)
|
504
541
|
else find_from_ids(args, options)
|
505
542
|
end
|
506
543
|
end
|
507
544
|
|
508
|
-
#
|
509
|
-
#
|
545
|
+
# A convenience wrapper for <tt>find(:first, *args)</tt>. You can pass in all the
|
546
|
+
# same arguments to this method as you can to <tt>find(:first)</tt>.
|
547
|
+
def first(*args)
|
548
|
+
find(:first, *args)
|
549
|
+
end
|
550
|
+
|
551
|
+
# A convenience wrapper for <tt>find(:last, *args)</tt>. You can pass in all the
|
552
|
+
# same arguments to this method as you can to <tt>find(:last)</tt>.
|
553
|
+
def last(*args)
|
554
|
+
find(:last, *args)
|
555
|
+
end
|
556
|
+
|
557
|
+
# This is an alias for find(:all). You can pass in all the same arguments to this method as you can
|
558
|
+
# to find(:all)
|
559
|
+
def all(*args)
|
560
|
+
find(:all, *args)
|
561
|
+
end
|
562
|
+
|
563
|
+
# Executes a custom SQL query against your database and returns all the results. The results will
|
510
564
|
# be returned as an array with columns requested encapsulated as attributes of the model you call
|
511
565
|
# this method from. If you call +Product.find_by_sql+ then the results will be returned in a Product
|
512
566
|
# object with the attributes you specified in the SQL query.
|
@@ -515,13 +569,13 @@ module ActiveRecord #:nodoc:
|
|
515
569
|
# SELECT will be attributes of the model, whether or not they are columns of the corresponding
|
516
570
|
# table.
|
517
571
|
#
|
518
|
-
# The +sql+ parameter is a full
|
572
|
+
# The +sql+ parameter is a full SQL query as a string. It will be called as is, there will be
|
519
573
|
# no database agnostic conversions performed. This should be a last resort because using, for example,
|
520
574
|
# MySQL specific terms will lock you to using that particular database engine or require you to
|
521
575
|
# change your call if you switch engines
|
522
576
|
#
|
523
577
|
# ==== Examples
|
524
|
-
# # A simple
|
578
|
+
# # A simple SQL query spanning multiple tables
|
525
579
|
# Post.find_by_sql "SELECT p.title, c.author FROM posts p, comments c WHERE p.id = c.post_id"
|
526
580
|
# > [#<Post:0x36bff9c @attributes={"title"=>"Ruby Meetup", "first_name"=>"Quentin"}>, ...]
|
527
581
|
#
|
@@ -549,8 +603,14 @@ module ActiveRecord #:nodoc:
|
|
549
603
|
# Person.exists?(:name => "David")
|
550
604
|
# Person.exists?(['name LIKE ?', "%#{query}%"])
|
551
605
|
def exists?(id_or_conditions)
|
552
|
-
|
553
|
-
|
606
|
+
connection.select_all(
|
607
|
+
construct_finder_sql(
|
608
|
+
:select => "#{quoted_table_name}.#{primary_key}",
|
609
|
+
:conditions => expand_id_conditions(id_or_conditions),
|
610
|
+
:limit => 1
|
611
|
+
),
|
612
|
+
"#{name} Exists"
|
613
|
+
).size > 0
|
554
614
|
end
|
555
615
|
|
556
616
|
# Creates an object (or multiple objects) and saves it to the database, if validations pass.
|
@@ -562,13 +622,25 @@ module ActiveRecord #:nodoc:
|
|
562
622
|
# ==== Examples
|
563
623
|
# # Create a single new object
|
564
624
|
# User.create(:first_name => 'Jamie')
|
625
|
+
#
|
565
626
|
# # Create an Array of new objects
|
566
|
-
# User.create([{:first_name => 'Jamie'}, {:first_name => 'Jeremy'}])
|
567
|
-
|
627
|
+
# User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }])
|
628
|
+
#
|
629
|
+
# # Create a single object and pass it into a block to set other attributes.
|
630
|
+
# User.create(:first_name => 'Jamie') do |u|
|
631
|
+
# u.is_admin = false
|
632
|
+
# end
|
633
|
+
#
|
634
|
+
# # Creating an Array of new objects using a block, where the block is executed for each object:
|
635
|
+
# User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }]) do |u|
|
636
|
+
# u.is_admin = false
|
637
|
+
# end
|
638
|
+
def create(attributes = nil, &block)
|
568
639
|
if attributes.is_a?(Array)
|
569
|
-
attributes.collect { |attr| create(attr) }
|
640
|
+
attributes.collect { |attr| create(attr, &block) }
|
570
641
|
else
|
571
642
|
object = new(attributes)
|
643
|
+
yield(object) if block_given?
|
572
644
|
object.save
|
573
645
|
object
|
574
646
|
end
|
@@ -577,23 +649,23 @@ module ActiveRecord #:nodoc:
|
|
577
649
|
# Updates an object (or multiple objects) and saves it to the database, if validations pass.
|
578
650
|
# The resulting object is returned whether the object was saved successfully to the database or not.
|
579
651
|
#
|
580
|
-
# ====
|
652
|
+
# ==== Attributes
|
581
653
|
#
|
582
|
-
# +id+
|
583
|
-
# +attributes+
|
654
|
+
# * +id+ - This should be the id or an array of ids to be updated.
|
655
|
+
# * +attributes+ - This should be a Hash of attributes to be set on the object, or an array of Hashes.
|
584
656
|
#
|
585
657
|
# ==== Examples
|
586
658
|
#
|
587
659
|
# # Updating one record:
|
588
|
-
# Person.update(15, {:user_name => 'Samuel', :group => 'expert'})
|
660
|
+
# Person.update(15, { :user_name => 'Samuel', :group => 'expert' })
|
589
661
|
#
|
590
662
|
# # Updating multiple records:
|
591
|
-
# people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy"} }
|
663
|
+
# people = { 1 => { "first_name" => "David" }, 2 => { "first_name" => "Jeremy" } }
|
592
664
|
# Person.update(people.keys, people.values)
|
593
665
|
def update(id, attributes)
|
594
666
|
if id.is_a?(Array)
|
595
667
|
idx = -1
|
596
|
-
id.collect { |
|
668
|
+
id.collect { |one_id| idx += 1; update(one_id, attributes[idx]) }
|
597
669
|
else
|
598
670
|
object = find(id)
|
599
671
|
object.update_attributes(attributes)
|
@@ -607,9 +679,9 @@ module ActiveRecord #:nodoc:
|
|
607
679
|
#
|
608
680
|
# Objects are _not_ instantiated with this method.
|
609
681
|
#
|
610
|
-
# ====
|
682
|
+
# ==== Attributes
|
611
683
|
#
|
612
|
-
# +id+
|
684
|
+
# * +id+ - Can be either an Integer or an Array of Integers.
|
613
685
|
#
|
614
686
|
# ==== Examples
|
615
687
|
#
|
@@ -630,9 +702,9 @@ module ActiveRecord #:nodoc:
|
|
630
702
|
# This essentially finds the object (or multiple objects) with the given id, creates a new object
|
631
703
|
# from the attributes, and then calls destroy on it.
|
632
704
|
#
|
633
|
-
# ====
|
705
|
+
# ==== Attributes
|
634
706
|
#
|
635
|
-
# +id+
|
707
|
+
# * +id+ - Can be either an Integer or an Array of Integers.
|
636
708
|
#
|
637
709
|
# ==== Examples
|
638
710
|
#
|
@@ -643,18 +715,22 @@ module ActiveRecord #:nodoc:
|
|
643
715
|
# todos = [1,2,3]
|
644
716
|
# Todo.destroy(todos)
|
645
717
|
def destroy(id)
|
646
|
-
id.is_a?(Array)
|
718
|
+
if id.is_a?(Array)
|
719
|
+
id.map { |one_id| destroy(one_id) }
|
720
|
+
else
|
721
|
+
find(id).destroy
|
722
|
+
end
|
647
723
|
end
|
648
724
|
|
649
725
|
# Updates all records with details given if they match a set of conditions supplied, limits and order can
|
650
726
|
# also be supplied.
|
651
727
|
#
|
652
|
-
# ====
|
728
|
+
# ==== Attributes
|
653
729
|
#
|
654
|
-
# +updates+
|
655
|
-
# +conditions+
|
656
|
-
#
|
657
|
-
# +options+
|
730
|
+
# * +updates+ - A String of column and value pairs that will be set on any records that match conditions.
|
731
|
+
# * +conditions+ - An SQL fragment like "administrator = 1" or [ "user_name = ?", username ].
|
732
|
+
# See conditions in the intro for more info.
|
733
|
+
# * +options+ - Additional options are <tt>:limit</tt> and/or <tt>:order</tt>, see the examples for usage.
|
658
734
|
#
|
659
735
|
# ==== Examples
|
660
736
|
#
|
@@ -668,11 +744,11 @@ module ActiveRecord #:nodoc:
|
|
668
744
|
# Billing.update_all( "author = 'David'", "title LIKE '%Rails%'",
|
669
745
|
# :order => 'created_at', :limit => 5 )
|
670
746
|
def update_all(updates, conditions = nil, options = {})
|
671
|
-
sql = "UPDATE #{
|
747
|
+
sql = "UPDATE #{quoted_table_name} SET #{sanitize_sql_for_assignment(updates)} "
|
672
748
|
scope = scope(:find)
|
673
749
|
add_conditions!(sql, conditions, scope)
|
674
|
-
add_order!(sql, options[:order],
|
675
|
-
add_limit!(sql, options,
|
750
|
+
add_order!(sql, options[:order], nil)
|
751
|
+
add_limit!(sql, options, nil)
|
676
752
|
connection.update(sql, "#{name} Update")
|
677
753
|
end
|
678
754
|
|
@@ -681,9 +757,9 @@ module ActiveRecord #:nodoc:
|
|
681
757
|
# many records. If you want to simply delete records without worrying about dependent associations or
|
682
758
|
# callbacks, use the much faster +delete_all+ method instead.
|
683
759
|
#
|
684
|
-
# ====
|
760
|
+
# ==== Attributes
|
685
761
|
#
|
686
|
-
# +conditions+
|
762
|
+
# * +conditions+ - Conditions are specified the same way as with +find+ method.
|
687
763
|
#
|
688
764
|
# ==== Example
|
689
765
|
#
|
@@ -699,9 +775,9 @@ module ActiveRecord #:nodoc:
|
|
699
775
|
# calling the destroy method and invoking callbacks. This is a single SQL query, much more efficient
|
700
776
|
# than destroy_all.
|
701
777
|
#
|
702
|
-
# ====
|
778
|
+
# ==== Attributes
|
703
779
|
#
|
704
|
-
# +conditions+
|
780
|
+
# * +conditions+ - Conditions are specified the same way as with +find+ method.
|
705
781
|
#
|
706
782
|
# ==== Example
|
707
783
|
#
|
@@ -719,9 +795,9 @@ module ActiveRecord #:nodoc:
|
|
719
795
|
# The use of this method should be restricted to complicated SQL queries that can't be executed
|
720
796
|
# using the ActiveRecord::Calculations class methods. Look into those before using this.
|
721
797
|
#
|
722
|
-
# ====
|
798
|
+
# ==== Attributes
|
723
799
|
#
|
724
|
-
# +sql
|
800
|
+
# * +sql+ - An SQL statement which should return a count query from the database, see the example below.
|
725
801
|
#
|
726
802
|
# ==== Examples
|
727
803
|
#
|
@@ -737,12 +813,11 @@ module ActiveRecord #:nodoc:
|
|
737
813
|
# with the given ID, altering the given hash of counters by the amount
|
738
814
|
# given by the corresponding value:
|
739
815
|
#
|
740
|
-
# ====
|
816
|
+
# ==== Attributes
|
741
817
|
#
|
742
|
-
# +id+
|
743
|
-
# +counters+
|
744
|
-
#
|
745
|
-
# values
|
818
|
+
# * +id+ - The id of the object you wish to update a counter on.
|
819
|
+
# * +counters+ - An Array of Hashes containing the names of the fields
|
820
|
+
# to update as keys and the amount to update the field by as values.
|
746
821
|
#
|
747
822
|
# ==== Examples
|
748
823
|
#
|
@@ -757,7 +832,7 @@ module ActiveRecord #:nodoc:
|
|
757
832
|
def update_counters(id, counters)
|
758
833
|
updates = counters.inject([]) { |list, (counter_name, increment)|
|
759
834
|
sign = increment < 0 ? "-" : "+"
|
760
|
-
list << "#{connection.quote_column_name(counter_name)} = #{connection.quote_column_name(counter_name)} #{sign} #{increment.abs}"
|
835
|
+
list << "#{connection.quote_column_name(counter_name)} = COALESCE(#{connection.quote_column_name(counter_name)}, 0) #{sign} #{increment.abs}"
|
761
836
|
}.join(", ")
|
762
837
|
update_all(updates, "#{connection.quote_column_name(primary_key)} = #{quote_value(id)}")
|
763
838
|
end
|
@@ -768,10 +843,10 @@ module ActiveRecord #:nodoc:
|
|
768
843
|
# For example, a DiscussionBoard may cache post_count and comment_count otherwise every time the board is
|
769
844
|
# shown it would have to run an SQL query to find how many posts and comments there are.
|
770
845
|
#
|
771
|
-
# ====
|
846
|
+
# ==== Attributes
|
772
847
|
#
|
773
|
-
# +counter_name+
|
774
|
-
# +id+
|
848
|
+
# * +counter_name+ - The name of the field that should be incremented.
|
849
|
+
# * +id+ - The id of the object that should be incremented.
|
775
850
|
#
|
776
851
|
# ==== Examples
|
777
852
|
#
|
@@ -785,10 +860,10 @@ module ActiveRecord #:nodoc:
|
|
785
860
|
#
|
786
861
|
# This works the same as increment_counter but reduces the column value by 1 instead of increasing it.
|
787
862
|
#
|
788
|
-
# ====
|
863
|
+
# ==== Attributes
|
789
864
|
#
|
790
|
-
# +counter_name+
|
791
|
-
# +id+
|
865
|
+
# * +counter_name+ - The name of the field that should be decremented.
|
866
|
+
# * +id+ - The id of the object that should be decremented.
|
792
867
|
#
|
793
868
|
# ==== Examples
|
794
869
|
#
|
@@ -799,9 +874,15 @@ module ActiveRecord #:nodoc:
|
|
799
874
|
end
|
800
875
|
|
801
876
|
|
802
|
-
# Attributes named in this macro are protected from mass-assignment,
|
803
|
-
# <tt>
|
804
|
-
#
|
877
|
+
# Attributes named in this macro are protected from mass-assignment,
|
878
|
+
# such as <tt>new(attributes)</tt>,
|
879
|
+
# <tt>update_attributes(attributes)</tt>, or
|
880
|
+
# <tt>attributes=(attributes)</tt>.
|
881
|
+
#
|
882
|
+
# Mass-assignment to these attributes will simply be ignored, to assign
|
883
|
+
# to them you can use direct writer methods. This is meant to protect
|
884
|
+
# sensitive attributes from being overwritten by malicious users
|
885
|
+
# tampering with URLs or forms.
|
805
886
|
#
|
806
887
|
# class Customer < ActiveRecord::Base
|
807
888
|
# attr_protected :credit_rating
|
@@ -815,7 +896,8 @@ module ActiveRecord #:nodoc:
|
|
815
896
|
# customer.credit_rating = "Average"
|
816
897
|
# customer.credit_rating # => "Average"
|
817
898
|
#
|
818
|
-
# To start from an all-closed default and enable attributes as needed,
|
899
|
+
# To start from an all-closed default and enable attributes as needed,
|
900
|
+
# have a look at +attr_accessible+.
|
819
901
|
def attr_protected(*attributes)
|
820
902
|
write_inheritable_attribute("attr_protected", Set.new(attributes.map(&:to_s)) + (protected_attributes || []))
|
821
903
|
end
|
@@ -825,19 +907,18 @@ module ActiveRecord #:nodoc:
|
|
825
907
|
read_inheritable_attribute("attr_protected")
|
826
908
|
end
|
827
909
|
|
828
|
-
#
|
829
|
-
# such as <tt>new(attributes)</tt
|
830
|
-
#
|
831
|
-
# attributes
|
832
|
-
# using the direct writer methods instead. This is meant to protect sensitive attributes from being
|
833
|
-
# overwritten by URL/form hackers. If you'd rather start from an all-open default and restrict
|
834
|
-
# attributes as needed, have a look at attr_protected.
|
835
|
-
#
|
836
|
-
# ==== Options
|
837
|
-
#
|
838
|
-
# <tt>*attributes</tt> A comma separated list of symbols that represent columns _not_ to be protected
|
910
|
+
# Specifies a white list of model attributes that can be set via
|
911
|
+
# mass-assignment, such as <tt>new(attributes)</tt>,
|
912
|
+
# <tt>update_attributes(attributes)</tt>, or
|
913
|
+
# <tt>attributes=(attributes)</tt>
|
839
914
|
#
|
840
|
-
#
|
915
|
+
# This is the opposite of the +attr_protected+ macro: Mass-assignment
|
916
|
+
# will only set attributes in this list, to assign to the rest of
|
917
|
+
# attributes you can use direct writer methods. This is meant to protect
|
918
|
+
# sensitive attributes from being overwritten by malicious users
|
919
|
+
# tampering with URLs or forms. If you'd rather start from an all-open
|
920
|
+
# default and restrict attributes as needed, have a look at
|
921
|
+
# +attr_protected+.
|
841
922
|
#
|
842
923
|
# class Customer < ActiveRecord::Base
|
843
924
|
# attr_accessible :name, :nickname
|
@@ -872,12 +953,12 @@ module ActiveRecord #:nodoc:
|
|
872
953
|
# If you have an attribute that needs to be saved to the database as an object, and retrieved as the same object,
|
873
954
|
# then specify the name of that attribute using this method and it will be handled automatically.
|
874
955
|
# The serialization is done through YAML. If +class_name+ is specified, the serialized object must be of that
|
875
|
-
# class on retrieval or
|
956
|
+
# class on retrieval or SerializationTypeMismatch will be raised.
|
876
957
|
#
|
877
|
-
# ====
|
958
|
+
# ==== Attributes
|
878
959
|
#
|
879
|
-
# +attr_name+
|
880
|
-
# +class_name+
|
960
|
+
# * +attr_name+ - The field name that should be serialized.
|
961
|
+
# * +class_name+ - Optional, class name that the object type should be equal to.
|
881
962
|
#
|
882
963
|
# ==== Example
|
883
964
|
# # Serialize a preferences attribute
|
@@ -895,12 +976,14 @@ module ActiveRecord #:nodoc:
|
|
895
976
|
|
896
977
|
|
897
978
|
# Guesses the table name (in forced lower-case) based on the name of the class in the inheritance hierarchy descending
|
898
|
-
# directly from ActiveRecord. So if the hierarchy looks like: Reply < Message < ActiveRecord, then Message is used
|
979
|
+
# directly from ActiveRecord::Base. So if the hierarchy looks like: Reply < Message < ActiveRecord::Base, then Message is used
|
899
980
|
# to guess the table name even when called on Reply. The rules used to do the guess are handled by the Inflector class
|
900
981
|
# in Active Support, which knows almost all common English inflections. You can add new inflections in config/initializers/inflections.rb.
|
901
982
|
#
|
902
983
|
# Nested classes are given table names prefixed by the singular form of
|
903
|
-
# the parent's table name. Enclosing modules are not considered.
|
984
|
+
# the parent's table name. Enclosing modules are not considered.
|
985
|
+
#
|
986
|
+
# ==== Examples
|
904
987
|
#
|
905
988
|
# class Invoice < ActiveRecord::Base; end;
|
906
989
|
# file class table_name
|
@@ -914,8 +997,8 @@ module ActiveRecord #:nodoc:
|
|
914
997
|
# file class table_name
|
915
998
|
# invoice/lineitem.rb Invoice::Lineitem lineitems
|
916
999
|
#
|
917
|
-
# Additionally, the class-level table_name_prefix is prepended and the
|
918
|
-
# table_name_suffix is appended. So if you have "myapp_" as a prefix,
|
1000
|
+
# Additionally, the class-level +table_name_prefix+ is prepended and the
|
1001
|
+
# +table_name_suffix+ is appended. So if you have "myapp_" as a prefix,
|
919
1002
|
# the table name guess for an Invoice class becomes "myapp_invoices".
|
920
1003
|
# Invoice::Lineitem becomes "myapp_invoice_lineitems".
|
921
1004
|
#
|
@@ -957,14 +1040,19 @@ module ActiveRecord #:nodoc:
|
|
957
1040
|
end
|
958
1041
|
|
959
1042
|
def reset_primary_key #:nodoc:
|
1043
|
+
key = get_primary_key(base_class.name)
|
1044
|
+
set_primary_key(key)
|
1045
|
+
key
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
def get_primary_key(base_name) #:nodoc:
|
960
1049
|
key = 'id'
|
961
1050
|
case primary_key_prefix_type
|
962
1051
|
when :table_name
|
963
|
-
key =
|
1052
|
+
key = base_name.to_s.foreign_key(false)
|
964
1053
|
when :table_name_with_underscore
|
965
|
-
key =
|
1054
|
+
key = base_name.to_s.foreign_key
|
966
1055
|
end
|
967
|
-
set_primary_key(key)
|
968
1056
|
key
|
969
1057
|
end
|
970
1058
|
|
@@ -989,8 +1077,6 @@ module ActiveRecord #:nodoc:
|
|
989
1077
|
# Sets the table name to use to the given value, or (if the value
|
990
1078
|
# is nil or false) to the value returned by the given block.
|
991
1079
|
#
|
992
|
-
# Example:
|
993
|
-
#
|
994
1080
|
# class Project < ActiveRecord::Base
|
995
1081
|
# set_table_name "project"
|
996
1082
|
# end
|
@@ -1003,8 +1089,6 @@ module ActiveRecord #:nodoc:
|
|
1003
1089
|
# or (if the value is nil or false) to the value returned by the given
|
1004
1090
|
# block.
|
1005
1091
|
#
|
1006
|
-
# Example:
|
1007
|
-
#
|
1008
1092
|
# class Project < ActiveRecord::Base
|
1009
1093
|
# set_primary_key "sysid"
|
1010
1094
|
# end
|
@@ -1017,8 +1101,6 @@ module ActiveRecord #:nodoc:
|
|
1017
1101
|
# or (if the value # is nil or false) to the value returned by the
|
1018
1102
|
# given block.
|
1019
1103
|
#
|
1020
|
-
# Example:
|
1021
|
-
#
|
1022
1104
|
# class Project < ActiveRecord::Base
|
1023
1105
|
# set_inheritance_column do
|
1024
1106
|
# original_inheritance_column + "_id"
|
@@ -1040,8 +1122,6 @@ module ActiveRecord #:nodoc:
|
|
1040
1122
|
# If a sequence name is not explicitly set when using PostgreSQL, it
|
1041
1123
|
# will discover the sequence corresponding to your primary key for you.
|
1042
1124
|
#
|
1043
|
-
# Example:
|
1044
|
-
#
|
1045
1125
|
# class Project < ActiveRecord::Base
|
1046
1126
|
# set_sequence_name "projectseq" # default would have been "project_seq"
|
1047
1127
|
# end
|
@@ -1060,25 +1140,14 @@ module ActiveRecord #:nodoc:
|
|
1060
1140
|
|
1061
1141
|
# Indicates whether the table associated with this class exists
|
1062
1142
|
def table_exists?
|
1063
|
-
|
1064
|
-
connection.tables.include? table_name
|
1065
|
-
else
|
1066
|
-
# if the connection adapter hasn't implemented tables, there are two crude tests that can be
|
1067
|
-
# used - see if getting column info raises an error, or if the number of columns returned is zero
|
1068
|
-
begin
|
1069
|
-
reset_column_information
|
1070
|
-
columns.size > 0
|
1071
|
-
rescue ActiveRecord::StatementInvalid
|
1072
|
-
false
|
1073
|
-
end
|
1074
|
-
end
|
1143
|
+
connection.table_exists?(table_name)
|
1075
1144
|
end
|
1076
1145
|
|
1077
1146
|
# Returns an array of column objects for the table associated with this class.
|
1078
1147
|
def columns
|
1079
|
-
unless @columns
|
1148
|
+
unless defined?(@columns) && @columns
|
1080
1149
|
@columns = connection.columns(table_name, "#{name} Columns")
|
1081
|
-
@columns.each {|column| column.primary = column.name == primary_key}
|
1150
|
+
@columns.each { |column| column.primary = column.name == primary_key }
|
1082
1151
|
end
|
1083
1152
|
@columns
|
1084
1153
|
end
|
@@ -1176,13 +1245,13 @@ module ActiveRecord #:nodoc:
|
|
1176
1245
|
# project.milestones << Milestone.find(:all)
|
1177
1246
|
# end
|
1178
1247
|
#
|
1179
|
-
# The benchmark is only recorded if the current level of the logger
|
1180
|
-
# easy to include benchmarking statements in production software that will remain inexpensive because
|
1181
|
-
# will only be conducted if the log level is low enough.
|
1248
|
+
# The benchmark is only recorded if the current level of the logger is less than or equal to the <tt>log_level</tt>,
|
1249
|
+
# which makes it easy to include benchmarking statements in production software that will remain inexpensive because
|
1250
|
+
# the benchmark will only be conducted if the log level is low enough.
|
1182
1251
|
#
|
1183
1252
|
# The logging of the multiple statements is turned off unless <tt>use_silence</tt> is set to false.
|
1184
1253
|
def benchmark(title, log_level = Logger::DEBUG, use_silence = true)
|
1185
|
-
if logger && logger.level
|
1254
|
+
if logger && logger.level <= log_level
|
1186
1255
|
result = nil
|
1187
1256
|
seconds = Benchmark.realtime { result = use_silence ? silence { yield } : yield }
|
1188
1257
|
logger.add(log_level, "#{title} (#{'%.5f' % seconds})")
|
@@ -1212,25 +1281,72 @@ module ActiveRecord #:nodoc:
|
|
1212
1281
|
class_of_active_record_descendant(self)
|
1213
1282
|
end
|
1214
1283
|
|
1215
|
-
# Set this to true if this is an abstract class (see
|
1284
|
+
# Set this to true if this is an abstract class (see <tt>abstract_class?</tt>).
|
1216
1285
|
attr_accessor :abstract_class
|
1217
1286
|
|
1218
1287
|
# Returns whether this class is a base AR class. If A is a base class and
|
1219
1288
|
# B descends from A, then B.base_class will return B.
|
1220
1289
|
def abstract_class?
|
1221
|
-
abstract_class == true
|
1290
|
+
defined?(@abstract_class) && @abstract_class == true
|
1291
|
+
end
|
1292
|
+
|
1293
|
+
def respond_to?(method_id, include_private = false)
|
1294
|
+
if match = matches_dynamic_finder?(method_id) || matches_dynamic_finder_with_initialize_or_create?(method_id)
|
1295
|
+
return true if all_attributes_exists?(extract_attribute_names_from_match(match))
|
1296
|
+
end
|
1297
|
+
super
|
1298
|
+
end
|
1299
|
+
|
1300
|
+
def sti_name
|
1301
|
+
store_full_sti_class ? name : name.demodulize
|
1222
1302
|
end
|
1223
1303
|
|
1224
1304
|
private
|
1225
1305
|
def find_initial(options)
|
1226
|
-
options.update(:limit => 1)
|
1306
|
+
options.update(:limit => 1)
|
1227
1307
|
find_every(options).first
|
1228
1308
|
end
|
1229
1309
|
|
1310
|
+
def find_last(options)
|
1311
|
+
order = options[:order]
|
1312
|
+
|
1313
|
+
if order
|
1314
|
+
order = reverse_sql_order(order)
|
1315
|
+
elsif !scoped?(:find, :order)
|
1316
|
+
order = "#{table_name}.#{primary_key} DESC"
|
1317
|
+
end
|
1318
|
+
|
1319
|
+
if scoped?(:find, :order)
|
1320
|
+
scoped_order = reverse_sql_order(scope(:find, :order))
|
1321
|
+
scoped_methods.select { |s| s[:find].update(:order => scoped_order) }
|
1322
|
+
end
|
1323
|
+
|
1324
|
+
find_initial(options.merge({ :order => order }))
|
1325
|
+
end
|
1326
|
+
|
1327
|
+
def reverse_sql_order(order_query)
|
1328
|
+
reversed_query = order_query.split(/,/).each { |s|
|
1329
|
+
if s.match(/\s(asc|ASC)$/)
|
1330
|
+
s.gsub!(/\s(asc|ASC)$/, ' DESC')
|
1331
|
+
elsif s.match(/\s(desc|DESC)$/)
|
1332
|
+
s.gsub!(/\s(desc|DESC)$/, ' ASC')
|
1333
|
+
elsif !s.match(/\s(asc|ASC|desc|DESC)$/)
|
1334
|
+
s.concat(' DESC')
|
1335
|
+
end
|
1336
|
+
}.join(',')
|
1337
|
+
end
|
1338
|
+
|
1230
1339
|
def find_every(options)
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1340
|
+
include_associations = merge_includes(scope(:find, :include), options[:include])
|
1341
|
+
|
1342
|
+
if include_associations.any? && references_eager_loaded_tables?(options)
|
1343
|
+
records = find_with_associations(options)
|
1344
|
+
else
|
1345
|
+
records = find_by_sql(construct_finder_sql(options))
|
1346
|
+
if include_associations.any?
|
1347
|
+
preload_associations(records, include_associations)
|
1348
|
+
end
|
1349
|
+
end
|
1234
1350
|
|
1235
1351
|
records.each { |record| record.readonly! } if options[:readonly]
|
1236
1352
|
|
@@ -1344,12 +1460,16 @@ module ActiveRecord #:nodoc:
|
|
1344
1460
|
# Nest the type name in the same module as this class.
|
1345
1461
|
# Bar is "MyApp::Business::Bar" relative to MyApp::Business::Foo
|
1346
1462
|
def type_name_with_module(type_name)
|
1347
|
-
|
1463
|
+
if store_full_sti_class
|
1464
|
+
type_name
|
1465
|
+
else
|
1466
|
+
(/^::/ =~ type_name) ? type_name : "#{parent.name}::#{type_name}"
|
1467
|
+
end
|
1348
1468
|
end
|
1349
1469
|
|
1350
1470
|
def construct_finder_sql(options)
|
1351
1471
|
scope = scope(:find)
|
1352
|
-
sql = "SELECT #{(scope && scope[:select]) || options[:
|
1472
|
+
sql = "SELECT #{options[:select] || (scope && scope[:select]) || ((options[:joins] || (scope && scope[:joins])) && quoted_table_name + '.*') || '*'} "
|
1353
1473
|
sql << "FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} "
|
1354
1474
|
|
1355
1475
|
add_joins!(sql, options, scope)
|
@@ -1368,6 +1488,20 @@ module ActiveRecord #:nodoc:
|
|
1368
1488
|
(safe_to_array(first) + safe_to_array(second)).uniq
|
1369
1489
|
end
|
1370
1490
|
|
1491
|
+
# Merges conditions so that the result is a valid +condition+
|
1492
|
+
def merge_conditions(*conditions)
|
1493
|
+
segments = []
|
1494
|
+
|
1495
|
+
conditions.each do |condition|
|
1496
|
+
unless condition.blank?
|
1497
|
+
sql = sanitize_sql(condition)
|
1498
|
+
segments << sql unless sql.blank?
|
1499
|
+
end
|
1500
|
+
end
|
1501
|
+
|
1502
|
+
"(#{segments.join(') AND (')})" unless segments.empty?
|
1503
|
+
end
|
1504
|
+
|
1371
1505
|
# Object#to_a is deprecated, though it does have the desired behavior
|
1372
1506
|
def safe_to_array(o)
|
1373
1507
|
case o
|
@@ -1402,7 +1536,7 @@ module ActiveRecord #:nodoc:
|
|
1402
1536
|
end
|
1403
1537
|
end
|
1404
1538
|
|
1405
|
-
# The optional scope argument is for the current
|
1539
|
+
# The optional scope argument is for the current <tt>:find</tt> scope.
|
1406
1540
|
def add_limit!(sql, options, scope = :auto)
|
1407
1541
|
scope = scope(:find) if :auto == scope
|
1408
1542
|
|
@@ -1414,43 +1548,44 @@ module ActiveRecord #:nodoc:
|
|
1414
1548
|
connection.add_limit_offset!(sql, options)
|
1415
1549
|
end
|
1416
1550
|
|
1417
|
-
# The optional scope argument is for the current
|
1418
|
-
# The
|
1551
|
+
# The optional scope argument is for the current <tt>:find</tt> scope.
|
1552
|
+
# The <tt>:lock</tt> option has precedence over a scoped <tt>:lock</tt>.
|
1419
1553
|
def add_lock!(sql, options, scope = :auto)
|
1420
1554
|
scope = scope(:find) if :auto == scope
|
1421
1555
|
options = options.reverse_merge(:lock => scope[:lock]) if scope
|
1422
1556
|
connection.add_lock!(sql, options)
|
1423
1557
|
end
|
1424
1558
|
|
1425
|
-
# The optional scope argument is for the current
|
1559
|
+
# The optional scope argument is for the current <tt>:find</tt> scope.
|
1426
1560
|
def add_joins!(sql, options, scope = :auto)
|
1427
1561
|
scope = scope(:find) if :auto == scope
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1562
|
+
[(scope && scope[:joins]), options[:joins]].each do |join|
|
1563
|
+
case join
|
1564
|
+
when Symbol, Hash, Array
|
1565
|
+
join_dependency = ActiveRecord::Associations::ClassMethods::InnerJoinDependency.new(self, join, nil)
|
1566
|
+
sql << " #{join_dependency.join_associations.collect { |assoc| assoc.association_join }.join} "
|
1567
|
+
else
|
1568
|
+
sql << " #{join} "
|
1569
|
+
end
|
1435
1570
|
end
|
1436
1571
|
end
|
1437
1572
|
|
1438
1573
|
# Adds a sanitized version of +conditions+ to the +sql+ string. Note that the passed-in +sql+ string is changed.
|
1439
|
-
# The optional scope argument is for the current
|
1574
|
+
# The optional scope argument is for the current <tt>:find</tt> scope.
|
1440
1575
|
def add_conditions!(sql, conditions, scope = :auto)
|
1441
1576
|
scope = scope(:find) if :auto == scope
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
sql << "WHERE (#{segments.join(") AND (")}) " unless segments.empty?
|
1577
|
+
conditions = [conditions]
|
1578
|
+
conditions << scope[:conditions] if scope
|
1579
|
+
conditions << type_condition if finder_needs_type_condition?
|
1580
|
+
merged_conditions = merge_conditions(*conditions)
|
1581
|
+
sql << "WHERE #{merged_conditions} " unless merged_conditions.blank?
|
1448
1582
|
end
|
1449
1583
|
|
1450
|
-
def type_condition
|
1584
|
+
def type_condition(table_alias=nil)
|
1585
|
+
quoted_table_alias = self.connection.quote_table_name(table_alias || table_name)
|
1451
1586
|
quoted_inheritance_column = connection.quote_column_name(inheritance_column)
|
1452
|
-
type_condition = subclasses.inject("#{
|
1453
|
-
condition << "OR #{
|
1587
|
+
type_condition = subclasses.inject("#{quoted_table_alias}.#{quoted_inheritance_column} = '#{sti_name}' ") do |condition, subclass|
|
1588
|
+
condition << "OR #{quoted_table_alias}.#{quoted_inheritance_column} = '#{subclass.sti_name}' "
|
1454
1589
|
end
|
1455
1590
|
|
1456
1591
|
" (#{type_condition}) "
|
@@ -1458,8 +1593,8 @@ module ActiveRecord #:nodoc:
|
|
1458
1593
|
|
1459
1594
|
# Guesses the table name, but does not decorate it with prefix and suffix information.
|
1460
1595
|
def undecorated_table_name(class_name = base_class.name)
|
1461
|
-
table_name =
|
1462
|
-
table_name =
|
1596
|
+
table_name = class_name.to_s.demodulize.underscore
|
1597
|
+
table_name = table_name.pluralize if pluralize_table_names
|
1463
1598
|
table_name
|
1464
1599
|
end
|
1465
1600
|
|
@@ -1476,7 +1611,7 @@ module ActiveRecord #:nodoc:
|
|
1476
1611
|
# Each dynamic finder or initializer/creator is also defined in the class after it is first invoked, so that future
|
1477
1612
|
# attempts to use it do not run through method_missing.
|
1478
1613
|
def method_missing(method_id, *arguments)
|
1479
|
-
if match =
|
1614
|
+
if match = matches_dynamic_finder?(method_id)
|
1480
1615
|
finder = determine_finder(match)
|
1481
1616
|
|
1482
1617
|
attribute_names = extract_attribute_names_from_match(match)
|
@@ -1484,7 +1619,7 @@ module ActiveRecord #:nodoc:
|
|
1484
1619
|
|
1485
1620
|
self.class_eval %{
|
1486
1621
|
def self.#{method_id}(*args)
|
1487
|
-
options = args.
|
1622
|
+
options = args.extract_options!
|
1488
1623
|
attributes = construct_attributes_from_arguments([:#{attribute_names.join(',:')}], args)
|
1489
1624
|
finder_options = { :conditions => attributes }
|
1490
1625
|
validate_find_options(options)
|
@@ -1500,14 +1635,17 @@ module ActiveRecord #:nodoc:
|
|
1500
1635
|
end
|
1501
1636
|
}, __FILE__, __LINE__
|
1502
1637
|
send(method_id, *arguments)
|
1503
|
-
elsif match =
|
1638
|
+
elsif match = matches_dynamic_finder_with_initialize_or_create?(method_id)
|
1504
1639
|
instantiator = determine_instantiator(match)
|
1505
1640
|
attribute_names = extract_attribute_names_from_match(match)
|
1506
1641
|
super unless all_attributes_exists?(attribute_names)
|
1507
1642
|
|
1508
1643
|
self.class_eval %{
|
1509
1644
|
def self.#{method_id}(*args)
|
1645
|
+
guard_protected_attributes = false
|
1646
|
+
|
1510
1647
|
if args[0].is_a?(Hash)
|
1648
|
+
guard_protected_attributes = true
|
1511
1649
|
attributes = args[0].with_indifferent_access
|
1512
1650
|
find_attributes = attributes.slice(*[:#{attribute_names.join(',:')}])
|
1513
1651
|
else
|
@@ -1518,8 +1656,10 @@ module ActiveRecord #:nodoc:
|
|
1518
1656
|
set_readonly_option!(options)
|
1519
1657
|
|
1520
1658
|
record = find_initial(options)
|
1521
|
-
|
1522
|
-
|
1659
|
+
|
1660
|
+
if record.nil?
|
1661
|
+
record = self.new { |r| r.send(:attributes=, attributes, guard_protected_attributes) }
|
1662
|
+
#{'yield(record) if block_given?'}
|
1523
1663
|
#{'record.save' if instantiator == :create}
|
1524
1664
|
record
|
1525
1665
|
else
|
@@ -1533,6 +1673,14 @@ module ActiveRecord #:nodoc:
|
|
1533
1673
|
end
|
1534
1674
|
end
|
1535
1675
|
|
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
|
+
|
1536
1684
|
def determine_finder(match)
|
1537
1685
|
match.captures.first == 'all_by' ? :find_every : :find_initial
|
1538
1686
|
end
|
@@ -1551,14 +1699,30 @@ module ActiveRecord #:nodoc:
|
|
1551
1699
|
attributes
|
1552
1700
|
end
|
1553
1701
|
|
1702
|
+
# Similar in purpose to +expand_hash_conditions_for_aggregates+.
|
1703
|
+
def expand_attribute_names_for_aggregates(attribute_names)
|
1704
|
+
expanded_attribute_names = []
|
1705
|
+
attribute_names.each do |attribute_name|
|
1706
|
+
unless (aggregation = reflect_on_aggregation(attribute_name.to_sym)).nil?
|
1707
|
+
aggregate_mapping(aggregation).each do |field_attr, aggregate_attr|
|
1708
|
+
expanded_attribute_names << field_attr
|
1709
|
+
end
|
1710
|
+
else
|
1711
|
+
expanded_attribute_names << attribute_name
|
1712
|
+
end
|
1713
|
+
end
|
1714
|
+
expanded_attribute_names
|
1715
|
+
end
|
1716
|
+
|
1554
1717
|
def all_attributes_exists?(attribute_names)
|
1718
|
+
attribute_names = expand_attribute_names_for_aggregates(attribute_names)
|
1555
1719
|
attribute_names.all? { |name| column_methods_hash.include?(name.to_sym) }
|
1556
1720
|
end
|
1557
1721
|
|
1558
1722
|
def attribute_condition(argument)
|
1559
1723
|
case argument
|
1560
1724
|
when nil then "IS ?"
|
1561
|
-
when Array, ActiveRecord::Associations::AssociationCollection then "IN (?)"
|
1725
|
+
when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope then "IN (?)"
|
1562
1726
|
when Range then "BETWEEN ? AND ?"
|
1563
1727
|
else "= ?"
|
1564
1728
|
end
|
@@ -1573,8 +1737,8 @@ module ActiveRecord #:nodoc:
|
|
1573
1737
|
end
|
1574
1738
|
|
1575
1739
|
|
1576
|
-
# Defines an "attribute" method (like
|
1577
|
-
#
|
1740
|
+
# Defines an "attribute" method (like +inheritance_column+ or
|
1741
|
+
# +table_name+). A new (class) method will be created with the
|
1578
1742
|
# given name. If a value is specified, the new method will
|
1579
1743
|
# return that value (as a string). Otherwise, the given block
|
1580
1744
|
# will be used to compute the value of the method.
|
@@ -1605,8 +1769,8 @@ module ActiveRecord #:nodoc:
|
|
1605
1769
|
|
1606
1770
|
protected
|
1607
1771
|
# Scope parameters to method calls within the block. Takes a hash of method_name => parameters hash.
|
1608
|
-
# method_name may be
|
1609
|
-
# <tt>:include</tt>, <tt>:offset</tt>, <tt>:limit</tt>, and <tt>:readonly</tt> options.
|
1772
|
+
# method_name may be <tt>:find</tt> or <tt>:create</tt>. <tt>:find</tt> parameters may include the <tt>:conditions</tt>, <tt>:joins</tt>,
|
1773
|
+
# <tt>:include</tt>, <tt>:offset</tt>, <tt>:limit</tt>, and <tt>:readonly</tt> options. <tt>:create</tt> parameters are an attributes hash.
|
1610
1774
|
#
|
1611
1775
|
# class Article < ActiveRecord::Base
|
1612
1776
|
# def self.create_with_scope
|
@@ -1619,12 +1783,12 @@ module ActiveRecord #:nodoc:
|
|
1619
1783
|
# end
|
1620
1784
|
#
|
1621
1785
|
# In nested scopings, all previous parameters are overwritten by the innermost rule, with the exception of
|
1622
|
-
#
|
1786
|
+
# <tt>:conditions</tt> and <tt>:include</tt> options in <tt>:find</tt>, which are merged.
|
1623
1787
|
#
|
1624
1788
|
# class Article < ActiveRecord::Base
|
1625
1789
|
# def self.find_with_scope
|
1626
1790
|
# with_scope(:find => { :conditions => "blog_id = 1", :limit => 1 }, :create => { :blog_id => 1 }) do
|
1627
|
-
# with_scope(:find => { :limit => 10})
|
1791
|
+
# with_scope(:find => { :limit => 10 })
|
1628
1792
|
# find(:all) # => SELECT * from articles WHERE blog_id = 1 LIMIT 10
|
1629
1793
|
# end
|
1630
1794
|
# with_scope(:find => { :conditions => "author_id = 3" })
|
@@ -1670,7 +1834,7 @@ module ActiveRecord #:nodoc:
|
|
1670
1834
|
(hash[method].keys + params.keys).uniq.each do |key|
|
1671
1835
|
merge = hash[method][key] && params[key] # merge if both scopes have the same key
|
1672
1836
|
if key == :conditions && merge
|
1673
|
-
hash[method][key] =
|
1837
|
+
hash[method][key] = merge_conditions(params[key], hash[method][key])
|
1674
1838
|
elsif key == :include && merge
|
1675
1839
|
hash[method][key] = merge_includes(hash[method][key], params[key]).uniq
|
1676
1840
|
else
|
@@ -1751,7 +1915,7 @@ module ActiveRecord #:nodoc:
|
|
1751
1915
|
end
|
1752
1916
|
end
|
1753
1917
|
|
1754
|
-
# Returns the class descending directly from
|
1918
|
+
# Returns the class descending directly from Active Record in the inheritance hierarchy.
|
1755
1919
|
def class_of_active_record_descendant(klass)
|
1756
1920
|
if klass.superclass == Base || klass.superclass.abstract_class?
|
1757
1921
|
klass
|
@@ -1762,17 +1926,19 @@ module ActiveRecord #:nodoc:
|
|
1762
1926
|
end
|
1763
1927
|
end
|
1764
1928
|
|
1765
|
-
# Returns the name of the class descending directly from
|
1929
|
+
# Returns the name of the class descending directly from Active Record in the inheritance hierarchy.
|
1766
1930
|
def class_name_of_active_record_descendant(klass) #:nodoc:
|
1767
1931
|
klass.base_class.name
|
1768
1932
|
end
|
1769
1933
|
|
1770
|
-
# Accepts an array, hash, or string of
|
1934
|
+
# Accepts an array, hash, or string of SQL conditions and sanitizes
|
1771
1935
|
# them into a valid SQL fragment for a WHERE clause.
|
1772
1936
|
# ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
|
1773
1937
|
# { :name => "foo'bar", :group_id => 4 } returns "name='foo''bar' and group_id='4'"
|
1774
1938
|
# "name='foo''bar' and group_id='4'" returns "name='foo''bar' and group_id='4'"
|
1775
1939
|
def sanitize_sql_for_conditions(condition)
|
1940
|
+
return nil if condition.blank?
|
1941
|
+
|
1776
1942
|
case condition
|
1777
1943
|
when Array; sanitize_sql_array(condition)
|
1778
1944
|
when Hash; sanitize_sql_hash_for_conditions(condition)
|
@@ -1781,7 +1947,7 @@ module ActiveRecord #:nodoc:
|
|
1781
1947
|
end
|
1782
1948
|
alias_method :sanitize_sql, :sanitize_sql_for_conditions
|
1783
1949
|
|
1784
|
-
# Accepts an array, hash, or string of
|
1950
|
+
# Accepts an array, hash, or string of SQL conditions and sanitizes
|
1785
1951
|
# them into a valid SQL fragment for a SET clause.
|
1786
1952
|
# { :name => nil, :group_id => 4 } returns "name = NULL , group_id='4'"
|
1787
1953
|
def sanitize_sql_for_assignment(assignments)
|
@@ -1792,6 +1958,41 @@ module ActiveRecord #:nodoc:
|
|
1792
1958
|
end
|
1793
1959
|
end
|
1794
1960
|
|
1961
|
+
def aggregate_mapping(reflection)
|
1962
|
+
mapping = reflection.options[:mapping] || [reflection.name, reflection.name]
|
1963
|
+
mapping.first.is_a?(Array) ? mapping : [mapping]
|
1964
|
+
end
|
1965
|
+
|
1966
|
+
# Accepts a hash of SQL conditions and replaces those attributes
|
1967
|
+
# that correspond to a +composed_of+ relationship with their expanded
|
1968
|
+
# aggregate attribute values.
|
1969
|
+
# Given:
|
1970
|
+
# class Person < ActiveRecord::Base
|
1971
|
+
# composed_of :address, :class_name => "Address",
|
1972
|
+
# :mapping => [%w(address_street street), %w(address_city city)]
|
1973
|
+
# end
|
1974
|
+
# Then:
|
1975
|
+
# { :address => Address.new("813 abc st.", "chicago") }
|
1976
|
+
# # => { :address_street => "813 abc st.", :address_city => "chicago" }
|
1977
|
+
def expand_hash_conditions_for_aggregates(attrs)
|
1978
|
+
expanded_attrs = {}
|
1979
|
+
attrs.each do |attr, value|
|
1980
|
+
unless (aggregation = reflect_on_aggregation(attr.to_sym)).nil?
|
1981
|
+
mapping = aggregate_mapping(aggregation)
|
1982
|
+
mapping.each do |field_attr, aggregate_attr|
|
1983
|
+
if mapping.size == 1 && !value.respond_to?(aggregate_attr)
|
1984
|
+
expanded_attrs[field_attr] = value
|
1985
|
+
else
|
1986
|
+
expanded_attrs[field_attr] = value.send(aggregate_attr)
|
1987
|
+
end
|
1988
|
+
end
|
1989
|
+
else
|
1990
|
+
expanded_attrs[attr] = value
|
1991
|
+
end
|
1992
|
+
end
|
1993
|
+
expanded_attrs
|
1994
|
+
end
|
1995
|
+
|
1795
1996
|
# Sanitizes a hash of attribute/value pairs into SQL conditions for a WHERE clause.
|
1796
1997
|
# { :name => "foo'bar", :group_id => 4 }
|
1797
1998
|
# # => "name='foo''bar' and group_id= 4"
|
@@ -1801,7 +2002,12 @@ module ActiveRecord #:nodoc:
|
|
1801
2002
|
# # => "age BETWEEN 13 AND 18"
|
1802
2003
|
# { 'other_records.id' => 7 }
|
1803
2004
|
# # => "`other_records`.`id` = 7"
|
2005
|
+
# And for value objects on a composed_of relationship:
|
2006
|
+
# { :address => Address.new("123 abc st.", "chicago") }
|
2007
|
+
# # => "address_street='123 abc st.' and address_city='chicago'"
|
1804
2008
|
def sanitize_sql_hash_for_conditions(attrs)
|
2009
|
+
attrs = expand_hash_conditions_for_aggregates(attrs)
|
2010
|
+
|
1805
2011
|
conditions = attrs.map do |attr, value|
|
1806
2012
|
attr = attr.to_s
|
1807
2013
|
|
@@ -1824,13 +2030,13 @@ module ActiveRecord #:nodoc:
|
|
1824
2030
|
# { :status => nil, :group_id => 1 }
|
1825
2031
|
# # => "status = NULL , group_id = 1"
|
1826
2032
|
def sanitize_sql_hash_for_assignment(attrs)
|
1827
|
-
|
2033
|
+
attrs.map do |attr, value|
|
1828
2034
|
"#{connection.quote_column_name(attr)} = #{quote_bound_value(value)}"
|
1829
2035
|
end.join(', ')
|
1830
2036
|
end
|
1831
2037
|
|
1832
2038
|
# Accepts an array of conditions. The array has each value
|
1833
|
-
# sanitized and interpolated into the
|
2039
|
+
# sanitized and interpolated into the SQL statement.
|
1834
2040
|
# ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
|
1835
2041
|
def sanitize_sql_array(ary)
|
1836
2042
|
statement, *values = ary
|
@@ -1852,9 +2058,10 @@ module ActiveRecord #:nodoc:
|
|
1852
2058
|
end
|
1853
2059
|
|
1854
2060
|
def replace_named_bind_variables(statement, bind_vars) #:nodoc:
|
1855
|
-
statement.gsub(
|
1856
|
-
|
1857
|
-
|
2061
|
+
statement.gsub(/(:?):([a-zA-Z]\w*)/) do
|
2062
|
+
if $1 == ':' # skip postgresql casts
|
2063
|
+
$& # return the whole match
|
2064
|
+
elsif bind_vars.include?(match = $2.to_sym)
|
1858
2065
|
quote_bound_value(bind_vars[match])
|
1859
2066
|
else
|
1860
2067
|
raise PreparedStatementInvalid, "missing value for :#{match} in #{statement}"
|
@@ -1863,14 +2070,22 @@ module ActiveRecord #:nodoc:
|
|
1863
2070
|
end
|
1864
2071
|
|
1865
2072
|
def expand_range_bind_variables(bind_vars) #:nodoc:
|
1866
|
-
|
1867
|
-
|
2073
|
+
expanded = []
|
2074
|
+
|
2075
|
+
bind_vars.each do |var|
|
2076
|
+
if var.is_a?(Range)
|
2077
|
+
expanded << var.first
|
2078
|
+
expanded << var.last
|
2079
|
+
else
|
2080
|
+
expanded << var
|
2081
|
+
end
|
1868
2082
|
end
|
1869
|
-
|
2083
|
+
|
2084
|
+
expanded
|
1870
2085
|
end
|
1871
2086
|
|
1872
2087
|
def quote_bound_value(value) #:nodoc:
|
1873
|
-
if value.respond_to?(:map) && !value.is_a?(String)
|
2088
|
+
if value.respond_to?(:map) && !value.is_a?(String) && !value.is_a?(ActiveSupport::Multibyte::Chars)
|
1874
2089
|
if value.respond_to?(:empty?) && value.empty?
|
1875
2090
|
connection.quote(nil)
|
1876
2091
|
else
|
@@ -1948,6 +2163,24 @@ module ActiveRecord #:nodoc:
|
|
1948
2163
|
(id = self.id) ? id.to_s : nil # Be sure to stringify the id for routes
|
1949
2164
|
end
|
1950
2165
|
|
2166
|
+
# Returns a cache key that can be used to identify this record.
|
2167
|
+
#
|
2168
|
+
# ==== Examples
|
2169
|
+
#
|
2170
|
+
# Product.new.cache_key # => "products/new"
|
2171
|
+
# Product.find(5).cache_key # => "products/5" (updated_at not available)
|
2172
|
+
# Person.find(5).cache_key # => "people/5-20071224150000" (updated_at available)
|
2173
|
+
def cache_key
|
2174
|
+
case
|
2175
|
+
when new_record?
|
2176
|
+
"#{self.class.name.tableize}/new"
|
2177
|
+
when self[:updated_at]
|
2178
|
+
"#{self.class.name.tableize}/#{id}-#{updated_at.to_s(:number)}"
|
2179
|
+
else
|
2180
|
+
"#{self.class.name.tableize}/#{id}"
|
2181
|
+
end
|
2182
|
+
end
|
2183
|
+
|
1951
2184
|
def id_before_type_cast #:nodoc:
|
1952
2185
|
read_attribute_before_type_cast(self.class.primary_key)
|
1953
2186
|
end
|
@@ -1963,11 +2196,17 @@ module ActiveRecord #:nodoc:
|
|
1963
2196
|
|
1964
2197
|
# Returns true if this object hasn't been saved yet -- that is, a record for the object doesn't exist yet.
|
1965
2198
|
def new_record?
|
1966
|
-
@new_record
|
2199
|
+
defined?(@new_record) && @new_record
|
1967
2200
|
end
|
1968
2201
|
|
1969
2202
|
# * No record exists: Creates a new record with values matching those of the object attributes.
|
1970
2203
|
# * A record does exist: Updates the record with values matching those of the object attributes.
|
2204
|
+
#
|
2205
|
+
# Note: If your model specifies any validations then the method declaration dynamically
|
2206
|
+
# changes to:
|
2207
|
+
# save(perform_validation=true)
|
2208
|
+
# Calling save(false) saves the model without running validations.
|
2209
|
+
# See ActiveRecord::Validations for more information.
|
1971
2210
|
def save
|
1972
2211
|
create_or_update
|
1973
2212
|
end
|
@@ -1997,16 +2236,16 @@ module ActiveRecord #:nodoc:
|
|
1997
2236
|
# The extent of a "deep" clone is application-specific and is therefore
|
1998
2237
|
# left to the application to implement according to its need.
|
1999
2238
|
def clone
|
2000
|
-
attrs =
|
2239
|
+
attrs = clone_attributes(:read_attribute_before_type_cast)
|
2001
2240
|
attrs.delete(self.class.primary_key)
|
2002
2241
|
record = self.class.new
|
2003
2242
|
record.send :instance_variable_set, '@attributes', attrs
|
2004
2243
|
record
|
2005
2244
|
end
|
2006
2245
|
|
2007
|
-
# Returns an instance of the specified klass with the attributes of the current record. This is mostly useful in relation to
|
2246
|
+
# Returns an instance of the specified +klass+ with the attributes of the current record. This is mostly useful in relation to
|
2008
2247
|
# single-table inheritance structures where you want a subclass to appear as the superclass. This can be used along with record
|
2009
|
-
# identification in Action Pack to allow, say, Client < Company to do something like render
|
2248
|
+
# identification in Action Pack to allow, say, <tt>Client < Company</tt> to do something like render <tt>:partial => @client.becomes(Company)</tt>
|
2010
2249
|
# to render that instance using the companies/company partial instead of clients/client.
|
2011
2250
|
#
|
2012
2251
|
# Note: The new instance will share a link to the same attributes as the original class. So any change to the attributes in either
|
@@ -2040,37 +2279,53 @@ module ActiveRecord #:nodoc:
|
|
2040
2279
|
save!
|
2041
2280
|
end
|
2042
2281
|
|
2043
|
-
# Initializes
|
2044
|
-
|
2282
|
+
# Initializes +attribute+ to zero if +nil+ and adds the value passed as +by+ (default is 1).
|
2283
|
+
# The increment is performed directly on the underlying attribute, no setter is invoked.
|
2284
|
+
# Only makes sense for number-based attributes. Returns +self+.
|
2285
|
+
def increment(attribute, by = 1)
|
2045
2286
|
self[attribute] ||= 0
|
2046
|
-
self[attribute] +=
|
2287
|
+
self[attribute] += by
|
2047
2288
|
self
|
2048
2289
|
end
|
2049
2290
|
|
2050
|
-
#
|
2051
|
-
|
2052
|
-
|
2291
|
+
# Wrapper around +increment+ that saves the record. This method differs from
|
2292
|
+
# its non-bang version in that it passes through the attribute setter.
|
2293
|
+
# Saving is not subjected to validation checks. Returns +true+ if the
|
2294
|
+
# record could be saved.
|
2295
|
+
def increment!(attribute, by = 1)
|
2296
|
+
increment(attribute, by).update_attribute(attribute, self[attribute])
|
2053
2297
|
end
|
2054
2298
|
|
2055
|
-
# Initializes
|
2056
|
-
|
2299
|
+
# Initializes +attribute+ to zero if +nil+ and subtracts the value passed as +by+ (default is 1).
|
2300
|
+
# The decrement is performed directly on the underlying attribute, no setter is invoked.
|
2301
|
+
# Only makes sense for number-based attributes. Returns +self+.
|
2302
|
+
def decrement(attribute, by = 1)
|
2057
2303
|
self[attribute] ||= 0
|
2058
|
-
self[attribute] -=
|
2304
|
+
self[attribute] -= by
|
2059
2305
|
self
|
2060
2306
|
end
|
2061
2307
|
|
2062
|
-
#
|
2063
|
-
|
2064
|
-
|
2308
|
+
# Wrapper around +decrement+ that saves the record. This method differs from
|
2309
|
+
# its non-bang version in that it passes through the attribute setter.
|
2310
|
+
# Saving is not subjected to validation checks. Returns +true+ if the
|
2311
|
+
# record could be saved.
|
2312
|
+
def decrement!(attribute, by = 1)
|
2313
|
+
decrement(attribute, by).update_attribute(attribute, self[attribute])
|
2065
2314
|
end
|
2066
2315
|
|
2067
|
-
#
|
2316
|
+
# Assigns to +attribute+ the boolean opposite of <tt>attribute?</tt>. So
|
2317
|
+
# if the predicate returns +true+ the attribute will become +false+. This
|
2318
|
+
# method toggles directly the underlying value without calling any setter.
|
2319
|
+
# Returns +self+.
|
2068
2320
|
def toggle(attribute)
|
2069
2321
|
self[attribute] = !send("#{attribute}?")
|
2070
2322
|
self
|
2071
2323
|
end
|
2072
2324
|
|
2073
|
-
#
|
2325
|
+
# Wrapper around +toggle+ that saves the record. This method differs from
|
2326
|
+
# its non-bang version in that it passes through the attribute setter.
|
2327
|
+
# Saving is not subjected to validation checks. Returns +true+ if the
|
2328
|
+
# record could be saved.
|
2074
2329
|
def toggle!(attribute)
|
2075
2330
|
toggle(attribute).update_attribute(attribute, self[attribute])
|
2076
2331
|
end
|
@@ -2121,30 +2376,20 @@ module ActiveRecord #:nodoc:
|
|
2121
2376
|
end
|
2122
2377
|
|
2123
2378
|
|
2124
|
-
# Returns a hash of all the attributes with their names as keys and
|
2125
|
-
def attributes
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
attributes
|
2130
|
-
else
|
2131
|
-
if except = options[:except]
|
2132
|
-
except = Array(except).collect { |attribute| attribute.to_s }
|
2133
|
-
except.each { |attribute_name| attributes.delete(attribute_name) }
|
2134
|
-
attributes
|
2135
|
-
elsif only = options[:only]
|
2136
|
-
only = Array(only).collect { |attribute| attribute.to_s }
|
2137
|
-
attributes.delete_if { |key, value| !only.include?(key) }
|
2138
|
-
attributes
|
2139
|
-
else
|
2140
|
-
raise ArgumentError, "Options does not specify :except or :only (#{options.keys.inspect})"
|
2141
|
-
end
|
2379
|
+
# Returns a hash of all the attributes with their names as keys and the values of the attributes as values.
|
2380
|
+
def attributes
|
2381
|
+
self.attribute_names.inject({}) do |attrs, name|
|
2382
|
+
attrs[name] = read_attribute(name)
|
2383
|
+
attrs
|
2142
2384
|
end
|
2143
2385
|
end
|
2144
2386
|
|
2145
|
-
# Returns a hash of
|
2387
|
+
# Returns a hash of attributes before typecasting and deserialization.
|
2146
2388
|
def attributes_before_type_cast
|
2147
|
-
|
2389
|
+
self.attribute_names.inject({}) do |attrs, name|
|
2390
|
+
attrs[name] = read_attribute_before_type_cast(name)
|
2391
|
+
attrs
|
2392
|
+
end
|
2148
2393
|
end
|
2149
2394
|
|
2150
2395
|
# Format attributes nicely for inspect.
|
@@ -2214,7 +2459,7 @@ module ActiveRecord #:nodoc:
|
|
2214
2459
|
# Returns +true+ if the record is read only. Records loaded through joins with piggy-back
|
2215
2460
|
# attributes will be marked as read only since they cannot be saved.
|
2216
2461
|
def readonly?
|
2217
|
-
@readonly == true
|
2462
|
+
defined?(@readonly) && @readonly == true
|
2218
2463
|
end
|
2219
2464
|
|
2220
2465
|
# Marks this record as read only.
|
@@ -2241,8 +2486,8 @@ module ActiveRecord #:nodoc:
|
|
2241
2486
|
|
2242
2487
|
# Updates the associated record with values matching those of the instance attributes.
|
2243
2488
|
# Returns the number of affected rows.
|
2244
|
-
def update
|
2245
|
-
quoted_attributes = attributes_with_quotes(false, false)
|
2489
|
+
def update(attribute_names = @attributes.keys)
|
2490
|
+
quoted_attributes = attributes_with_quotes(false, false, attribute_names)
|
2246
2491
|
return 0 if quoted_attributes.empty?
|
2247
2492
|
connection.update(
|
2248
2493
|
"UPDATE #{self.class.quoted_table_name} " +
|
@@ -2276,13 +2521,13 @@ module ActiveRecord #:nodoc:
|
|
2276
2521
|
id
|
2277
2522
|
end
|
2278
2523
|
|
2279
|
-
# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord descendent.
|
2280
|
-
# Considering the hierarchy Reply < Message < ActiveRecord, this makes it possible to do Reply.new without having to
|
2281
|
-
# set Reply[Reply.inheritance_column] = "Reply" yourself. No such attribute would be set for objects of the
|
2524
|
+
# Sets the attribute used for single table inheritance to this class name if this is not the ActiveRecord::Base descendent.
|
2525
|
+
# Considering the hierarchy Reply < Message < ActiveRecord::Base, this makes it possible to do Reply.new without having to
|
2526
|
+
# set <tt>Reply[Reply.inheritance_column] = "Reply"</tt> yourself. No such attribute would be set for objects of the
|
2282
2527
|
# Message class in that example.
|
2283
2528
|
def ensure_proper_type
|
2284
2529
|
unless self.class.descends_from_active_record?
|
2285
|
-
write_attribute(self.class.inheritance_column,
|
2530
|
+
write_attribute(self.class.inheritance_column, self.class.sti_name)
|
2286
2531
|
end
|
2287
2532
|
end
|
2288
2533
|
|
@@ -2334,12 +2579,20 @@ module ActiveRecord #:nodoc:
|
|
2334
2579
|
|
2335
2580
|
# Returns a copy of the attributes hash where all the values have been safely quoted for use in
|
2336
2581
|
# an SQL statement.
|
2337
|
-
def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true)
|
2338
|
-
quoted =
|
2339
|
-
|
2340
|
-
|
2582
|
+
def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys)
|
2583
|
+
quoted = {}
|
2584
|
+
connection = self.class.connection
|
2585
|
+
attribute_names.each do |name|
|
2586
|
+
if (column = column_for_attribute(name)) && (include_primary_key || !column.primary)
|
2587
|
+
value = read_attribute(name)
|
2588
|
+
|
2589
|
+
# We need explicit to_yaml because quote() does not properly convert Time/Date fields to YAML.
|
2590
|
+
if value && self.class.serialized_attributes.has_key?(name) && (value.acts_like?(:date) || value.acts_like?(:time))
|
2591
|
+
value = value.to_yaml
|
2592
|
+
end
|
2593
|
+
|
2594
|
+
quoted[name] = connection.quote(value, column)
|
2341
2595
|
end
|
2342
|
-
quoted
|
2343
2596
|
end
|
2344
2597
|
include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
|
2345
2598
|
end
|
@@ -2349,7 +2602,7 @@ module ActiveRecord #:nodoc:
|
|
2349
2602
|
self.class.connection.quote(value, column)
|
2350
2603
|
end
|
2351
2604
|
|
2352
|
-
# Interpolate custom
|
2605
|
+
# Interpolate custom SQL string in instance context.
|
2353
2606
|
# Optional record argument is meant for custom insert_sql.
|
2354
2607
|
def interpolate_sql(sql, record = nil)
|
2355
2608
|
instance_eval("%@#{sql.gsub('@', '\@')}@")
|
@@ -2378,7 +2631,14 @@ module ActiveRecord #:nodoc:
|
|
2378
2631
|
)
|
2379
2632
|
end
|
2380
2633
|
|
2381
|
-
|
2634
|
+
def instantiate_time_object(name, values)
|
2635
|
+
if self.class.send(:create_time_zone_conversion_attribute?, name, column_for_attribute(name))
|
2636
|
+
Time.zone.local(*values)
|
2637
|
+
else
|
2638
|
+
Time.time_with_datetime_fallback(@@default_timezone, *values)
|
2639
|
+
end
|
2640
|
+
end
|
2641
|
+
|
2382
2642
|
def execute_callstack_for_multiparameter_attributes(callstack)
|
2383
2643
|
errors = []
|
2384
2644
|
callstack.each do |name, values|
|
@@ -2387,7 +2647,19 @@ module ActiveRecord #:nodoc:
|
|
2387
2647
|
send(name + "=", nil)
|
2388
2648
|
else
|
2389
2649
|
begin
|
2390
|
-
|
2650
|
+
value = if Time == klass
|
2651
|
+
instantiate_time_object(name, values)
|
2652
|
+
elsif Date == klass
|
2653
|
+
begin
|
2654
|
+
Date.new(*values)
|
2655
|
+
rescue ArgumentError => ex # if Date.new raises an exception on an invalid date
|
2656
|
+
instantiate_time_object(name, values).to_date # we instantiate Time object and convert it back to a date thus using Time's logic in handling invalid dates
|
2657
|
+
end
|
2658
|
+
else
|
2659
|
+
klass.new(*values)
|
2660
|
+
end
|
2661
|
+
|
2662
|
+
send(name + "=", value)
|
2391
2663
|
rescue => ex
|
2392
2664
|
errors << AttributeAssignmentError.new("error on assignment #{values.inspect} to #{name}", ex, name)
|
2393
2665
|
end
|
@@ -2429,8 +2701,9 @@ module ActiveRecord #:nodoc:
|
|
2429
2701
|
end
|
2430
2702
|
|
2431
2703
|
def quoted_column_names(attributes = attributes_with_quotes)
|
2704
|
+
connection = self.class.connection
|
2432
2705
|
attributes.keys.collect do |column_name|
|
2433
|
-
|
2706
|
+
connection.quote_column_name(column_name)
|
2434
2707
|
end
|
2435
2708
|
end
|
2436
2709
|
|
@@ -2455,9 +2728,9 @@ module ActiveRecord #:nodoc:
|
|
2455
2728
|
end
|
2456
2729
|
|
2457
2730
|
def clone_attributes(reader_method = :read_attribute, attributes = {})
|
2458
|
-
self.attribute_names.inject(attributes) do |
|
2459
|
-
|
2460
|
-
|
2731
|
+
self.attribute_names.inject(attributes) do |attrs, name|
|
2732
|
+
attrs[name] = clone_attribute_value(reader_method, name)
|
2733
|
+
attrs
|
2461
2734
|
end
|
2462
2735
|
end
|
2463
2736
|
|