the_sortable_tree 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. data/README.md +6 -1
  2. data/app/helpers/render_nested_options_helper.rb +5 -2
  3. data/lib/the_sortable_tree/version.rb +1 -1
  4. data/spec/{controlllers → old_tests/controlllers}/controller_mixin_spec.rb +1 -1
  5. data/spec/{dummy → old_tests/dummy}/README.rdoc +0 -0
  6. data/spec/{dummy → old_tests/dummy}/Rakefile +0 -0
  7. data/spec/{dummy → old_tests/dummy}/app/assets/javascripts/application.js +0 -0
  8. data/spec/{dummy → old_tests/dummy}/app/assets/stylesheets/application.css +0 -0
  9. data/spec/{dummy → old_tests/dummy}/app/controllers/application_controller.rb +0 -0
  10. data/spec/{dummy → old_tests/dummy}/app/controllers/tests_controller.rb +0 -0
  11. data/spec/{dummy → old_tests/dummy}/app/views/layouts/application.html.erb +0 -0
  12. data/spec/{dummy → old_tests/dummy}/config/application.rb +0 -0
  13. data/spec/{dummy → old_tests/dummy}/config/boot.rb +0 -0
  14. data/spec/{dummy → old_tests/dummy}/config/database.yml +0 -0
  15. data/spec/{dummy → old_tests/dummy}/config/environment.rb +0 -0
  16. data/spec/{dummy → old_tests/dummy}/config/environments/development.rb +0 -0
  17. data/spec/{dummy → old_tests/dummy}/config/environments/production.rb +0 -0
  18. data/spec/{dummy → old_tests/dummy}/config/environments/test.rb +0 -0
  19. data/spec/{dummy → old_tests/dummy}/config/initializers/backtrace_silencers.rb +0 -0
  20. data/spec/{dummy → old_tests/dummy}/config/initializers/inflections.rb +0 -0
  21. data/spec/{dummy → old_tests/dummy}/config/initializers/mime_types.rb +0 -0
  22. data/spec/{dummy → old_tests/dummy}/config/initializers/secret_token.rb +0 -0
  23. data/spec/{dummy → old_tests/dummy}/config/initializers/session_store.rb +0 -0
  24. data/spec/{dummy → old_tests/dummy}/config/initializers/wrap_parameters.rb +0 -0
  25. data/spec/{dummy → old_tests/dummy}/config/locales/en.yml +0 -0
  26. data/spec/{dummy → old_tests/dummy}/config/routes.rb +0 -0
  27. data/spec/{dummy → old_tests/dummy}/config.ru +0 -0
  28. data/spec/{dummy → old_tests/dummy}/db/test.sqlite3 +0 -0
  29. data/spec/{dummy → old_tests/dummy}/log/test.log +0 -0
  30. data/spec/{dummy → old_tests/dummy}/public/404.html +0 -0
  31. data/spec/{dummy → old_tests/dummy}/public/422.html +0 -0
  32. data/spec/{dummy → old_tests/dummy}/public/500.html +0 -0
  33. data/spec/{dummy → old_tests/dummy}/public/favicon.ico +0 -0
  34. data/spec/{dummy → old_tests/dummy}/script/rails +0 -0
  35. data/spec/{spec_helper.rb → old_tests/spec_helper.rb} +0 -0
  36. data/spec/the_sortable_tree_app/Gemfile +20 -0
  37. data/spec/the_sortable_tree_app/Gemfile.lock +138 -0
  38. data/spec/the_sortable_tree_app/README.md +9 -0
  39. data/spec/the_sortable_tree_app/Rakefile +7 -0
  40. data/spec/the_sortable_tree_app/app/assets/images/rails.png +0 -0
  41. data/spec/the_sortable_tree_app/app/assets/javascripts/application.js +16 -0
  42. data/spec/the_sortable_tree_app/app/assets/stylesheets/application.css +11 -0
  43. data/spec/the_sortable_tree_app/app/controllers/admin/pages_controller.rb +31 -0
  44. data/spec/the_sortable_tree_app/app/controllers/application_controller.rb +3 -0
  45. data/spec/the_sortable_tree_app/app/controllers/article_categories_controller.rb +11 -0
  46. data/spec/the_sortable_tree_app/app/controllers/inventory/categories_controller.rb +15 -0
  47. data/spec/the_sortable_tree_app/app/controllers/pages_controller.rb +26 -0
  48. data/spec/the_sortable_tree_app/app/controllers/welcome_controller.rb +3 -0
  49. data/spec/the_sortable_tree_app/app/models/admin/page.rb +4 -0
  50. data/spec/the_sortable_tree_app/app/models/admin.rb +5 -0
  51. data/spec/the_sortable_tree_app/app/models/article_category.rb +4 -0
  52. data/spec/the_sortable_tree_app/app/models/inventory/category.rb +4 -0
  53. data/spec/the_sortable_tree_app/app/models/inventory.rb +5 -0
  54. data/spec/the_sortable_tree_app/app/models/page.rb +5 -0
  55. data/spec/the_sortable_tree_app/app/views/admin/pages/index.html.haml +8 -0
  56. data/spec/the_sortable_tree_app/app/views/admin/pages/manage.html.haml +3 -0
  57. data/spec/the_sortable_tree_app/app/views/admin/pages/namespaced_link.html.haml +3 -0
  58. data/spec/the_sortable_tree_app/app/views/admin/pages/nested_options.html.haml +3 -0
  59. data/spec/the_sortable_tree_app/app/views/admin/pages/node_manage.html.haml +12 -0
  60. data/spec/the_sortable_tree_app/app/views/article_categories/index.html.haml +3 -0
  61. data/spec/the_sortable_tree_app/app/views/article_categories/manage.html.haml +4 -0
  62. data/spec/the_sortable_tree_app/app/views/inventory/categories/index.html.haml +3 -0
  63. data/spec/the_sortable_tree_app/app/views/inventory/categories/manage.html.haml +4 -0
  64. data/spec/the_sortable_tree_app/app/views/layouts/application.html.erb +18 -0
  65. data/spec/the_sortable_tree_app/app/views/pages/expand.html.haml +7 -0
  66. data/spec/the_sortable_tree_app/app/views/pages/expand_children.html.haml +1 -0
  67. data/spec/the_sortable_tree_app/app/views/pages/index.html.haml +3 -0
  68. data/spec/the_sortable_tree_app/app/views/pages/manage.html.haml +8 -0
  69. data/spec/the_sortable_tree_app/app/views/pages/nested_options.html.haml +3 -0
  70. data/spec/the_sortable_tree_app/app/views/welcome/index.html.haml +40 -0
  71. data/spec/the_sortable_tree_app/config/application.rb +48 -0
  72. data/spec/the_sortable_tree_app/config/boot.rb +6 -0
  73. data/spec/the_sortable_tree_app/config/database.yml +11 -0
  74. data/spec/the_sortable_tree_app/config/environment.rb +5 -0
  75. data/spec/the_sortable_tree_app/config/environments/development.rb +30 -0
  76. data/spec/the_sortable_tree_app/config/environments/production.rb +60 -0
  77. data/spec/the_sortable_tree_app/config/environments/test.rb +42 -0
  78. data/spec/the_sortable_tree_app/config/initializers/backtrace_silencers.rb +7 -0
  79. data/spec/the_sortable_tree_app/config/initializers/inflections.rb +10 -0
  80. data/spec/the_sortable_tree_app/config/initializers/mime_types.rb +5 -0
  81. data/spec/the_sortable_tree_app/config/initializers/secret_token.rb +7 -0
  82. data/spec/the_sortable_tree_app/config/initializers/session_store.rb +8 -0
  83. data/spec/the_sortable_tree_app/config/initializers/wrap_parameters.rb +14 -0
  84. data/spec/the_sortable_tree_app/config/locales/en.yml +28 -0
  85. data/spec/the_sortable_tree_app/config/routes.rb +47 -0
  86. data/spec/the_sortable_tree_app/config.ru +4 -0
  87. data/spec/the_sortable_tree_app/db/development.db +0 -0
  88. data/spec/the_sortable_tree_app/db/migrate/20120211053457_create_pages.rb +16 -0
  89. data/spec/the_sortable_tree_app/db/migrate/20120503173258_create_article_categories.rb +16 -0
  90. data/spec/the_sortable_tree_app/db/migrate/20120508093823_create_inventory_categories.rb +16 -0
  91. data/spec/the_sortable_tree_app/db/migrate/20130128160328_create_admin_pages.rb +16 -0
  92. data/spec/the_sortable_tree_app/db/production.db +0 -0
  93. data/spec/the_sortable_tree_app/db/schema.rb +64 -0
  94. data/spec/the_sortable_tree_app/db/seeds.rb +96 -0
  95. data/spec/the_sortable_tree_app/db/test.db +0 -0
  96. data/spec/the_sortable_tree_app/doc/README_FOR_APP +2 -0
  97. data/spec/the_sortable_tree_app/log/development.log +18672 -0
  98. data/spec/the_sortable_tree_app/log/production.log +5 -0
  99. data/spec/the_sortable_tree_app/public/404.html +26 -0
  100. data/spec/the_sortable_tree_app/public/422.html +26 -0
  101. data/spec/the_sortable_tree_app/public/500.html +26 -0
  102. data/spec/the_sortable_tree_app/public/favicon.ico +0 -0
  103. data/spec/the_sortable_tree_app/public/robots.txt +5 -0
  104. data/spec/the_sortable_tree_app/script/rails +6 -0
  105. data/spec/the_sortable_tree_app/test/fixtures/admin/pages.yml +7 -0
  106. data/spec/the_sortable_tree_app/test/fixtures/article_categories.yml +9 -0
  107. data/spec/the_sortable_tree_app/test/fixtures/comments.yml +13 -0
  108. data/spec/the_sortable_tree_app/test/fixtures/inventory/categories.yml +9 -0
  109. data/spec/the_sortable_tree_app/test/functional/inventory/category_controller_test.rb +14 -0
  110. data/spec/the_sortable_tree_app/test/performance/browsing_test.rb +12 -0
  111. data/spec/the_sortable_tree_app/test/test_helper.rb +13 -0
  112. data/spec/the_sortable_tree_app/test/unit/admin/page_test.rb +7 -0
  113. data/spec/the_sortable_tree_app/test/unit/article_category_test.rb +7 -0
  114. data/spec/the_sortable_tree_app/test/unit/comment_test.rb +7 -0
  115. data/spec/the_sortable_tree_app/test/unit/helpers/inventory/category_helper_test.rb +4 -0
  116. data/spec/the_sortable_tree_app/test/unit/inventory/category_test.rb +7 -0
  117. data/spec/the_sortable_tree_app/tmp/cache/assets/C3B/4B0/sprockets%2F4143dd2388a3252adb1804945871a002 +0 -0
  118. data/spec/the_sortable_tree_app/tmp/cache/assets/C50/BE0/sprockets%2Fa139ccc37272f09e8337565114558a42 +0 -0
  119. data/spec/the_sortable_tree_app/tmp/cache/assets/C6B/530/sprockets%2F54e7598ead46f414a5474993750992a6 +0 -0
  120. data/spec/the_sortable_tree_app/tmp/cache/assets/C77/560/sprockets%2F813f25e4a0780001a1f80f83ea522987 +0 -0
  121. data/spec/the_sortable_tree_app/tmp/cache/assets/C81/090/sprockets%2F5338822ad86a0a0079f990225ed9037d +0 -0
  122. data/spec/the_sortable_tree_app/tmp/cache/assets/C9A/730/sprockets%2F12ff81fe7a0c213d511536b1a9712613 +0 -0
  123. data/spec/the_sortable_tree_app/tmp/cache/assets/C9B/370/sprockets%2F4b19719024eb862bb0b40c2903b2444f +0 -0
  124. data/spec/the_sortable_tree_app/tmp/cache/assets/CB1/D00/sprockets%2F90a69052f559169cc0338bb9e7b2071c +0 -0
  125. data/spec/the_sortable_tree_app/tmp/cache/assets/CC9/ED0/sprockets%2Fa98594ed698bb2f25c32497158b7346f +0 -0
  126. data/spec/the_sortable_tree_app/tmp/cache/assets/CD5/540/sprockets%2Fa2e03c2a79820a23e494e3b8459c32f0 +0 -0
  127. data/spec/the_sortable_tree_app/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  128. data/spec/the_sortable_tree_app/tmp/cache/assets/CDC/B70/sprockets%2Fb8655a3e58029cd981112a7ce421db65 +0 -0
  129. data/spec/the_sortable_tree_app/tmp/cache/assets/CE9/BD0/sprockets%2F22287637edb361485c371efd7817acc7 +0 -0
  130. data/spec/the_sortable_tree_app/tmp/cache/assets/CEA/2D0/sprockets%2F77e58093f6053b9964ca2b36bd34a94d +0 -0
  131. data/spec/the_sortable_tree_app/tmp/cache/assets/CEE/3C0/sprockets%2Ff078d8a33d271e8bf062dfd978343537 +0 -0
  132. data/spec/the_sortable_tree_app/tmp/cache/assets/CF0/590/sprockets%2F66914ec5c90e7fa7285377a17c4b94e3 +0 -0
  133. data/spec/the_sortable_tree_app/tmp/cache/assets/CF8/C70/sprockets%2Fb086216a7cea4b05f2d10a54a1508c86 +0 -0
  134. data/spec/the_sortable_tree_app/tmp/cache/assets/D07/110/sprockets%2F4a6961a0c735dbbba76f35e606f34027 +0 -0
  135. data/spec/the_sortable_tree_app/tmp/cache/assets/D0A/840/sprockets%2F38149c503a4865c81cef8cc0226b6a3d +0 -0
  136. data/spec/the_sortable_tree_app/tmp/cache/assets/D0E/CE0/sprockets%2F54005c20e9fd12f1d6d7bf9f7080f822 +0 -0
  137. data/spec/the_sortable_tree_app/tmp/cache/assets/D0F/540/sprockets%2Ffdff04173da67c582219de85c136320f +0 -0
  138. data/spec/the_sortable_tree_app/tmp/cache/assets/D14/170/sprockets%2F2a860136457d8b8f4fedb7bcb3962136 +0 -0
  139. data/spec/the_sortable_tree_app/tmp/cache/assets/D14/F00/sprockets%2Fb0d459b10f17bcc3955798772c7bac18 +0 -0
  140. data/spec/the_sortable_tree_app/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  141. data/spec/the_sortable_tree_app/tmp/cache/assets/D38/E20/sprockets%2F0e50ead9c50e79817fc32184e900ba5a +0 -0
  142. data/spec/the_sortable_tree_app/tmp/cache/assets/D42/760/sprockets%2Fa26ac9237d11ffa65fca30c861979e36 +0 -0
  143. data/spec/the_sortable_tree_app/tmp/cache/assets/D47/BE0/sprockets%2F544a4972c2f7438e092ab50cbc8c9de9 +0 -0
  144. data/spec/the_sortable_tree_app/tmp/cache/assets/D48/300/sprockets%2F392aba9fd44f378041913c9f0edef429 +0 -0
  145. data/spec/the_sortable_tree_app/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  146. data/spec/the_sortable_tree_app/tmp/cache/assets/D51/420/sprockets%2F8497f4db9b07de37eee54184fd031e93 +0 -0
  147. data/spec/the_sortable_tree_app/tmp/cache/assets/D59/D90/sprockets%2Ff09bd16e880b660cbf49848bc97f29e7 +0 -0
  148. data/spec/the_sortable_tree_app/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  149. data/spec/the_sortable_tree_app/tmp/cache/assets/D5F/560/sprockets%2Fa07f8d3d20c8ad7093220eb04c67a6cd +0 -0
  150. data/spec/the_sortable_tree_app/tmp/cache/assets/D7C/D70/sprockets%2F8c4e6f6fc945e97cae12d8218a21f8b3 +0 -0
  151. data/spec/the_sortable_tree_app/tmp/cache/assets/DA2/800/sprockets%2F21a7cffa498af4bfb7a0849616b41dd8 +0 -0
  152. data/spec/the_sortable_tree_app/tmp/cache/assets/DAE/A40/sprockets%2F78e36ff8ef2fc355f82b30e0bfb397b5 +0 -0
  153. data/spec/the_sortable_tree_app/tmp/cache/assets/DD3/4C0/sprockets%2Fb4b73a83da8ea301f18e578dc3d9dde6 +0 -0
  154. data/spec/the_sortable_tree_app/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  155. data/spec/the_sortable_tree_app/tmp/cache/assets/DF1/8B0/sprockets%2F2f0d2d00353acefe637b5338a9abfdfb +0 -0
  156. data/spec/the_sortable_tree_app/tmp/cache/assets/E03/A20/sprockets%2F74f7c02ea34e1ecfcb83bff7c167c75d +0 -0
  157. data/spec/the_sortable_tree_app/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  158. data/spec/the_sortable_tree_app/tmp/cache/sass/2255c97fc63f030a9ce238cccb311b4b1e966328/nested_options.css.scssc +0 -0
  159. data/spec/the_sortable_tree_app/tmp/cache/sass/2255c97fc63f030a9ce238cccb311b4b1e966328/sortable_tree.css.scssc +0 -0
  160. data/spec/the_sortable_tree_app/tmp/cache/sass/2255c97fc63f030a9ce238cccb311b4b1e966328/tree.css.scssc +0 -0
  161. metadata +340 -110
