obitum-rails_admin 0.0.1 → 0.0.2

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 (232) hide show
  1. data/Gemfile +1 -8
  2. data/README.md +6 -2
  3. data/app/assets/javascripts/rails_admin/custom/ui.js +5 -5
  4. data/app/assets/javascripts/rails_admin/jquery-ui-1.8.16.custom.js +4727 -4727
  5. data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -484
  6. data/app/assets/javascripts/rails_admin/jquery.pjax.js +250 -85
  7. data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -1219
  8. data/app/assets/javascripts/rails_admin/ra.filter-box.js +30 -30
  9. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +11 -11
  10. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +40 -0
  11. data/app/assets/javascripts/rails_admin/ra.remote-form.js +41 -39
  12. data/app/assets/javascripts/rails_admin/rails_admin.js.erb +4 -3
  13. data/app/assets/javascripts/rails_admin/themes/default/ui.js +6 -6
  14. data/app/assets/javascripts/rails_admin/ui.js.coffee +44 -16
  15. data/app/assets/stylesheets/rails_admin/base/README +2 -2
  16. data/app/assets/stylesheets/rails_admin/base/theming.css.scss +226 -113
  17. data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +1 -1
  18. data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +2 -2
  19. data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +3 -3
  20. data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +36 -1
  21. data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +16 -0
  22. data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +2 -2
  23. data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +1 -1
  24. data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +2 -2
  25. data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +3 -3
  26. data/app/controllers/rails_admin/application_controller.rb +13 -18
  27. data/app/controllers/rails_admin/main_controller.rb +15 -16
  28. data/app/helpers/rails_admin/application_helper.rb +67 -41
  29. data/app/helpers/rails_admin/form_builder.rb +31 -29
  30. data/app/helpers/rails_admin/main_helper.rb +4 -4
  31. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -11
  32. data/app/views/layouts/rails_admin/application.html.haml +29 -29
  33. data/app/views/rails_admin/main/_dashboard_history.html.haml +1 -1
  34. data/app/views/rails_admin/main/_delete_notice.html.haml +4 -5
  35. data/app/views/rails_admin/main/_form_colorpicker.html.haml +2 -1
  36. data/app/views/rails_admin/main/_form_datetime.html.haml +1 -1
  37. data/app/views/rails_admin/main/_form_enumeration.html.haml +1 -1
  38. data/app/views/rails_admin/main/_form_field.html.haml +1 -1
  39. data/app/views/rails_admin/main/_form_file_upload.html.haml +3 -2
  40. data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +6 -4
  41. data/app/views/rails_admin/main/_form_filtering_select.html.haml +6 -5
  42. data/app/views/rails_admin/main/_form_nested_many.html.haml +41 -6
  43. data/app/views/rails_admin/main/_form_nested_one.html.haml +34 -5
  44. data/app/views/rails_admin/main/_form_text.html.haml +3 -3
  45. data/app/views/rails_admin/main/_submit_buttons.html.haml +6 -4
  46. data/app/views/rails_admin/main/bulk_delete.html.haml +7 -3
  47. data/app/views/rails_admin/main/dashboard.html.haml +4 -4
  48. data/app/views/rails_admin/main/delete.html.haml +7 -3
  49. data/app/views/rails_admin/main/edit.html.haml +1 -1
  50. data/app/views/rails_admin/main/export.html.haml +57 -53
  51. data/app/views/rails_admin/main/history.html.haml +8 -8
  52. data/app/views/rails_admin/main/index.html.haml +22 -21
  53. data/app/views/rails_admin/main/new.html.haml +1 -1
  54. data/app/views/rails_admin/main/show.html.haml +2 -2
  55. data/config/initializers/active_record_extensions.rb +2 -2
  56. data/config/initializers/haml.rb +0 -1
  57. data/config/locales/rails_admin.en.yml +5 -5
  58. data/lib/generators/rails_admin/templates/initializer.erb +7 -7
  59. data/lib/rails_admin/abstract_model.rb +36 -53
  60. data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
  61. data/lib/rails_admin/adapters/active_record.rb +56 -137
  62. data/lib/rails_admin/config/actions/base.rb +40 -28
  63. data/lib/rails_admin/config/actions/bulk_delete.rb +10 -11
  64. data/lib/rails_admin/config/actions/dashboard.rb +9 -5
  65. data/lib/rails_admin/config/actions/delete.rb +12 -9
  66. data/lib/rails_admin/config/actions/edit.rb +13 -9
  67. data/lib/rails_admin/config/actions/export.rb +9 -6
  68. data/lib/rails_admin/config/actions/history_index.rb +9 -5
  69. data/lib/rails_admin/config/actions/history_show.rb +9 -5
  70. data/lib/rails_admin/config/actions/index.rb +23 -13
  71. data/lib/rails_admin/config/actions/new.rb +14 -10
  72. data/lib/rails_admin/config/actions/show.rb +10 -5
  73. data/lib/rails_admin/config/actions/show_in_app.rb +9 -4
  74. data/lib/rails_admin/config/actions.rb +16 -16
  75. data/lib/rails_admin/config/configurable.rb +92 -0
  76. data/lib/rails_admin/config/fields/association.rb +6 -23
  77. data/lib/rails_admin/config/fields/base.rb +58 -40
  78. data/lib/rails_admin/config/fields/factories/belongs_to_association.rb +26 -0
  79. data/lib/rails_admin/config/fields/factories/carrierwave.rb +21 -2
  80. data/lib/rails_admin/config/fields/factories/devise.rb +9 -12
  81. data/lib/rails_admin/config/fields/factories/dragonfly.rb +13 -7
  82. data/lib/rails_admin/config/fields/factories/paperclip.rb +14 -15
  83. data/lib/rails_admin/config/fields/group.rb +16 -3
  84. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +2 -2
  85. data/lib/rails_admin/config/fields/types/carrierwave.rb +0 -9
  86. data/lib/rails_admin/config/fields/types/color.rb +3 -3
  87. data/lib/rails_admin/config/fields/types/dragonfly.rb +1 -19
  88. data/lib/rails_admin/config/fields/types/file_upload.rb +7 -11
  89. data/lib/rails_admin/config/fields/types/has_many_association.rb +1 -6
  90. data/lib/rails_admin/config/fields/types/has_one_association.rb +4 -4
  91. data/lib/rails_admin/config/fields/types/paperclip.rb +0 -18
  92. data/lib/rails_admin/config/fields/types/password.rb +2 -2
  93. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +2 -2
  94. data/lib/rails_admin/config/fields/types/text.rb +2 -2
  95. data/lib/rails_admin/config/fields.rb +7 -17
  96. data/lib/rails_admin/config/has_fields.rb +9 -9
  97. data/lib/rails_admin/config/has_groups.rb +2 -2
  98. data/lib/rails_admin/config/hideable.rb +2 -2
  99. data/lib/rails_admin/config/model.rb +23 -17
  100. data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
  101. data/lib/rails_admin/config/proxyable.rb +12 -0
  102. data/lib/rails_admin/config/sections/base.rb +14 -4
  103. data/lib/rails_admin/config.rb +38 -9
  104. data/lib/rails_admin/extension.rb +1 -1
  105. data/lib/rails_admin/extensions/history/auditing_adapter.rb +6 -6
  106. data/lib/rails_admin/extensions/history/history.rb +2 -1
  107. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +13 -13
  108. data/lib/rails_admin/support/csv_converter.rb +6 -6
  109. data/lib/rails_admin/version.rb +1 -1
  110. data/lib/rails_admin.rb +0 -5
  111. data/spec/controllers/main_controller_spec.rb +7 -7
  112. data/spec/dummy_app/Gemfile +10 -7
  113. data/spec/dummy_app/Rakefile +1 -1
  114. data/spec/dummy_app/app/assets/images/rails.png +0 -0
  115. data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
  116. data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
  117. data/spec/dummy_app/app/controllers/players_controller.rb +1 -1
  118. data/spec/dummy_app/app/models/cms/basic_page.rb +1 -1
  119. data/spec/dummy_app/app/models/division.rb +5 -1
  120. data/spec/dummy_app/app/models/field_test.rb +4 -4
  121. data/spec/dummy_app/app/models/nested_field_test.rb +3 -0
  122. data/spec/dummy_app/app/models/player.rb +3 -3
  123. data/spec/dummy_app/app/views/layouts/application.html.erb +3 -2
  124. data/spec/dummy_app/app/views/players/show.html.haml +1 -1
  125. data/spec/dummy_app/config/application.rb +20 -5
  126. data/spec/dummy_app/config/database.yml +5 -2
  127. data/spec/dummy_app/config/environments/development.rb +11 -1
  128. data/spec/dummy_app/config/environments/production.rb +19 -3
  129. data/spec/dummy_app/config/environments/test.rb +5 -7
  130. data/spec/dummy_app/config/initializers/devise.rb +6 -0
  131. data/spec/dummy_app/config/initializers/inflections.rb +5 -0
  132. data/spec/dummy_app/config/initializers/secret_token.rb +1 -1
  133. data/spec/dummy_app/{foo/test/dummy/config → config}/initializers/wrap_parameters.rb +1 -1
  134. data/spec/dummy_app/config/routes.rb +1 -1
  135. data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +35 -5
  136. data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +1 -1
  137. data/spec/dummy_app/doc/README_FOR_APP +2 -0
  138. data/spec/dummy_app/public/404.html +26 -0
  139. data/spec/dummy_app/{foo/test/dummy/public → public}/422.html +0 -0
  140. data/spec/dummy_app/{foo/test/dummy/public → public}/500.html +0 -1
  141. data/spec/dummy_app/public/favicon.ico +0 -0
  142. data/spec/dummy_app/public/robots.txt +5 -0
  143. data/spec/helpers/application_helper_spec.rb +107 -42
  144. data/spec/{requests → integration}/authorization/cancan_spec.rb +4 -5
  145. data/spec/{requests → integration}/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +0 -0
  146. data/spec/{requests → integration}/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +3 -16
  147. data/spec/{requests → integration}/basic/create/rails_admin_basic_create_spec.rb +0 -2
  148. data/spec/{requests → integration}/basic/create/rails_admin_namespaced_model_create_spec.rb +0 -16
  149. data/spec/{requests → integration}/basic/delete/rails_admin_basic_delete_spec.rb +0 -0
  150. data/spec/{requests → integration}/basic/destroy/rails_admin_basic_destroy_spec.rb +0 -0
  151. data/spec/{requests → integration}/basic/edit/rails_admin_basic_edit_spec.rb +2 -2
  152. data/spec/{requests → integration}/basic/export/rails_admin_basic_export_spec.rb +1 -1
  153. data/spec/{requests → integration}/basic/list/rails_admin_basic_list_spec.rb +12 -38
  154. data/spec/{requests → integration}/basic/new/rails_admin_basic_new_spec.rb +0 -0
  155. data/spec/{requests → integration}/basic/new/rails_admin_namespaced_model_new_spec.rb +0 -0
  156. data/spec/{requests → integration}/basic/show/rails_admin_basic_show_spec.rb +1 -2
  157. data/spec/{requests → integration}/basic/update/rails_admin_basic_update_spec.rb +2 -2
  158. data/spec/{requests → integration}/config/edit/rails_admin_config_edit_spec.rb +65 -24
  159. data/spec/{requests → integration}/config/list/rails_admin_config_list_spec.rb +2 -2
  160. data/spec/{requests → integration}/config/show/rails_admin_config_show_spec.rb +20 -0
  161. data/spec/{requests → integration}/history/rails_admin_history_spec.rb +3 -3
  162. data/spec/{requests → integration}/rails_admin_spec.rb +8 -41
  163. data/spec/{requests → integration}/relation_spec.rb +0 -0
  164. data/spec/spec_helper.rb +13 -31
  165. data/spec/{lib → unit/adapters/active_record}/abstract_object_spec.rb +17 -5
  166. data/spec/unit/adapters/active_record_spec.rb +53 -0
  167. data/spec/{requests/actions.rb → unit/config/actions_spec.rb} +47 -31
  168. data/spec/unit/config/fields/base_spec.rb +291 -0
  169. data/spec/unit/config/model_spec.rb +75 -0
  170. data/spec/unit/config/sections_spec.rb +123 -0
  171. data/spec/{lib/rails_admin_spec.rb → unit/config_spec.rb} +65 -93
  172. metadata +127 -223
  173. data/app/assets/javascripts/rails_admin/jquery_nested_form.js +0 -58
  174. data/app/views/layouts/rails_admin/_navigation.html.haml +0 -17
  175. data/lib/rails_admin/abstract_object.rb +0 -28
  176. data/lib/rails_admin/config/base.rb +0 -111
  177. data/lib/rails_admin/config/proxy.rb +0 -40
  178. data/lib/rails_admin/generic_support.rb +0 -18
  179. data/spec/dummy_app/config/initializers/quiet_assets.rb +0 -10
  180. data/spec/dummy_app/foo/Gemfile +0 -17
  181. data/spec/dummy_app/foo/MIT-LICENSE +0 -20
  182. data/spec/dummy_app/foo/README.rdoc +0 -3
  183. data/spec/dummy_app/foo/Rakefile +0 -39
  184. data/spec/dummy_app/foo/app/assets/javascripts/foo/application.js +0 -9
  185. data/spec/dummy_app/foo/app/assets/stylesheets/foo/application.css +0 -7
  186. data/spec/dummy_app/foo/app/controllers/foo/application_controller.rb +0 -4
  187. data/spec/dummy_app/foo/app/helpers/foo/application_helper.rb +0 -4
  188. data/spec/dummy_app/foo/app/models/foo/bar.rb +0 -4
  189. data/spec/dummy_app/foo/app/views/layouts/foo/application.html.erb +0 -14
  190. data/spec/dummy_app/foo/config/routes.rb +0 -2
  191. data/spec/dummy_app/foo/foo.gemspec +0 -23
  192. data/spec/dummy_app/foo/lib/foo/engine.rb +0 -5
  193. data/spec/dummy_app/foo/lib/foo/version.rb +0 -3
  194. data/spec/dummy_app/foo/lib/foo.rb +0 -4
  195. data/spec/dummy_app/foo/lib/tasks/foo_tasks.rake +0 -4
  196. data/spec/dummy_app/foo/script/rails +0 -6
  197. data/spec/dummy_app/foo/test/dummy/Rakefile +0 -7
  198. data/spec/dummy_app/foo/test/dummy/app/assets/javascripts/application.js +0 -9
  199. data/spec/dummy_app/foo/test/dummy/app/assets/stylesheets/application.css +0 -7
  200. data/spec/dummy_app/foo/test/dummy/app/controllers/application_controller.rb +0 -3
  201. data/spec/dummy_app/foo/test/dummy/app/helpers/application_helper.rb +0 -2
  202. data/spec/dummy_app/foo/test/dummy/app/views/layouts/application.html.erb +0 -14
  203. data/spec/dummy_app/foo/test/dummy/config/application.rb +0 -45
  204. data/spec/dummy_app/foo/test/dummy/config/boot.rb +0 -10
  205. data/spec/dummy_app/foo/test/dummy/config/database.yml +0 -25
  206. data/spec/dummy_app/foo/test/dummy/config/environment.rb +0 -5
  207. data/spec/dummy_app/foo/test/dummy/config/environments/development.rb +0 -30
  208. data/spec/dummy_app/foo/test/dummy/config/environments/production.rb +0 -60
  209. data/spec/dummy_app/foo/test/dummy/config/environments/test.rb +0 -39
  210. data/spec/dummy_app/foo/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  211. data/spec/dummy_app/foo/test/dummy/config/initializers/inflections.rb +0 -10
  212. data/spec/dummy_app/foo/test/dummy/config/initializers/mime_types.rb +0 -5
  213. data/spec/dummy_app/foo/test/dummy/config/initializers/secret_token.rb +0 -7
  214. data/spec/dummy_app/foo/test/dummy/config/initializers/session_store.rb +0 -8
  215. data/spec/dummy_app/foo/test/dummy/config/locales/en.yml +0 -5
  216. data/spec/dummy_app/foo/test/dummy/config/routes.rb +0 -4
  217. data/spec/dummy_app/foo/test/dummy/config.ru +0 -4
  218. data/spec/dummy_app/foo/test/dummy/db/schema.rb +0 -21
  219. data/spec/dummy_app/foo/test/dummy/public/404.html +0 -26
  220. data/spec/dummy_app/foo/test/dummy/public/favicon.ico +0 -0
  221. data/spec/dummy_app/foo/test/dummy/script/rails +0 -6
  222. data/spec/dummy_app/foo/test/fixtures/foo/bars.yml +0 -11
  223. data/spec/dummy_app/foo/test/foo_test.rb +0 -7
  224. data/spec/dummy_app/foo/test/integration/navigation_test.rb +0 -10
  225. data/spec/dummy_app/foo/test/test_helper.rb +0 -10
  226. data/spec/dummy_app/foo/test/unit/foo/bar_test.rb +0 -9
  227. data/spec/generator_helpers.rb +0 -30
  228. data/spec/generators/install_generator_spec.rb +0 -85
  229. data/spec/generators/uninstall_generator_spec.rb +0 -35
  230. data/spec/lib/custom_field.rb +0 -7
  231. data/spec/requests/config/navigation/rails_admin_config_navigation_spec.rb +0 -107
  232. data/spec/requests/config/rails_admin_config_spec.rb +0 -227
