railscart 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/License.txt +26 -0
- data/Manifest.txt +462 -0
- data/README.txt +1 -0
- data/Rakefile +4 -0
- data/bin/railscart +114 -0
- data/config/hoe.rb +78 -0
- data/config/requirements.rb +19 -0
- data/lib/railscart.rb +5 -0
- data/lib/railscart/version.rb +9 -0
- data/log/debug.log +0 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/starter-app/README +182 -0
- data/starter-app/Rakefile +10 -0
- data/starter-app/app/controllers/application.rb +14 -0
- data/starter-app/app/helpers/application_helper.rb +3 -0
- data/starter-app/app/models/role.rb +3 -0
- data/starter-app/app/models/tag.rb +37 -0
- data/starter-app/app/models/tagging.rb +16 -0
- data/starter-app/app/models/user.rb +101 -0
- data/starter-app/app/views/layouts/application.rhtml +20 -0
- data/starter-app/config/boot.rb +45 -0
- data/starter-app/config/database.yml +23 -0
- data/starter-app/config/environment.rb +119 -0
- data/starter-app/config/environments/development.rb +21 -0
- data/starter-app/config/environments/production.rb +21 -0
- data/starter-app/config/environments/test.rb +19 -0
- data/starter-app/config/routes.rb +28 -0
- data/starter-app/db/migrate/001_add_sessions.rb +16 -0
- data/starter-app/db/migrate/002_create_tags_and_taggings.rb +28 -0
- data/starter-app/db/migrate/003_railscart_to_version_19.rb +9 -0
- data/starter-app/db/migrate/004_railscart_to_version_20.rb +9 -0
- data/starter-app/db/migrate/005_create_users.rb +17 -0
- data/starter-app/db/migrate/006_create_roles.rb +20 -0
- data/starter-app/db/sample/addresses.yml +29 -0
- data/starter-app/db/sample/categories.yml +35 -0
- data/starter-app/db/sample/countries.yml +4 -0
- data/starter-app/db/sample/line_items.yml +32 -0
- data/starter-app/db/sample/option_groups.yml +16 -0
- data/starter-app/db/sample/option_values.yml +13 -0
- data/starter-app/db/sample/options.yml +3 -0
- data/starter-app/db/sample/orders.yml +17 -0
- data/starter-app/db/sample/products.yml +70 -0
- data/starter-app/db/sample/roles.yml +3 -0
- data/starter-app/db/sample/skus.yml +35 -0
- data/starter-app/db/sample/states.yml +204 -0
- data/starter-app/db/sample/taggings.yml +16 -0
- data/starter-app/db/sample/tags.yml +6 -0
- data/starter-app/db/sample/txns.yml +13 -0
- data/starter-app/db/sample/users.yml +10 -0
- data/starter-app/db/sample/variations.yml +20 -0
- data/starter-app/doc/README_FOR_APP +2 -0
- data/starter-app/lib/authenticated_system.rb +116 -0
- data/starter-app/lib/authenticated_test_helper.rb +10 -0
- data/starter-app/lib/custom_fixtures.rb +7 -0
- data/starter-app/lib/hijacker.rb +78 -0
- data/starter-app/lib/role_requirement_system.rb +142 -0
- data/starter-app/lib/role_requirement_test_helper.rb +86 -0
- data/starter-app/lib/tagging_extensions.rb +104 -0
- data/starter-app/lib/tasks/rc_sample_data.rake +31 -0
- data/starter-app/lib/tasks/sample/images/ror_bag.jpg +0 -0
- data/starter-app/lib/tasks/sample/images/ror_baseball_jersey.jpg +0 -0
- data/starter-app/lib/tasks/sample/images/ror_jr_spaghetti.jpg +0 -0
- data/starter-app/lib/tasks/sample/images/ror_mug.jpg +0 -0
- data/starter-app/lib/tasks/sample/images/ror_ringer_tshirt.jpg +0 -0
- data/starter-app/lib/tasks/sample/images/ror_stein.jpg +0 -0
- data/starter-app/lib/tasks/sample/images/ror_tote.jpg +0 -0
- data/starter-app/public/.htaccess +40 -0
- data/starter-app/public/404.html +30 -0
- data/starter-app/public/500.html +30 -0
- data/starter-app/public/dispatch.cgi +10 -0
- data/starter-app/public/dispatch.fcgi +24 -0
- data/starter-app/public/dispatch.rb +10 -0
- data/starter-app/public/favicon.ico +0 -0
- data/starter-app/public/images/rails.png +0 -0
- data/starter-app/public/index.html +277 -0
- data/starter-app/public/javascripts/application.js +2 -0
- data/starter-app/public/javascripts/controls.js +833 -0
- data/starter-app/public/javascripts/dragdrop.js +942 -0
- data/starter-app/public/javascripts/effects.js +1088 -0
- data/starter-app/public/javascripts/prototype.js +4184 -0
- data/starter-app/public/robots.txt +1 -0
- data/starter-app/public/stylesheets/application.css +186 -0
- data/starter-app/public/stylesheets/cart/_controller.css +4 -0
- data/starter-app/public/stylesheets/checkout/_controller.css +13 -0
- data/starter-app/script/about +3 -0
- data/starter-app/script/breakpointer +3 -0
- data/starter-app/script/console +3 -0
- data/starter-app/script/destroy +3 -0
- data/starter-app/script/generate +3 -0
- data/starter-app/script/performance/benchmarker +3 -0
- data/starter-app/script/performance/profiler +3 -0
- data/starter-app/script/plugin +3 -0
- data/starter-app/script/process/inspector +3 -0
- data/starter-app/script/process/reaper +3 -0
- data/starter-app/script/process/spawner +3 -0
- data/starter-app/script/runner +3 -0
- data/starter-app/script/server +3 -0
- data/starter-app/test/fixtures/users.yml +7 -0
- data/starter-app/test/test_helper.rb +28 -0
- data/starter-app/test/unit/user_test.rb +8 -0
- data/starter-app/vendor/plugins/acts_as_list/README +23 -0
- data/starter-app/vendor/plugins/acts_as_list/init.rb +3 -0
- data/starter-app/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
- data/starter-app/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
- data/starter-app/vendor/plugins/acts_as_tree/README +26 -0
- data/starter-app/vendor/plugins/acts_as_tree/Rakefile +22 -0
- data/starter-app/vendor/plugins/acts_as_tree/init.rb +1 -0
- data/starter-app/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/database.yml +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
- data/starter-app/vendor/plugins/calendar_date_select/CHANGELOG +170 -0
- data/starter-app/vendor/plugins/calendar_date_select/MIT-LICENSE +20 -0
- data/starter-app/vendor/plugins/calendar_date_select/README +10 -0
- data/starter-app/vendor/plugins/calendar_date_select/init.rb +15 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/functional/.tmp_cds_test.html +306 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/functional/cds_test.html +324 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/prototype.js +4184 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/test.css +40 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/unit/cds_helper_methods.html +46 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/unittest.js +564 -0
- data/starter-app/vendor/plugins/calendar_date_select/lib/calendar_date_select.rb +192 -0
- data/starter-app/vendor/plugins/calendar_date_select/lib/includes_helper.rb +22 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/images/calendar_date_select/calendar.gif +0 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/calendar_date_select.js +439 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_american.js +34 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr.js +7 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_finnish.js +24 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_hyphen_ampm.js +36 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_italian.js +24 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fi.js +10 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/blue.css +130 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/default.css +135 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/plain.css +128 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/red.css +135 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/silver.css +133 -0
- data/starter-app/vendor/plugins/calendar_date_select/test/functional/calendar_date_select_test.rb +95 -0
- data/starter-app/vendor/plugins/calendar_date_select/test/functional/helper_methods_test.rb +15 -0
- data/starter-app/vendor/plugins/calendar_date_select/test/test_helper.rb +26 -0
- data/starter-app/vendor/plugins/engines/CHANGELOG +258 -0
- data/starter-app/vendor/plugins/engines/MIT-LICENSE +21 -0
- data/starter-app/vendor/plugins/engines/README +63 -0
- data/starter-app/vendor/plugins/engines/Rakefile +32 -0
- data/starter-app/vendor/plugins/engines/about.yml +7 -0
- data/starter-app/vendor/plugins/engines/boot.rb +18 -0
- data/starter-app/vendor/plugins/engines/generators/plugin_migration/USAGE +45 -0
- data/starter-app/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +79 -0
- data/starter-app/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +13 -0
- data/starter-app/vendor/plugins/engines/init.rb +2 -0
- data/starter-app/vendor/plugins/engines/lib/engines.rb +169 -0
- data/starter-app/vendor/plugins/engines/lib/engines/assets.rb +38 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin.rb +125 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/list.rb +30 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/loader.rb +18 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/locator.rb +11 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/migrator.rb +60 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/action_mailer.rb +85 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +24 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/asset_helpers.rb +119 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +145 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +161 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +11 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +84 -0
- data/starter-app/vendor/plugins/engines/lib/engines/testing.rb +87 -0
- data/starter-app/vendor/plugins/engines/tasks/engines.rake +148 -0
- data/starter-app/vendor/plugins/in_place_editing/README +14 -0
- data/starter-app/vendor/plugins/in_place_editing/Rakefile +22 -0
- data/starter-app/vendor/plugins/in_place_editing/init.rb +2 -0
- data/starter-app/vendor/plugins/in_place_editing/lib/in_place_editing.rb +25 -0
- data/starter-app/vendor/plugins/in_place_editing/lib/in_place_macros_helper.rb +71 -0
- data/starter-app/vendor/plugins/in_place_editing/test/in_place_editing_test.rb +69 -0
- data/starter-app/vendor/plugins/paginating_find/CHANGELOG +117 -0
- data/starter-app/vendor/plugins/paginating_find/README +89 -0
- data/starter-app/vendor/plugins/paginating_find/init.rb +2 -0
- data/starter-app/vendor/plugins/paginating_find/lib/paginating_find.rb +135 -0
- data/starter-app/vendor/plugins/paginating_find/lib/paging_enumerator.rb +158 -0
- data/starter-app/vendor/plugins/paginating_find/lib/paging_helper.rb +47 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/Rakefile +10 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/app/controllers/application.rb +2 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/boot.rb +44 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/database.yml +6 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/environment.rb +53 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/environments/test.rb +19 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/routes.rb +22 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/db/schema.rb +16 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/script/breakpointer +3 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/script/console +3 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/articles.yml +19 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/authors.yml +7 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/edits.yml +11 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/models.rb +18 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/test_helper.rb +33 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/abstract_test.rb +7 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/group_test.rb +40 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/paginating_find_test.rb +194 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/paging_enumerator_test.rb +143 -0
- data/starter-app/vendor/plugins/railscart/.rakeTasks +7 -0
- data/starter-app/vendor/plugins/railscart/CHANGELOG +1 -0
- data/starter-app/vendor/plugins/railscart/LICENSE +26 -0
- data/starter-app/vendor/plugins/railscart/README +2 -0
- data/starter-app/vendor/plugins/railscart/Rakefile +10 -0
- data/starter-app/vendor/plugins/railscart/VERSION +1 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/account_controller.rb +48 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/base_controller.rb +7 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/categories_controller.rb +107 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/option_groups_controller.rb +36 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/option_values_controller.rb +42 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/options_controller.rb +52 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/orders_controller.rb +194 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/overview_controller.rb +14 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/products_controller.rb +147 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/reports_controller.rb +53 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/users_controller.rb +45 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/admin/variations_controller.rb +73 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/cart_controller.rb +45 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/checkout_controller.rb +179 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/rails_cart/base_controller.rb +41 -0
- data/starter-app/vendor/plugins/railscart/app/controllers/store_controller.rb +20 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/account_helper.rb +2 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/base_helper.rb +15 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/categories_helper.rb +3 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/option_groups_helper.rb +2 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/option_values_helper.rb +2 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/orders_helper.rb +11 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/overview_helper.rb +12 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/users_helper.rb +2 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/admin/variations_helper.rb +2 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/cart_helper.rb +6 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/checkout_helper.rb +17 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/rails_cart/base_helper.rb +67 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/search_helper.rb +10 -0
- data/starter-app/vendor/plugins/railscart/app/helpers/store_helper.rb +3 -0
- data/starter-app/vendor/plugins/railscart/app/models/address.rb +17 -0
- data/starter-app/vendor/plugins/railscart/app/models/cart.rb +37 -0
- data/starter-app/vendor/plugins/railscart/app/models/cart_item.rb +28 -0
- data/starter-app/vendor/plugins/railscart/app/models/category.rb +66 -0
- data/starter-app/vendor/plugins/railscart/app/models/country.rb +3 -0
- data/starter-app/vendor/plugins/railscart/app/models/line_item.rb +24 -0
- data/starter-app/vendor/plugins/railscart/app/models/option.rb +4 -0
- data/starter-app/vendor/plugins/railscart/app/models/option_group.rb +6 -0
- data/starter-app/vendor/plugins/railscart/app/models/option_value.rb +4 -0
- data/starter-app/vendor/plugins/railscart/app/models/order.rb +86 -0
- data/starter-app/vendor/plugins/railscart/app/models/order_mailer.rb +20 -0
- data/starter-app/vendor/plugins/railscart/app/models/payment.rb +49 -0
- data/starter-app/vendor/plugins/railscart/app/models/product.rb +76 -0
- data/starter-app/vendor/plugins/railscart/app/models/search_criteria.rb +27 -0
- data/starter-app/vendor/plugins/railscart/app/models/sku.rb +7 -0
- data/starter-app/vendor/plugins/railscart/app/models/state.rb +3 -0
- data/starter-app/vendor/plugins/railscart/app/models/tax_treatment.rb +2 -0
- data/starter-app/vendor/plugins/railscart/app/models/txn.rb +7 -0
- data/starter-app/vendor/plugins/railscart/app/models/variation.rb +5 -0
- data/starter-app/vendor/plugins/railscart/app/views/account/index.rhtml +3 -0
- data/starter-app/vendor/plugins/railscart/app/views/account/login.rhtml +12 -0
- data/starter-app/vendor/plugins/railscart/app/views/account/signup.rhtml +16 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/categories/_form.rhtml +27 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/categories/edit.rhtml +9 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/categories/list.rhtml +47 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/categories/new.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/option_groups/_form.rhtml +19 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/option_groups/new.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/option_values/_form.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/option_values/edit.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/option_values/list.rhtml +22 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/option_values/new.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/options/_form.rhtml +7 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/options/edit.rhtml +26 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/options/list.rhtml +23 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/options/new.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/orders/_address.rhtml +37 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/orders/index.rhtml +99 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/orders/show.rhtml +43 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/overview/index.rhtml +0 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/_form.rhtml +55 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/_menu.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/_new_variation.rhtml +0 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/edit.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/index.rhtml +66 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/new.rhtml +13 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/products/show.rhtml +26 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/reports/index.rhtml +29 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/reports/sales_total.rhtml +28 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/users/_form.rhtml +29 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/users/_menu.rhtml +5 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/users/edit.rhtml +8 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/users/index.rhtml +26 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/users/new.rhtml +6 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/users/show.rhtml +9 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/variations/_form.rhtml +33 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/variations/_option_values.rhtml +5 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/variations/list.rhtml +23 -0
- data/starter-app/vendor/plugins/railscart/app/views/admin/variations/new.rhtml +14 -0
- data/starter-app/vendor/plugins/railscart/app/views/cart/index.rhtml +49 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/_address.rhtml +51 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/_address_ro.rhtml +18 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/_cart_item.rhtml +5 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/_extra.rhtml +1 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/addresses.rhtml +49 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/cvv.rhtml +15 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/empty_cart.rhtml +4 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/final_confirmation.rhtml +92 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/incomplete.rhtml +7 -0
- data/starter-app/vendor/plugins/railscart/app/views/checkout/thank_you.rhtml +11 -0
- data/starter-app/vendor/plugins/railscart/app/views/layouts/admin.rhtml +69 -0
- data/starter-app/vendor/plugins/railscart/app/views/layouts/products.rhtml +20 -0
- data/starter-app/vendor/plugins/railscart/app/views/layouts/simple.rhtml +37 -0
- data/starter-app/vendor/plugins/railscart/app/views/order_mailer/cancel.rhtml +15 -0
- data/starter-app/vendor/plugins/railscart/app/views/order_mailer/confirm.rhtml +18 -0
- data/starter-app/vendor/plugins/railscart/app/views/shared/_order_details.rhtml +35 -0
- data/starter-app/vendor/plugins/railscart/app/views/shared/_paginate.rhtml +34 -0
- data/starter-app/vendor/plugins/railscart/app/views/shared/_report_criteria.rhtml +32 -0
- data/starter-app/vendor/plugins/railscart/app/views/shared/_tax_treatments.rhtml +12 -0
- data/starter-app/vendor/plugins/railscart/app/views/shared/_variations.rhtml +60 -0
- data/starter-app/vendor/plugins/railscart/app/views/store/_menu.rhtml +7 -0
- data/starter-app/vendor/plugins/railscart/app/views/store/_products.rhtml +10 -0
- data/starter-app/vendor/plugins/railscart/app/views/store/list.rhtml +16 -0
- data/starter-app/vendor/plugins/railscart/app/views/store/show.rhtml +71 -0
- data/starter-app/vendor/plugins/railscart/assets/.htaccess +40 -0
- data/starter-app/vendor/plugins/railscart/assets/404.html +30 -0
- data/starter-app/vendor/plugins/railscart/assets/500.html +30 -0
- data/starter-app/vendor/plugins/railscart/assets/dispatch.cgi +10 -0
- data/starter-app/vendor/plugins/railscart/assets/dispatch.fcgi +24 -0
- data/starter-app/vendor/plugins/railscart/assets/dispatch.rb +10 -0
- data/starter-app/vendor/plugins/railscart/assets/favicon.ico +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/amex_cid.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/creditcard.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/discover_cid.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/master_cid.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_bag.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_baseball_jersey.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_jr_spaghetti.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_mug.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_ringer_tshirt.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_stein.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/products/ror_tote.jpg +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/rails.png +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/railscart/progress.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/railscart/railscart_logo142x65.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/railscart/railscart_logo245x112.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/railscart/spinner.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/spinner.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/images/visa_cid.gif +0 -0
- data/starter-app/vendor/plugins/railscart/assets/javascripts/application.js +2 -0
- data/starter-app/vendor/plugins/railscart/assets/javascripts/controls.js +833 -0
- data/starter-app/vendor/plugins/railscart/assets/javascripts/dragdrop.js +942 -0
- data/starter-app/vendor/plugins/railscart/assets/javascripts/effects.js +1088 -0
- data/starter-app/vendor/plugins/railscart/assets/javascripts/lowpro.js +307 -0
- data/starter-app/vendor/plugins/railscart/assets/javascripts/prototype.js +2515 -0
- data/starter-app/vendor/plugins/railscart/assets/robots.txt +1 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/cart/_controller.css +71 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/checkout/_controller.css +31 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/fullscreen.css +63 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/orders/_controller.css +3 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/products/_controller.css +13 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/railscart-admin.css +295 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/railscart.css +66 -0
- data/starter-app/vendor/plugins/railscart/assets/stylesheets/store/_controller.css +23 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/001_create_addresses.rb +22 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/002_create_cart_items.rb +14 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/003_create_carts.rb +12 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/004_create_categories.rb +15 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/005_create_categories_products.rb +12 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/006_create_line_items.rb +17 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/007_create_option_groups.rb +12 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/008_create_option_values.rb +11 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/009_create_options.rb +11 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/010_create_orders.rb +24 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/011_create_products.rb +22 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/012_ignore_users.rb +9 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/013_create_txns.rb +21 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/014_ignore_roles.rb +9 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/015_create_variations.rb +14 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/016_create_tax_treatments.rb +23 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/017_create_skus.rb +13 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/018_create_countries.rb +11 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/019_create_states.rb +13 -0
- data/starter-app/vendor/plugins/railscart/db/migrate/020_modify_users.rb +9 -0
- data/starter-app/vendor/plugins/railscart/init.rb +16 -0
- data/starter-app/vendor/plugins/railscart/install.rb +3 -0
- data/starter-app/vendor/plugins/railscart/lib/constants/enumerable_constants.rb +207 -0
- data/starter-app/vendor/plugins/railscart/lib/format.rb +12 -0
- data/starter-app/vendor/plugins/railscart/lib/gateway/bogus_gateway.rb +63 -0
- data/starter-app/vendor/plugins/railscart/lib/shipping/flat_rate.rb +10 -0
- data/starter-app/vendor/plugins/railscart/lib/tasks/rc_bootstrap.rake +24 -0
- data/starter-app/vendor/plugins/railscart/lib/tax/sales_tax.rb +26 -0
- data/starter-app/vendor/plugins/railscart/routes.rb +3 -0
- data/starter-app/vendor/plugins/railscart/script/about +3 -0
- data/starter-app/vendor/plugins/railscart/script/breakpointer +3 -0
- data/starter-app/vendor/plugins/railscart/script/console +3 -0
- data/starter-app/vendor/plugins/railscart/script/destroy +3 -0
- data/starter-app/vendor/plugins/railscart/script/generate +3 -0
- data/starter-app/vendor/plugins/railscart/script/performance/benchmarker +3 -0
- data/starter-app/vendor/plugins/railscart/script/performance/profiler +3 -0
- data/starter-app/vendor/plugins/railscart/script/plugin +3 -0
- data/starter-app/vendor/plugins/railscart/script/process/inspector +3 -0
- data/starter-app/vendor/plugins/railscart/script/process/reaper +3 -0
- data/starter-app/vendor/plugins/railscart/script/process/spawner +3 -0
- data/starter-app/vendor/plugins/railscart/script/runner +3 -0
- data/starter-app/vendor/plugins/railscart/script/server +3 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/addresses.yml +29 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/categories.yml +40 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/line_items.yml +32 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/orders.yml +17 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/products.yml +63 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/products_tags.yml +10 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/roles.yml +6 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/roles_users.yml +3 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/skus.yml +5 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/tags.yml +7 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/tax_treatments.yml +7 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/txns.yml +13 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/users.yml +40 -0
- data/starter-app/vendor/plugins/railscart/test/fixtures/variations.yml +16 -0
- data/starter-app/vendor/plugins/railscart/test/functional/account_controller_test.rb +129 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/base_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/option_groups_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/option_values_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/orders_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/overview_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/products_controller_test.rb +125 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/users_controller_test.rb +58 -0
- data/starter-app/vendor/plugins/railscart/test/functional/admin/variations_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/railscart/test/functional/application_controller_test.rb +30 -0
- data/starter-app/vendor/plugins/railscart/test/functional/cart_controller_test.rb +76 -0
- data/starter-app/vendor/plugins/railscart/test/functional/checkout_controller_test.rb +20 -0
- data/starter-app/vendor/plugins/railscart/test/integration/authentication_test.rb +53 -0
- data/starter-app/vendor/plugins/railscart/test/integration/product_admin_test.rb +135 -0
- data/starter-app/vendor/plugins/railscart/test/integration/user_stories_test.rb +59 -0
- data/starter-app/vendor/plugins/railscart/test/integration/variations_test.rb +24 -0
- data/starter-app/vendor/plugins/railscart/test/test_helper.rb +45 -0
- data/starter-app/vendor/plugins/railscart/test/unit/address_test.rb +10 -0
- data/starter-app/vendor/plugins/railscart/test/unit/cart_item_test.rb +55 -0
- data/starter-app/vendor/plugins/railscart/test/unit/cart_test.rb +35 -0
- data/starter-app/vendor/plugins/railscart/test/unit/category_test.rb +52 -0
- data/starter-app/vendor/plugins/railscart/test/unit/line_item_test.rb +61 -0
- data/starter-app/vendor/plugins/railscart/test/unit/option_group_test.rb +12 -0
- data/starter-app/vendor/plugins/railscart/test/unit/order_test.rb +49 -0
- data/starter-app/vendor/plugins/railscart/test/unit/product_test.rb +107 -0
- data/starter-app/vendor/plugins/railscart/test/unit/role_test.rb +10 -0
- data/starter-app/vendor/plugins/railscart/test/unit/sales_tax_test.rb +46 -0
- data/starter-app/vendor/plugins/railscart/test/unit/sku_test.rb +10 -0
- data/starter-app/vendor/plugins/railscart/test/unit/tag_test.rb +9 -0
- data/starter-app/vendor/plugins/railscart/test/unit/tax_treatment_test.rb +10 -0
- data/starter-app/vendor/plugins/railscart/test/unit/txn_test.rb +10 -0
- data/starter-app/vendor/plugins/railscart/test/unit/variation_test.rb +9 -0
- data/starter-app/vendor/plugins/railscart/uninstall.rb +1 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/test/test_helper.rb +2 -0
- data/test/test_railscart.rb +11 -0
- data/website/index.html +93 -0
- data/website/index.txt +39 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.rhtml +48 -0
- metadata +557 -0
File without changes
|
@@ -0,0 +1,219 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'active_record'
|
5
|
+
|
6
|
+
$:.unshift File.dirname(__FILE__) + '/../lib'
|
7
|
+
require File.dirname(__FILE__) + '/../init'
|
8
|
+
|
9
|
+
class Test::Unit::TestCase
|
10
|
+
def assert_queries(num = 1)
|
11
|
+
$query_count = 0
|
12
|
+
yield
|
13
|
+
ensure
|
14
|
+
assert_equal num, $query_count, "#{$query_count} instead of #{num} queries were executed."
|
15
|
+
end
|
16
|
+
|
17
|
+
def assert_no_queries(&block)
|
18
|
+
assert_queries(0, &block)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
|
23
|
+
|
24
|
+
# AR keeps printing annoying schema statements
|
25
|
+
$stdout = StringIO.new
|
26
|
+
|
27
|
+
def setup_db
|
28
|
+
ActiveRecord::Base.logger
|
29
|
+
ActiveRecord::Schema.define(:version => 1) do
|
30
|
+
create_table :mixins do |t|
|
31
|
+
t.column :type, :string
|
32
|
+
t.column :parent_id, :integer
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def teardown_db
|
38
|
+
ActiveRecord::Base.connection.tables.each do |table|
|
39
|
+
ActiveRecord::Base.connection.drop_table(table)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class Mixin < ActiveRecord::Base
|
44
|
+
end
|
45
|
+
|
46
|
+
class TreeMixin < Mixin
|
47
|
+
acts_as_tree :foreign_key => "parent_id", :order => "id"
|
48
|
+
end
|
49
|
+
|
50
|
+
class TreeMixinWithoutOrder < Mixin
|
51
|
+
acts_as_tree :foreign_key => "parent_id"
|
52
|
+
end
|
53
|
+
|
54
|
+
class RecursivelyCascadedTreeMixin < Mixin
|
55
|
+
acts_as_tree :foreign_key => "parent_id"
|
56
|
+
has_one :first_child, :class_name => 'RecursivelyCascadedTreeMixin', :foreign_key => :parent_id
|
57
|
+
end
|
58
|
+
|
59
|
+
class TreeTest < Test::Unit::TestCase
|
60
|
+
|
61
|
+
def setup
|
62
|
+
setup_db
|
63
|
+
@root1 = TreeMixin.create!
|
64
|
+
@root_child1 = TreeMixin.create! :parent_id => @root1.id
|
65
|
+
@child1_child = TreeMixin.create! :parent_id => @root_child1.id
|
66
|
+
@root_child2 = TreeMixin.create! :parent_id => @root1.id
|
67
|
+
@root2 = TreeMixin.create!
|
68
|
+
@root3 = TreeMixin.create!
|
69
|
+
end
|
70
|
+
|
71
|
+
def teardown
|
72
|
+
teardown_db
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_children
|
76
|
+
assert_equal @root1.children, [@root_child1, @root_child2]
|
77
|
+
assert_equal @root_child1.children, [@child1_child]
|
78
|
+
assert_equal @child1_child.children, []
|
79
|
+
assert_equal @root_child2.children, []
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_parent
|
83
|
+
assert_equal @root_child1.parent, @root1
|
84
|
+
assert_equal @root_child1.parent, @root_child2.parent
|
85
|
+
assert_nil @root1.parent
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_delete
|
89
|
+
assert_equal 6, TreeMixin.count
|
90
|
+
@root1.destroy
|
91
|
+
assert_equal 2, TreeMixin.count
|
92
|
+
@root2.destroy
|
93
|
+
@root3.destroy
|
94
|
+
assert_equal 0, TreeMixin.count
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_insert
|
98
|
+
@extra = @root1.children.create
|
99
|
+
|
100
|
+
assert @extra
|
101
|
+
|
102
|
+
assert_equal @extra.parent, @root1
|
103
|
+
|
104
|
+
assert_equal 3, @root1.children.size
|
105
|
+
assert @root1.children.include?(@extra)
|
106
|
+
assert @root1.children.include?(@root_child1)
|
107
|
+
assert @root1.children.include?(@root_child2)
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_ancestors
|
111
|
+
assert_equal [], @root1.ancestors
|
112
|
+
assert_equal [@root1], @root_child1.ancestors
|
113
|
+
assert_equal [@root_child1, @root1], @child1_child.ancestors
|
114
|
+
assert_equal [@root1], @root_child2.ancestors
|
115
|
+
assert_equal [], @root2.ancestors
|
116
|
+
assert_equal [], @root3.ancestors
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_root
|
120
|
+
assert_equal @root1, TreeMixin.root
|
121
|
+
assert_equal @root1, @root1.root
|
122
|
+
assert_equal @root1, @root_child1.root
|
123
|
+
assert_equal @root1, @child1_child.root
|
124
|
+
assert_equal @root1, @root_child2.root
|
125
|
+
assert_equal @root2, @root2.root
|
126
|
+
assert_equal @root3, @root3.root
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_roots
|
130
|
+
assert_equal [@root1, @root2, @root3], TreeMixin.roots
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_siblings
|
134
|
+
assert_equal [@root2, @root3], @root1.siblings
|
135
|
+
assert_equal [@root_child2], @root_child1.siblings
|
136
|
+
assert_equal [], @child1_child.siblings
|
137
|
+
assert_equal [@root_child1], @root_child2.siblings
|
138
|
+
assert_equal [@root1, @root3], @root2.siblings
|
139
|
+
assert_equal [@root1, @root2], @root3.siblings
|
140
|
+
end
|
141
|
+
|
142
|
+
def test_self_and_siblings
|
143
|
+
assert_equal [@root1, @root2, @root3], @root1.self_and_siblings
|
144
|
+
assert_equal [@root_child1, @root_child2], @root_child1.self_and_siblings
|
145
|
+
assert_equal [@child1_child], @child1_child.self_and_siblings
|
146
|
+
assert_equal [@root_child1, @root_child2], @root_child2.self_and_siblings
|
147
|
+
assert_equal [@root1, @root2, @root3], @root2.self_and_siblings
|
148
|
+
assert_equal [@root1, @root2, @root3], @root3.self_and_siblings
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
class TreeTestWithEagerLoading < Test::Unit::TestCase
|
153
|
+
|
154
|
+
def setup
|
155
|
+
teardown_db
|
156
|
+
setup_db
|
157
|
+
@root1 = TreeMixin.create!
|
158
|
+
@root_child1 = TreeMixin.create! :parent_id => @root1.id
|
159
|
+
@child1_child = TreeMixin.create! :parent_id => @root_child1.id
|
160
|
+
@root_child2 = TreeMixin.create! :parent_id => @root1.id
|
161
|
+
@root2 = TreeMixin.create!
|
162
|
+
@root3 = TreeMixin.create!
|
163
|
+
|
164
|
+
@rc1 = RecursivelyCascadedTreeMixin.create!
|
165
|
+
@rc2 = RecursivelyCascadedTreeMixin.create! :parent_id => @rc1.id
|
166
|
+
@rc3 = RecursivelyCascadedTreeMixin.create! :parent_id => @rc2.id
|
167
|
+
@rc4 = RecursivelyCascadedTreeMixin.create! :parent_id => @rc3.id
|
168
|
+
end
|
169
|
+
|
170
|
+
def teardown
|
171
|
+
teardown_db
|
172
|
+
end
|
173
|
+
|
174
|
+
def test_eager_association_loading
|
175
|
+
roots = TreeMixin.find(:all, :include => :children, :conditions => "mixins.parent_id IS NULL", :order => "mixins.id")
|
176
|
+
assert_equal [@root1, @root2, @root3], roots
|
177
|
+
assert_no_queries do
|
178
|
+
assert_equal 2, roots[0].children.size
|
179
|
+
assert_equal 0, roots[1].children.size
|
180
|
+
assert_equal 0, roots[2].children.size
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
def test_eager_association_loading_with_recursive_cascading_three_levels_has_many
|
185
|
+
root_node = RecursivelyCascadedTreeMixin.find(:first, :include => { :children => { :children => :children } }, :order => 'mixins.id')
|
186
|
+
assert_equal @rc4, assert_no_queries { root_node.children.first.children.first.children.first }
|
187
|
+
end
|
188
|
+
|
189
|
+
def test_eager_association_loading_with_recursive_cascading_three_levels_has_one
|
190
|
+
root_node = RecursivelyCascadedTreeMixin.find(:first, :include => { :first_child => { :first_child => :first_child } }, :order => 'mixins.id')
|
191
|
+
assert_equal @rc4, assert_no_queries { root_node.first_child.first_child.first_child }
|
192
|
+
end
|
193
|
+
|
194
|
+
def test_eager_association_loading_with_recursive_cascading_three_levels_belongs_to
|
195
|
+
leaf_node = RecursivelyCascadedTreeMixin.find(:first, :include => { :parent => { :parent => :parent } }, :order => 'mixins.id DESC')
|
196
|
+
assert_equal @rc1, assert_no_queries { leaf_node.parent.parent.parent }
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
class TreeTestWithoutOrder < Test::Unit::TestCase
|
201
|
+
|
202
|
+
def setup
|
203
|
+
setup_db
|
204
|
+
@root1 = TreeMixinWithoutOrder.create!
|
205
|
+
@root2 = TreeMixinWithoutOrder.create!
|
206
|
+
end
|
207
|
+
|
208
|
+
def teardown
|
209
|
+
teardown_db
|
210
|
+
end
|
211
|
+
|
212
|
+
def test_root
|
213
|
+
assert [@root1, @root2].include?(TreeMixinWithoutOrder.root)
|
214
|
+
end
|
215
|
+
|
216
|
+
def test_roots
|
217
|
+
assert_equal [], [@root1, @root2] - TreeMixinWithoutOrder.roots
|
218
|
+
end
|
219
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,170 @@
|
|
1
|
+
==Version 1.10 ==
|
2
|
+
Dec 3, 2007
|
3
|
+
* You can now pass in a parameter to tell CalendarDateSelect not to allow selection of certain dates. See the [http://www.restatesman.com/static/calendar?tab=other demo] for an example.
|
4
|
+
|
5
|
+
==Version 1.9.2==
|
6
|
+
Nov 26, 2007
|
7
|
+
* CalendarDateSelect was leaking javascript variables. (nothing was explicitly declared local, so javascript assumes global). Added test case and applied fix. This may help with some of the conflicts CalendarDateSelect has been causing with other scripts.
|
8
|
+
* Applied Ryan Wood's patch to fix the problem with using a form builder against objects like authorization[coverage_attributes][]. Thanks Ryan Wood!
|
9
|
+
* Wes Hays brought up the point of parseInt trying to auto-detect number formats. Wrote code to force interpretation of digits as base10, with test cases to prove it.
|
10
|
+
* Misleading test case failure in Safari fixed: Safari won't let a boolean value to a property that should have a function (understandably). Changed the test variable names to prevent such a conflict.
|
11
|
+
* Now uses css :hover, rather than manually setting/removing the hover class. If you are using a custom stylesheet, you'll need to change ".calendar_date_select tbody td.hover" to ".calendar_date_select tbody td:hover" (thanks, Alex Egg)
|
12
|
+
|
13
|
+
==Version 1.9.1==
|
14
|
+
Nov 15, 2007
|
15
|
+
* Removed dependency on deprecated features in 1.6.0. Thanks again, Richard Quadling!
|
16
|
+
* Bugfix - was showing wrong day selected when selecting Mar 23, 2008. (Day light savings time issue). Fixed with test case.
|
17
|
+
* Added CSS style to show red border around the embedded calendar_date_select div's with errors.
|
18
|
+
* Callbacks were broken with 1.9.0. Fixed, added test cases.
|
19
|
+
|
20
|
+
==Version 1.9.0==
|
21
|
+
Nov 13, 2007
|
22
|
+
* Prototype 1.6.0 compatibility update. Will now break with earlier versions of prototype (ie 1.5.1). Big thanks to Kevin Alexander and Richard Quadling
|
23
|
+
* Additional test coverage for improved stability going forward.
|
24
|
+
|
25
|
+
==Version 1.8.3==
|
26
|
+
Nov 12, 2007
|
27
|
+
|
28
|
+
* Improved close methods:
|
29
|
+
* Added "OK" button at the bottom
|
30
|
+
* Double clicking a day closes the calendar (not in IE, though... because IE is everyone's favorite browser to program for)
|
31
|
+
* Escape key closes calendar
|
32
|
+
* Added optional close button at the top, which is hidden by default. Don't use this unless you really need it, because it may disappear in the future.
|
33
|
+
* Don't focus a hidden element
|
34
|
+
* Navigate down to child input element if exists (in case a div tag is passed in). Resolves problems when input control is wrapped with a error div. Test cases
|
35
|
+
* Allow specific year ranges (pass in an array)
|
36
|
+
* restrict year navigation inside of a non-flexible range
|
37
|
+
* test case to check auto-repopulating of flexibleYearRanges.
|
38
|
+
* test case to check boundaries of nonFlexibleYearRanges.
|
39
|
+
* Ability to pass in :year_range => 5.years.ago..0.years.ago to calendar_date_select (ruby)
|
40
|
+
* Updated test cases
|
41
|
+
* Bugfix for duplicate days that were occuring across day-light-saving-time boundaries
|
42
|
+
* Added format_american.js (thanks, Wes Hays)
|
43
|
+
* Added format_italian.js (thanks, Bigonazzi)
|
44
|
+
* Added format_euro_24hr.js (thanks, James Silberbauer)
|
45
|
+
* Bugfix for Konqueror - Was showing blank white box for popup window - had to do with Iframe hack.
|
46
|
+
* Code-refactoring, clean up, breaking down methods, making the code easier to understand and extend.
|
47
|
+
* Added new stylesheet definition: .calendar_date_select .cds_header a.close { display: none}. Update your custom stylesheet with this new definition.
|
48
|
+
|
49
|
+
|
50
|
+
==Version 1.8.1==
|
51
|
+
September 27 2007
|
52
|
+
* 1.8.0 was rushed. There were a bunch of bugs that cropped up immediately. This deploy includes JavaScript unit testing using the scriptaculous unit test framework! ([http://www.restatesman.com/calendar_date_select/js_test/functional/cds_test.html click here to run the tests on the latest trunk version]). These unit tests are going to greatly improve the reliability of CalendarDateSelect releases.
|
53
|
+
|
54
|
+
==Version 1.8.0==
|
55
|
+
|
56
|
+
September 26 2007
|
57
|
+
* Bugfix - Safari 2 issue fixed (was interpreting "" as January 1, 1969)
|
58
|
+
* CSS overhaul - removed buttons and replaced with links. Cleaned up CSS. See CSSDiff_1_7_0__1_8_0 for a diff.
|
59
|
+
* :popup => :force (force the user to select a date)
|
60
|
+
* :time => "mixed" - You can now create a calendar control that allows a user to select "all day" or a specific time!
|
61
|
+
* :month_year => "label" - Replace the clunky dropdowns with a text.
|
62
|
+
* Some internal "gardening" on the code
|
63
|
+
|
64
|
+
==Version 1.7.1==
|
65
|
+
|
66
|
+
Aug 29 2007
|
67
|
+
|
68
|
+
* Rendering options weren't being passed to the input control (like :style, :class, etc.)
|
69
|
+
|
70
|
+
==Version 1.7.0==
|
71
|
+
|
72
|
+
Aug 24 2007
|
73
|
+
|
74
|
+
* update calendar date select to not rely on dom_id's anymore ( and no longer automatically changes the dom_id for your input fields )
|
75
|
+
|
76
|
+
* applied Steve Madsen's patch for not blanking out invalid dates.
|
77
|
+
|
78
|
+
==Version 1.6.1==
|
79
|
+
|
80
|
+
Aug 24 2007
|
81
|
+
|
82
|
+
* Serious javascript bug when using "hyphen_ampm" format fixed. (Was only working in Firefox browsers with firebug installed)
|
83
|
+
|
84
|
+
* Added a bunch of new callbacks: before_show, before_close, after_show, after_close, after_navigate. (see [http://www.restatesman.com/static/calendar?tab=callbacks here] for details)
|
85
|
+
|
86
|
+
|
87
|
+
==Version 1.6.0==
|
88
|
+
|
89
|
+
July 27 2007
|
90
|
+
|
91
|
+
* Now MUCH easier to change date formats! See ChangingDateFormat for details.
|
92
|
+
* Opera button labels fixed
|
93
|
+
* Calendar "flicker" fixed when displaying popup window.
|
94
|
+
* JS error 106 being thrown - fixed
|
95
|
+
* Bug fixes relating to calendar date select deciding whether to display above or below an element on a page
|
96
|
+
* XHTML compliance issue resolved - image had an invalid "id"
|
97
|
+
* Disabled/readonly elements can't be updated
|
98
|
+
* (note, if you wish to prevent user from inputting a date without the date picker, use the "embedded" option. See [http://restatesman.com/static/calendar/ demo] for example).
|
99
|
+
* Changes/cleanups submitted by Steve Madsen. If you see Steve, tell him what a great guy he is!
|
100
|
+
* Ability to change calendar image via CalendarDateSelect.image=
|
101
|
+
* cleaning up on how input tags are rendered
|
102
|
+
|
103
|
+
==Version 1.5.2==
|
104
|
+
|
105
|
+
July 12 2007
|
106
|
+
* onchange event handler now supported.
|
107
|
+
* detects to see if prototype is loaded. If not, shows error message
|
108
|
+
* ability to hide "buttons"
|
109
|
+
* date parsing broken out to static function Date.parseFormattedString() for anyone who wants date's to parse a different way from javascript
|
110
|
+
* you can no longer select 1:60 pm.
|
111
|
+
|
112
|
+
==Version 1.5.1==
|
113
|
+
|
114
|
+
June 21, 2007
|
115
|
+
|
116
|
+
* fixed following tickets:
|
117
|
+
* Selecting dates in April 2007 doesn't highlight day
|
118
|
+
* Selecting 29 February 2008 returns 1 March 2008
|
119
|
+
* options[:format] needs to be purged
|
120
|
+
|
121
|
+
==Version 1.5==
|
122
|
+
June 18, 2007
|
123
|
+
|
124
|
+
* New CSS stylesheet
|
125
|
+
|
126
|
+
* Fixed "white on white" css issue when selecting a day
|
127
|
+
|
128
|
+
* Clicking today now updates the input field
|
129
|
+
|
130
|
+
==Version 1.4==
|
131
|
+
June 16, 2007
|
132
|
+
|
133
|
+
* more bug fixes (selecting across daylight savings time causing js error. Sometimes clicking a day of the next month after selecting day 31 of the previous month was causing 2 months later to be selected)
|
134
|
+
|
135
|
+
* CSS improvements and refactoring
|
136
|
+
|
137
|
+
* form builder methods now automatically detect whether or not to use a Time field
|
138
|
+
|
139
|
+
* a bit more optimization
|
140
|
+
|
141
|
+
* refactored date formatter methods and others so they can be more easily overridden.
|
142
|
+
|
143
|
+
==Version 1.3==
|
144
|
+
June 8, 2007
|
145
|
+
|
146
|
+
* a few bug fixes
|
147
|
+
|
148
|
+
* Modified the helper methods to allow passing of virtually any JavaScript argument into the JavaScript control.
|
149
|
+
|
150
|
+
==Version 1.2==
|
151
|
+
June 4, 2007
|
152
|
+
|
153
|
+
* Big optimizations to the redrawing of the calendar. Now, previous/next buttons much more responsive.
|
154
|
+
|
155
|
+
* Improved feel of pop-up dialog - when somewhere else clicked on the screen other than the popup calendar, popup calendar will automatically close.
|
156
|
+
|
157
|
+
* If the popup window won't fit on the screen underneath the control, will automatically position to the top.
|
158
|
+
|
159
|
+
|
160
|
+
==Version 1.1==
|
161
|
+
June 2, 2007
|
162
|
+
|
163
|
+
* There was a very strange bug that crept in for Internet Explorer. Internet Explorer does not allow you to set the innerHTML property for "button" elements. Therefore, it was necessary to change "button" elements to "input" elements of type button.
|
164
|
+
|
165
|
+
* There was a change to the CSS file. Anything applying styles to "button" elements has been changed to "input.button". If you have a custom stylesheet, update accordingly.
|
166
|
+
|
167
|
+
==Version 1.0==
|
168
|
+
June 1, 2007
|
169
|
+
|
170
|
+
* Initial release!
|
@@ -0,0 +1,20 @@
|
|
1
|
+
All portions Copyright (c) 2007 Tim Harper
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
::CalendarDateSelect::
|
2
|
+
Author: Tim Harper ( 'tim_see_harperATgmail._see_om'.gsub('_see_', 'c').gsub('AT', '@') )
|
3
|
+
|
4
|
+
::Examples::
|
5
|
+
see demo here -- http://restatesman.com/static/calendar
|
6
|
+
|
7
|
+
::Project Site::
|
8
|
+
http://code.google.com/p/calendardateselect/
|
9
|
+
|
10
|
+
It works!
|
@@ -0,0 +1,15 @@
|
|
1
|
+
%w[calendar_date_select includes_helper].each { |file|
|
2
|
+
require File.join( File.dirname(__FILE__), "lib",file)
|
3
|
+
}
|
4
|
+
|
5
|
+
ActionView::Helpers::FormHelper.send(:include, CalendarDateSelect::FormHelper)
|
6
|
+
ActionView::Base.send(:include, CalendarDateSelect::FormHelper)
|
7
|
+
ActionView::Base.send(:include, CalendarDateSelect::IncludesHelper)
|
8
|
+
|
9
|
+
# install files
|
10
|
+
['/public/javascripts/calendar_date_select', '/public/stylesheets/calendar_date_select', '/public/images/calendar_date_select'].each{|dir|
|
11
|
+
source = File.join(directory,dir)
|
12
|
+
dest = RAILS_ROOT + dir
|
13
|
+
FileUtils.mkdir_p(dest)
|
14
|
+
FileUtils.cp_r(Dir.glob(source+'/*.*'), dest)
|
15
|
+
} unless File.exists?(RAILS_ROOT + '/public/javascripts/calendar_date_select/calendar_date_select.js')
|