@@ -0,0 +1,48 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ if defined?(Bundler)
6
+ # If you precompile assets before deploying to production, use this line
7
+ Bundler.require *Rails.groups(:assets => %w(development test))
8
+ # If you want your assets lazily compiled in production, use this line
9
+ # Bundler.require(:default, :assets, Rails.env)
10
+ end
11
+
12
+ module TheSortableTreeTest
13
+ class Application < Rails::Application
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
17
+
18
+ # Custom directories with classes and modules you want to be autoloadable.
19
+ # config.autoload_paths += %W(#{config.root}/extras)
20
+
21
+ # Only load the plugins named here, in the order given (default is alphabetical).
22
+ # :all can be used as a placeholder for all plugins not explicitly named.
23
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
+
25
+ # Activate observers that should always be running.
26
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
+
28
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
+ # config.time_zone = 'Central Time (US & Canada)'
31
+
32
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
+ # config.i18n.default_locale = :ru
35
+
36
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+
42
+ # Enable the asset pipeline
43
+ config.assets.enabled = true
44
+
45
+ # Version of your assets, change this if you want to expire all your assets
46
+ config.assets.version = '1.0'
47
+ end
48
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,11 @@
1
+ development:
2
+ adapter: sqlite3
3
+ database: db/development.db
4
+
5
+ production:
6
+ adapter: sqlite3
7
+ database: db/production.db
8
+
9
+ test:
10
+ adapter: sqlite3
11
+ database: db/test.db
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ TheSortableTreeTest::Application.initialize!
@@ -0,0 +1,30 @@
1
+ TheSortableTreeTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -0,0 +1,60 @@
1
+ TheSortableTreeTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Use a different logger for distributed setups
37
+ # config.logger = SyslogLogger.new
38
+
39
+ # Use a different cache store in production
40
+ # config.cache_store = :mem_cache_store
41
+
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
+ # config.action_controller.asset_host = "http://assets.example.com"
44
+
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
48
+ # Disable delivery errors, bad email addresses will be ignored
49
+ # config.action_mailer.raise_delivery_errors = false
50
+
51
+ # Enable threaded mode
52
+ # config.threadsafe!
53
+
54
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
+ # the I18n.default_locale when a translation can not be found)
56
+ config.i18n.fallbacks = true
57
+
58
+ # Send deprecation notices to registered listeners
59
+ config.active_support.deprecation = :notify
60
+ end
@@ -0,0 +1,42 @@
1
+ TheSortableTreeTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
41
+ config.assets.allow_debugging = true
42
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ TheSortableTreeTest::Application.config.secret_token = '90a09b093ed2035863756a7ee595c789f67c81c25ab3d11fe780089a9598e0c8882dc2b292000bd679ed4101c20d2d265ff7d0dbd2b550132f5c2e3fab4d767f'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ TheSortableTreeTest::Application.config.session_store :cookie_store, :key => '_the_sortable_tree_test_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # TheSortableTreeTest::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters :format => [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,28 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
6
+
7
+ pages:
8
+ sortable:
9
+ base:
10
+ new:
11
+ create: Add element
12
+ controls:
13
+ edit_this: Edit element
14
+ delete: Delete element
15
+ delete_confirm: Do you want to delete element?
16
+ cant_be_deleted: Cant be deleted. Has nested elements
17
+ delete_nested_elements: Delete all nested elements
18
+
19
+ sortable_issue_11:
20
+ base:
21
+ new:
22
+ create: Add element
23
+ controls:
24
+ edit_this: Edit element
25
+ delete: Delete element
26
+ delete_confirm: Do you want to delete element?
27
+ cant_be_deleted: Cant be deleted. Has nested elements
28
+ delete_nested_elements: Delete all nested elements
@@ -0,0 +1,47 @@
1
+ TheSortableTreeTest::Application.routes.draw do
2
+ get "category/index"
3
+
4
+ get "category/manage"
5
+
6
+ root :to => 'welcome#index'
7
+
8
+ resources :pages do
9
+ collection do
10
+ get :nested_options, :manage, :node_manage, :expand
11
+ post :rebuild, :expand_node
12
+ end
13
+ end
14
+
15
+ namespace :admin do
16
+ resources :pages do
17
+ collection do
18
+ get :nested_options, :manage, :node_manage
19
+ post :rebuild
20
+ end
21
+ end
22
+ end
23
+
24
+ resources :article_categories do
25
+ collection do
26
+ get :manage
27
+ post :rebuild
28
+ end
29
+ end
30
+
31
+ namespace :inventory do
32
+ resources :categories do
33
+ collection do
34
+ get :manage
35
+ post :rebuild
36
+ end
37
+ end
38
+ end
39
+
40
+ # resources :comments do
41
+ # collection do
42
+ # post :rebuild
43
+ # get :manage
44
+ # get :comments
45
+ # end
46
+ # end
47
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run TheSortableTreeTest::Application
@@ -0,0 +1,16 @@
1
+ class CreatePages < ActiveRecord::Migration
2
+ def change
3
+ create_table :pages do |t|
4
+ t.string :title
5
+ t.text :content
6
+ t.text :secret_field
7
+
8
+ t.integer :parent_id
9
+ t.integer :lft
10
+ t.integer :rgt
11
+ t.integer :depth
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateArticleCategories < ActiveRecord::Migration
2
+ def change
3
+ create_table :article_categories do |t|
4
+ t.string :title
5
+ t.text :content
6
+ t.text :secret_field
7
+
8
+ t.integer :parent_id
9
+ t.integer :lft
10
+ t.integer :rgt
11
+ t.integer :depth
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateInventoryCategories < ActiveRecord::Migration
2
+ def change
3
+ create_table :inventory_categories do |t|
4
+ t.string :title
5
+ t.text :content
6
+ t.text :secret_field
7
+
8
+ t.integer :parent_id
9
+ t.integer :lft
10
+ t.integer :rgt
11
+ t.integer :depth
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateAdminPages < ActiveRecord::Migration
2
+ def change
3
+ create_table :admin_pages do |t|
4
+ t.string :title
5
+ t.text :content
6
+ t.text :secret_field
7
+
8
+ t.integer :parent_id
9
+ t.integer :lft
10
+ t.integer :rgt
11
+ t.integer :depth
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
File without changes
@@ -0,0 +1,64 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20130128160328) do
15
+
16
+ create_table "admin_pages", :force => true do |t|
17
+ t.string "title"
18
+ t.text "content"
19
+ t.text "secret_field"
20
+ t.integer "parent_id"
21
+ t.integer "lft"
22
+ t.integer "rgt"
23
+ t.integer "depth"
24
+ t.datetime "created_at", :null => false
25
+ t.datetime "updated_at", :null => false
26
+ end
27
+
28
+ create_table "article_categories", :force => true do |t|
29
+ t.string "title"
30
+ t.text "content"
31
+ t.text "secret_field"
32
+ t.integer "parent_id"
33
+ t.integer "lft"
34
+ t.integer "rgt"
35
+ t.integer "depth"
36
+ t.datetime "created_at", :null => false
37
+ t.datetime "updated_at", :null => false
38
+ end
39
+
40
+ create_table "inventory_categories", :force => true do |t|
41
+ t.string "title"
42
+ t.text "content"
43
+ t.text "secret_field"
44
+ t.integer "parent_id"
45
+ t.integer "lft"
46
+ t.integer "rgt"
47
+ t.integer "depth"
48
+ t.datetime "created_at", :null => false
49
+ t.datetime "updated_at", :null => false
50
+ end
51
+
52
+ create_table "pages", :force => true do |t|
53
+ t.string "title"
54
+ t.text "content"
55
+ t.text "secret_field"
56
+ t.integer "parent_id"
57
+ t.integer "lft"
58
+ t.integer "rgt"
59
+ t.integer "depth"
60
+ t.datetime "created_at", :null => false
61
+ t.datetime "updated_at", :null => false
62
+ end
63
+
64
+ end
@@ -0,0 +1,96 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Emanuel', :city => cities.first)
8
+
9
+ @text_1 = "Unsafe content <script>alert(1)</script>!!! ' ' \" "
10
+ @text_2 = "<script>alert('!!! Some Secret word !!!')</script> It's should be removed from JSON"
11
+
12
+ @counter_1 = 0
13
+
14
+ def build_test_tree klass = Page, count = 5
15
+ count.times do |book_i|
16
+ var = klass.new
17
+ var.title = "Book #{book_i}"
18
+ var.content = @text_1 + Faker::Lorem.sentence(5)
19
+ var.secret_field = @text_2
20
+ var.save
21
+
22
+ @counter_1 = @counter_1.next
23
+ puts '.' + @counter_1.to_s
24
+
25
+ count.times do |chapter_i|
26
+ var1 = klass.new
27
+ var1.title = "Chapter #{chapter_i}"
28
+ var1.content = @text_1 + Faker::Lorem.sentence(5)
29
+ var1.secret_field = @text_2
30
+ var1.save
31
+ var1.move_to_child_of var
32
+
33
+ @counter_1 = @counter_1.next
34
+ puts '..' + @counter_1.to_s
35
+
36
+ count.times do |page_i|
37
+ var2 = klass.new
38
+ var2.title = "Page #{page_i}"
39
+ var2.content = @text_1 + Faker::Lorem.sentence(25)
40
+ var2.secret_field = @text_2
41
+ var2.save
42
+
43
+ var2.move_to_child_of var1
44
+ @counter_1 = @counter_1.next
45
+ puts '...' + @counter_1.to_s
46
+ end
47
+ end
48
+ end
49
+
50
+ puts klass.to_s
51
+ puts klass.count
52
+ end
53
+
54
+ build_test_tree Page, 4
55
+
56
+ build_test_tree ArticleCategory, 4
57
+
58
+ build_test_tree Inventory::Category, 4
59
+ build_test_tree Admin::Page, 4
60
+
61
+ # def build_test_comments count = 3
62
+ # count.times do
63
+ # var = Comment.new
64
+ # var.name = Faker::Name.name
65
+ # var.email = Faker::Internet.free_email
66
+ # var.raw_content = Faker::Lorem.sentence(2)
67
+ # var.save
68
+
69
+ # puts '.'
70
+ # count.times do
71
+ # var1 = Comment.new
72
+ # var1.name = Faker::Name.name
73
+ # var1.email = Faker::Internet.free_email
74
+ # var1.raw_content = Faker::Lorem.sentence(2)
75
+ # var1.save
76
+
77
+ # var1.move_to_child_of var
78
+ # puts '..'
79
+
80
+ # count.times do
81
+ # var2 = Comment.new
82
+ # var2.name = Faker::Name.name
83
+ # var2.email = Faker::Internet.free_email
84
+ # var2.raw_content = Faker::Lorem.sentence(2)
85
+ # var2.save
86
+
87
+ # var2.move_to_child_of var1
88
+ # puts '...'
89
+ # end
90
+ # end
91
+ # end
92
+ # puts 'Comments'
93
+ # puts Comment.count
94
+ # end
95
+
96
+ # build_test_comments 4
File without changes
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.