@@ -1,20 +1,20 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe RailsAdmin::MainController do
4
-
5
-
4
+
5
+
6
6
  describe "get_sort_hash" do
7
7
  it 'should work with belongs_to associations with label method virtual' do
8
8
  controller.params = { :sort => "parent_category", :model_name =>"categories" }
9
9
  controller.send(:get_sort_hash, RailsAdmin.config(Category)).should == {:sort=>"categories.parent_category_id", :sort_reverse=>true}
10
10
  end
11
-
11
+
12
12
  it 'should work with belongs_to associations with label method real column' do
13
13
  controller.params = { :sort => "team", :model_name =>"players" }
14
14
  controller.send(:get_sort_hash, RailsAdmin.config(Player)).should == {:sort=>"teams.name", :sort_reverse=>true}
15
15
  end
16
16
  end
17
-
17
+
18
18
  describe "list_entries called from view" do
19
19
  before do
20
20
  @teams = 40.times.map { FactoryGirl.create :team }
@@ -107,8 +107,8 @@ describe RailsAdmin::MainController do
107
107
  controller.list_entries.length.should == @players.size
108
108
 
109
109
  end
110
-
111
-
112
-
110
+
111
+
112
+
113
113
  end
114
114
  end
@@ -1,21 +1,24 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 3.1'
4
- gem 'devise', '~> 1.4'
3
+ gem 'rails', '~> 3.2'
4
+ gem 'devise', '~> 2.0'
5
5
  gem 'rails_admin', :path => '../../'
6
6
  gem 'mlb', '~> 0.5'
7
7
  gem 'paperclip', '~> 2.4'
8
8
  gem 'mini_magick'
9
9
  gem 'carrierwave'
10
10
  gem 'dragonfly'
11
- gem 'foo', :path => './foo'
12
11
 
13
12
  # Gems used only for assets and not required
14
13
  # in production environments by default.
15
14
  group :assets do
16
- gem 'sass-rails', '~> 3.1'
17
- gem 'coffee-rails', '~> 3.1'
18
- gem 'uglifier', '~> 1.0'
15
+ gem 'sass-rails', '~> 3.2'
16
+ gem 'coffee-rails', '~> 3.2'
17
+
18
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
19
+ # gem 'therubyracer'
20
+
21
+ gem 'uglifier', '>= 1.0.3'
19
22
  end
20
23
 
21
24
  group :development, :test do
@@ -1,7 +1,7 @@
1
+ #!/usr/bin/env rake
1
2
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
3
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
4
 
4
5
  require File.expand_path('../config/application', __FILE__)
5
- require 'rake'
6
6
 
7
7
  DummyApp::Application.load_tasks
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -2,4 +2,4 @@ class PlayersController < ApplicationController
2
2
  def show
3
3
  @player = Player.find(params[:id])
4
4
  end
5
- end
5
+ end
@@ -1,6 +1,6 @@
1
1
  module Cms
2
2
  class BasicPage < ActiveRecord::Base
3
- set_table_name :cms_basic_pages
3
+ self.table_name = :cms_basic_pages
4
4
 
5
5
  validates :title, :content, :presence => true
6
6
  end
@@ -1,5 +1,9 @@
1
1
  class Division < ActiveRecord::Base
2
- set_primary_key :custom_id
2
+ if Rails.version < '3.2'
3
+ set_primary_key :custom_id
4
+ else
5
+ self.primary_key = :custom_id
6
+ end
3
7
  validates_numericality_of(:custom_league_id, :only_integer => true)
4
8
  validates_presence_of(:name)
5
9
 
@@ -1,16 +1,16 @@
1
1
  class FieldTest < ActiveRecord::Base
2
-
2
+
3
3
 
4
4
  attr_accessible :comment_attributes, :nested_field_tests_attributes, :dragonfly_asset, :remove_dragonfly_asset, :retained_dragonfly_asset, :carrierwave_asset, :carrierwave_asset_cache, :remove_carrierwave_asset, :paperclip_asset, :delete_paperclip_asset, :comment_id, :string_field, :text_field, :integer_field, :float_field, :decimal_field, :datetime_field, :timestamp_field, :time_field, :date_field, :boolean_field, :created_at, :updated_at, :format
5
5
  attr_accessible :comment_attributes, :nested_field_tests_attributes, :dragonfly_asset, :remove_dragonfly_asset, :retained_dragonfly_asset, :carrierwave_asset, :carrierwave_asset_cache, :remove_carrierwave_asset, :paperclip_asset, :delete_paperclip_asset, :comment_id, :string_field, :text_field, :integer_field, :float_field, :decimal_field, :datetime_field, :timestamp_field, :time_field, :date_field, :boolean_field, :created_at, :updated_at, :format, :restricted_field, :as => :custom_role
6
6
  attr_accessible :comment_attributes, :nested_field_tests_attributes, :dragonfly_asset, :remove_dragonfly_asset, :retained_dragonfly_asset, :carrierwave_asset, :carrierwave_asset_cache, :remove_carrierwave_asset, :paperclip_asset, :delete_paperclip_asset, :comment_id, :string_field, :text_field, :integer_field, :float_field, :decimal_field, :datetime_field, :timestamp_field, :time_field, :date_field, :boolean_field, :created_at, :updated_at, :format, :protected_field, :as => :extra_safe_role
7
-
7
+
8
8
  has_many :nested_field_tests, :dependent => :destroy, :inverse_of => :field_test
9
9
  accepts_nested_attributes_for :nested_field_tests, :allow_destroy => true
10
-
10
+
11
11
  has_one :comment, :as => :commentable
12
12
  accepts_nested_attributes_for :comment, :allow_destroy => true
13
-
13
+
14
14
  has_attached_file :paperclip_asset, :styles => { :thumb => "100x100>" }
15
15
  attr_accessor :delete_paperclip_asset
16
16
  before_validation { self.paperclip_asset = nil if self.delete_paperclip_asset == '1' }
@@ -1,3 +1,6 @@
1
1
  class NestedFieldTest < ActiveRecord::Base
2
2
  belongs_to :field_test, :inverse_of => :nested_field_tests
3
+
4
+ has_one :comment, :as => :commentable
5
+ accepts_nested_attributes_for :comment, :allow_destroy => true, :reject_if => proc { |attributes| attributes["content"].blank? }
3
6
  end
@@ -9,14 +9,14 @@ class Player < ActiveRecord::Base
9
9
 
10
10
  belongs_to :team, :inverse_of => :players
11
11
  has_one :draft, :dependent => :destroy
12
-
12
+
13
13
  has_many :comments, :as => :commentable
14
14
  attr_protected :suspended
15
-
15
+
16
16
  def draft_id
17
17
  self.draft.try :id
18
18
  end
19
-
19
+
20
20
  def draft_id=(id)
21
21
  self.draft = Draft.find_by_id(id)
22
22
  end
@@ -2,8 +2,9 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>DummyApp</title>
5
- <%= stylesheet_link_tag :all %>
6
- <%= csrf_meta_tag %>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
7
8
  </head>
8
9
  <body>
9
10
 
@@ -1 +1 @@
1
- %h1=@player.name
1
+ %h1=@player.name
@@ -4,10 +4,13 @@ require 'rails/all'
4
4
  require 'devise'
5
5
  require 'paperclip'
6
6
  require 'carrierwave'
7
- # If you have a Gemfile, require the default gems, the ones in the
8
- # current environment and also include :assets gems if in development
9
- # or test environments.
10
- Bundler.require *Rails.groups(:assets) if defined?(Bundler)
7
+
8
+ if defined?(Bundler)
9
+ # If you precompile assets before deploying to production, use this line
10
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
11
+ # If you want your assets lazily compiled in production, use this line
12
+ # Bundler.require(:default, :assets, Rails.env)
13
+ end
11
14
 
12
15
  module DummyApp
13
16
  class Application < Rails::Application
@@ -39,9 +42,21 @@ module DummyApp
39
42
  # Configure sensitive parameters which will be filtered from the log file.
40
43
  config.filter_parameters += [:password]
41
44
 
45
+ # Use SQL instead of Active Record's schema dumper when creating the database.
46
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
47
+ # like if you have constraints or database-specific column types
48
+ # config.active_record.schema_format = :sql
49
+
50
+ # Enforce whitelist mode for mass assignment.
51
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
52
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
53
+ # parameters by using an attr_accessible or attr_protected declaration.
54
+ # config.active_record.whitelist_attributes = true
55
+
42
56
  # Enable the asset pipeline
43
57
  config.assets.enabled = true
44
58
 
45
- config.autoload_paths += Dir["#{config.root}/app/models/**/"]
59
+ # Version of your assets, change this if you want to expire all your assets
60
+ config.assets.version = '1.0'
46
61
  end
47
62
  end
@@ -1,5 +1,8 @@
1
1
  # SQLite version 3.x
2
- # gem i sqlite3
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
3
6
  development:
4
7
  adapter: sqlite3
5
8
  database: db/development.sqlite3
@@ -11,7 +14,7 @@ development:
11
14
  # Do not set this db to the same as development or production.
12
15
  test:
13
16
  adapter: sqlite3
14
- database: ':memory:'
17
+ database: db/test.sqlite3
15
18
  pool: 5
16
19
  timeout: 5000
17
20
 
@@ -2,7 +2,7 @@ DummyApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
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
5
+ # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
@@ -22,6 +22,16 @@ DummyApp::Application.configure do
22
22
  # Only use best-standards-support built into browsers
23
23
  config.action_dispatch.best_standards_support = :builtin
24
24
 
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ # config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
25
32
  # Do not compress assets
26
33
  config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
27
37
  end
@@ -14,9 +14,18 @@ DummyApp::Application.configure do
14
14
  # Compress JavaScripts and CSS
15
15
  config.assets.compress = true
16
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
+
17
26
  # Specifies the header that your server uses for sending files
18
- # (comment out if your front-end server doesn't support this)
19
- config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
20
29
 
21
30
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
22
31
  # config.force_ssl = true
@@ -24,8 +33,11 @@ DummyApp::Application.configure do
24
33
  # See everything in the log (default is :info)
25
34
  # config.log_level = :debug
26
35
 
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
27
39
  # Use a different logger for distributed setups
28
- # config.logger = SyslogLogger.new
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
29
41
 
30
42
  # Use a different cache store in production
31
43
  # config.cache_store = :mem_cache_store
@@ -48,4 +60,8 @@ DummyApp::Application.configure do
48
60
 
49
61
  # Send deprecation notices to registered listeners
50
62
  config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
51
67
  end
@@ -2,9 +2,9 @@ DummyApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
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
5
+ # test suite. You never need to work with it otherwise. Remember that
6
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!
7
+ # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
10
  # Configure static asset server for tests with Cache-Control for performance
@@ -19,7 +19,7 @@ DummyApp::Application.configure do
19
19
  config.action_controller.perform_caching = false
20
20
 
21
21
  # Raise exceptions instead of rendering exception templates
22
- config.action_dispatch.show_exceptions = true
22
+ # config.action_dispatch.show_exceptions = false
23
23
 
24
24
  # Disable request forgery protection in test environment
25
25
  config.action_controller.allow_forgery_protection = false
@@ -29,10 +29,8 @@ DummyApp::Application.configure do
29
29
  # ActionMailer::Base.deliveries array.
30
30
  config.action_mailer.delivery_method = :test
31
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
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ # config.active_record.mass_assignment_sanitizer = :strict
36
34
 
37
35
  # Print deprecation notices to the stderr
38
36
  config.active_support.deprecation = :stderr
@@ -1,6 +1,12 @@
1
1
  # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
2
  # four configuration values can also be set straight in your models.
3
+
3
4
  Devise.setup do |config|
5
+ # 2.0 deprecations
6
+ config.case_insensitive_keys = []
7
+ config.use_salt_as_remember_token = true
8
+ config.reset_password_within = 6.hours
9
+
4
10
  # ==> Mailer Configuration
5
11
  # Configure the e-mail address which will be shown in DeviseMailer.
6
12
  config.mailer_sender = "please-change-me@config-initializers-devise.com"
@@ -8,3 +8,8 @@
8
8
  # inflect.irregular 'person', 'people'
9
9
  # inflect.uncountable %w( fish sheep )
10
10
  # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- DummyApp::Application.config.secret_token = '2e733773e594846c6bb87fe0d0bb8e70ea81d334fccdbceca5b05ede2e61f10ea98add53783bf333d8d5523e001f4d7045d71c57ab288e279626c49b18810f9e'
7
+ DummyApp::Application.config.secret_token = 'e05799a4d22b29ad6cef7cc8c423f610f2d694327aae568d7112801f2f0ef6be3c9c9e056358f7a969be7a8a9a33351261d12bb0a25a7645aa1982c39a3b2a72'
@@ -5,7 +5,7 @@
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters :format => [:json]
9
9
  end
10
10
 
11
11
  # Disable root element in JSON by default.
@@ -4,7 +4,7 @@ DummyApp::Application.routes.draw do
4
4
 
5
5
  mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
6
6
  devise_for :users
7
- root :to => "rails_admin::Main#dashboard"
7
+ root :to => "rails_admin::Main#dashboard"
8
8
  # https://github.com/sferik/rails_admin/issues/362
9
9
  match ':controller(/:action(/:id(.:format)))'
10
10
  end
@@ -1,11 +1,41 @@
1
1
  class DeviseCreateUsers < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :users do |t|
4
- t.database_authenticatable :null => false
5
- t.recoverable
6
- t.rememberable
7
- t.trackable
8
- t.encryptable
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Encryptable
23
+ t.string :password_salt
24
+
25
+ ## Confirmable
26
+ # t.string :confirmation_token
27
+ # t.datetime :confirmed_at
28
+ # t.datetime :confirmation_sent_at
29
+ # t.string :unconfirmed_email # Only if using reconfirmable
30
+
31
+ ## Lockable
32
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
33
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
34
+ # t.datetime :locked_at
35
+
36
+ # Token authenticatable
37
+ # t.string :authentication_token
38
+
9
39
  t.timestamps
10
40
  end
11
41
 
@@ -2,6 +2,6 @@ class AddCategories < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :categories do |t|
4
4
  t.integer :parent_category_id
5
- end
5
+ end
6
6
  end
7
7
  end
@@ -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.
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -20,7 +20,6 @@
20
20
  <!-- This file lives in public/500.html -->
21
21
  <div class="dialog">
22
22
  <h1>We're sorry, but something went wrong.</h1>
23
- <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
23
  </div>
25
24
  </body>
26
25
  </html>
Binary file
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /