challah 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. data/CHANGELOG.md +11 -1
  2. data/README.md +14 -0
  3. data/app/controllers/{challah/sessions_controller.rb → sessions_controller.rb} +1 -1
  4. data/app/views/{challah/sessions → sessions}/access_denied.html.erb +0 -0
  5. data/app/views/{challah/sessions → sessions}/new.html.erb +0 -0
  6. data/lib/challah.rb +3 -2
  7. data/lib/challah/routes.rb +10 -8
  8. data/lib/challah/version.rb +1 -1
  9. data/test/restrictions_controller_test.rb +1 -1
  10. data/test/routes_test.rb +3 -3
  11. data/test/sessions_controller_test.rb +1 -1
  12. data/vendor/bundle/cache/factory_girl-2.5.1.gem +0 -0
  13. data/vendor/bundle/gems/bcrypt-ruby-3.0.1/ext/mri/bcrypt_ext.bundle +0 -0
  14. data/vendor/bundle/gems/bcrypt-ruby-3.0.1/lib/bcrypt_ext.bundle +0 -0
  15. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/Appraisals +0 -0
  16. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/CONTRIBUTION_GUIDELINES.md +0 -0
  17. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/Changelog +9 -0
  18. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/GETTING_STARTED.md +18 -5
  19. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/Gemfile +0 -0
  20. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/Gemfile.lock +1 -1
  21. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/LICENSE +0 -0
  22. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/README.md +0 -0
  23. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/Rakefile +0 -0
  24. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/cucumber.yml +0 -0
  25. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/features/factory_girl_steps.feature +0 -0
  26. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/features/find_definitions.feature +0 -0
  27. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/features/step_definitions/database_steps.rb +0 -0
  28. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/features/step_definitions/factory_girl_steps.rb +0 -0
  29. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/features/support/env.rb +0 -0
  30. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/features/support/factories.rb +0 -0
  31. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/2.1.gemfile +0 -0
  32. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/2.1.gemfile.lock +1 -1
  33. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/2.3.gemfile +0 -0
  34. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/2.3.gemfile.lock +1 -1
  35. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/3.0.gemfile +0 -0
  36. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/3.0.gemfile.lock +1 -1
  37. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/3.1.gemfile +0 -0
  38. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/3.1.gemfile.lock +1 -1
  39. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/3.2.gemfile +0 -0
  40. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/gemfiles/3.2.gemfile.lock +1 -1
  41. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl.rb +0 -0
  42. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/aliases.rb +0 -0
  43. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute.rb +0 -0
  44. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute/association.rb +0 -0
  45. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute/dynamic.rb +0 -0
  46. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute/sequence.rb +0 -0
  47. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute/static.rb +0 -0
  48. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute_assigner.rb +0 -0
  49. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/attribute_list.rb +0 -0
  50. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/callback.rb +0 -0
  51. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/declaration.rb +0 -0
  52. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/declaration/association.rb +0 -0
  53. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/declaration/dynamic.rb +0 -0
  54. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/declaration/implicit.rb +0 -0
  55. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/declaration/static.rb +0 -0
  56. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/declaration_list.rb +0 -0
  57. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/definition.rb +0 -0
  58. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/definition_proxy.rb +0 -0
  59. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/deprecated.rb +0 -0
  60. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/evaluator.rb +9 -1
  61. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/evaluator_class_definer.rb +0 -0
  62. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/factory.rb +0 -0
  63. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/find_definitions.rb +0 -0
  64. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/null_factory.rb +0 -0
  65. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/null_object.rb +0 -0
  66. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/proxy.rb +0 -0
  67. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/proxy/attributes_for.rb +0 -0
  68. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/proxy/build.rb +0 -0
  69. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/proxy/create.rb +0 -0
  70. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/proxy/stub.rb +0 -0
  71. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/rails2.rb +0 -0
  72. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/registry.rb +0 -0
  73. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/reload.rb +0 -0
  74. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/sequence.rb +0 -0
  75. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/step_definitions.rb +0 -0
  76. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax.rb +0 -0
  77. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/blueprint.rb +0 -0
  78. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/default.rb +2 -1
  79. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/generate.rb +0 -0
  80. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/make.rb +0 -0
  81. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/methods.rb +0 -0
  82. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/sham.rb +0 -0
  83. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/syntax/vintage.rb +0 -0
  84. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/trait.rb +0 -0
  85. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/lib/factory_girl/version.rb +1 -1
  86. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/aliases_spec.rb +0 -0
  87. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/attribute_aliases_spec.rb +0 -0
  88. data/vendor/bundle/gems/factory_girl-2.5.1/spec/acceptance/attribute_existing_on_object_spec.rb +68 -0
  89. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/attributes_for_spec.rb +0 -0
  90. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/attributes_from_instance_spec.rb +0 -0
  91. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/attributes_ordered_spec.rb +0 -0
  92. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/build_list_spec.rb +0 -0
  93. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/build_spec.rb +0 -0
  94. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/build_stubbed_spec.rb +0 -0
  95. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/callbacks_spec.rb +0 -0
  96. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/create_list_spec.rb +0 -0
  97. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/create_spec.rb +0 -0
  98. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/default_strategy_spec.rb +0 -0
  99. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/define_child_before_parent_spec.rb +0 -0
  100. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/definition_spec.rb +0 -0
  101. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/definition_without_block_spec.rb +0 -0
  102. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/initialize_with_spec.rb +0 -0
  103. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/modify_factories_spec.rb +0 -0
  104. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/modify_inherited_spec.rb +0 -0
  105. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/overrides_spec.rb +0 -0
  106. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/parent_spec.rb +23 -0
  107. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/sequence_spec.rb +0 -0
  108. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/stub_spec.rb +0 -0
  109. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/syntax/blueprint_spec.rb +0 -0
  110. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/syntax/generate_spec.rb +0 -0
  111. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/syntax/make_spec.rb +0 -0
  112. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/syntax/sham_spec.rb +0 -0
  113. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/syntax/vintage_spec.rb +0 -0
  114. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/traits_spec.rb +0 -0
  115. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/acceptance/transient_attributes_spec.rb +0 -0
  116. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/aliases_spec.rb +0 -0
  117. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/attribute/association_spec.rb +0 -0
  118. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/attribute/dynamic_spec.rb +0 -0
  119. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/attribute/sequence_spec.rb +0 -0
  120. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/attribute/static_spec.rb +0 -0
  121. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/attribute_list_spec.rb +0 -0
  122. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/attribute_spec.rb +0 -0
  123. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/callback_spec.rb +0 -0
  124. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/declaration/implicit_spec.rb +0 -0
  125. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/declaration_list_spec.rb +0 -0
  126. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/definition_proxy_spec.rb +0 -0
  127. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/definition_spec.rb +0 -0
  128. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/deprecated_spec.rb +0 -0
  129. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/evaluator_class_definer_spec.rb +0 -0
  130. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/factory_spec.rb +0 -0
  131. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/find_definitions_spec.rb +0 -0
  132. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/null_factory_spec.rb +0 -0
  133. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/null_object_spec.rb +0 -0
  134. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/proxy/attributes_for_spec.rb +0 -0
  135. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/proxy/build_spec.rb +0 -0
  136. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/proxy/create_spec.rb +0 -0
  137. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/proxy/stub_spec.rb +0 -0
  138. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/proxy_spec.rb +0 -0
  139. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/registry_spec.rb +0 -0
  140. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl/sequence_spec.rb +0 -0
  141. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/factory_girl_spec.rb +0 -0
  142. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/spec_helper.rb +0 -0
  143. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/support/macros/define_constant.rb +0 -0
  144. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/support/matchers/callback.rb +0 -0
  145. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/support/matchers/declaration.rb +0 -0
  146. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/support/matchers/delegate.rb +0 -0
  147. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/support/matchers/trait.rb +0 -0
  148. data/vendor/bundle/gems/{factory_girl-2.5.0 → factory_girl-2.5.1}/spec/support/shared_examples/proxy.rb +0 -0
  149. data/vendor/bundle/gems/json-1.6.5/ext/json/ext/generator/generator.bundle +0 -0
  150. data/vendor/bundle/gems/json-1.6.5/ext/json/ext/json/ext/generator.bundle +0 -0
  151. data/vendor/bundle/gems/json-1.6.5/ext/json/ext/json/ext/parser.bundle +0 -0
  152. data/vendor/bundle/gems/json-1.6.5/ext/json/ext/parser/parser.bundle +0 -0
  153. data/vendor/bundle/gems/rdiscount-1.6.8/ext/rdiscount.bundle +0 -0
  154. data/vendor/bundle/gems/rdiscount-1.6.8/lib/rdiscount.bundle +0 -0
  155. data/vendor/bundle/gems/sqlite3-1.3.5/ext/sqlite3/mkmf.log +3 -3
  156. data/vendor/bundle/gems/sqlite3-1.3.5/ext/sqlite3/sqlite3_native.bundle +0 -0
  157. data/vendor/bundle/gems/sqlite3-1.3.5/lib/sqlite3/sqlite3_native.bundle +0 -0
  158. data/vendor/bundle/specifications/{factory_girl-2.5.0.gemspec → factory_girl-2.5.1.gemspec} +2 -2
  159. metadata +147 -147
  160. data/vendor/bundle/cache/factory_girl-2.5.0.gem +0 -0
  161. data/vendor/bundle/gems/factory_girl-2.5.0/spec/acceptance/attribute_existing_on_object.rb +0 -21
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
- ## Challah 0.1.0 (unreleased)
1
+ ## Challah 0.3.1
2
+
3
+ * Removed namespacing of controllers and default routes.
4
+ * Added option to not include default routes
5
+
6
+ ## Challah 0.3.0
7
+
8
+ * Documentation clean up.
9
+ * Added rake tasks for creating role, permission and user records.
10
+
11
+ ## Challah 0.2.0
2
12
 
3
13
  * Initial build. Basic functionality for session persistence and authentication.
data/README.md CHANGED
@@ -175,6 +175,20 @@ And of course, you can stack up multiple restrictions get very specific about wh
175
175
 
176
176
  Whichever method you use will yield the same results. Just make sure you are checking for a permission key, and not checking for a role. Checking for roles (i.e.: `user.role_id == 1`) is shameful practice. Use permissions!
177
177
 
178
+ ## Default Routes
179
+
180
+ By default, there are a few routes included with the Challah engine. These routes provide a basic method for a username- and password-based login page. These routes are:
181
+
182
+ GET /login # => SessionsController#new
183
+ POST /login # => SessionsController#create
184
+ GET /logout # => SessionsController#new
185
+
186
+ Feel free to override the `SessionsController` with something more appropriate for your app.
187
+
188
+ If you'd prefer to set up your own login/logout actions, you can skip the inclusion of the default routes by adding the following line to an initializer file in your app:
189
+
190
+ Challah.options[:skip_routes] = true
191
+
178
192
  ## Full documentation
179
193
 
180
194
  Documentation is available at: [http://rubydoc.info/gems/challah](http://rubydoc.info/gems/challah/frames)
@@ -1,4 +1,4 @@
1
- class Challah::SessionsController < ApplicationController
1
+ class SessionsController < ApplicationController
2
2
  before_filter :destroy_session, :except => :create
3
3
 
4
4
  unloadable
data/lib/challah.rb CHANGED
@@ -54,8 +54,9 @@ module Challah
54
54
  def options
55
55
  @options ||= {
56
56
  :cookie_prefix => 'challah',
57
- :access_denied_view => 'challah/sessions/access_denied',
58
- :storage_class => CookieStore
57
+ :access_denied_view => 'sessions/access_denied',
58
+ :storage_class => CookieStore,
59
+ :skip_routes => false
59
60
  }
60
61
  end
61
62
  end
@@ -1,10 +1,12 @@
1
- Rails.application.routes.draw do
2
- match '/_', :to => 'session#index', :as => 'base'
1
+ Rails.application.routes.draw do
2
+ unless Challah.options[:skip_routes]
3
+ match '/login' => 'sessions#create', :as => 'authenticate', :via => :post
4
+ match '/login' => 'sessions#new', :as => 'login', :via => :get
5
+ match '/logout' => 'sessions#destroy', :as => 'logout'
6
+ end
3
7
 
4
- match '/login' => 'challah/sessions#create', :as => 'authenticate', :via => :post
5
- match '/login' => 'challah/sessions#new', :as => 'login', :via => :get
6
- match '/logout' => 'challah/sessions#destroy', :as => 'logout'
7
-
8
- # These are used for testing purposes only.
9
- match '/__challah__/:action', :controller => 'challah/test/restrictions'
8
+ if Rails.env.test?
9
+ # These are used for testing purposes only.
10
+ match '/challah/:action', :controller => 'challah/test/restrictions'
11
+ end
10
12
  end
@@ -1,3 +1,3 @@
1
1
  module Challah
2
- VERSION = "0.3.0" unless defined?(::Challah::VERSION)
2
+ VERSION = "0.3.1" unless defined?(::Challah::VERSION)
3
3
  end
@@ -52,7 +52,7 @@ class RestrictionsControllerTest < ActionController::TestCase
52
52
  should "not get to the new page" do
53
53
  get :new
54
54
 
55
- assert_template 'challah/sessions/access_denied'
55
+ assert_template 'sessions/access_denied'
56
56
  assert_response :unauthorized
57
57
  end
58
58
  end
data/test/routes_test.rb CHANGED
@@ -3,9 +3,9 @@ require 'helper'
3
3
  class RoutesTest < ActionDispatch::IntegrationTest
4
4
  context "The routing engine" do
5
5
  should "have login and logout routes" do
6
- assert_generates '/login', :controller => 'challah/sessions', :action => 'new'
7
- assert_generates '/logout', :controller => 'challah/sessions', :action => 'destroy'
8
- assert_routing({ :method => 'post', :path => '/login' }, { :controller => 'challah/sessions', :action => 'create' })
6
+ assert_generates '/login', :controller => 'sessions', :action => 'new'
7
+ assert_generates '/logout', :controller => 'sessions', :action => 'destroy'
8
+ assert_routing({ :method => 'post', :path => '/login' }, { :controller => 'sessions', :action => 'create' })
9
9
  end
10
10
  end
11
11
  end
@@ -1,7 +1,7 @@
1
1
  require 'helper'
2
2
 
3
3
  class SessionsControllerTest < ActionController::TestCase
4
- tests Challah::SessionsController
4
+ tests SessionsController
5
5
 
6
6
  context "The sessions controller" do
7
7
  setup do
@@ -1,3 +1,12 @@
1
+ 2.5.1 (February 3, 2012)
2
+ Fix attribute evaluation when the attribute isn't defined in the factory but
3
+ is a private method on Object
4
+ Update rubygems on Travis before running tests
5
+ Fix spec name
6
+ Update GETTING_STARTED with correct usage of build_stubbed
7
+ Update README with more info on initialize_with
8
+ Honor :parent on factory over block nesting
9
+
1
10
  2.5.0 (January 20, 2012)
2
11
  Revert 'Deprecate build_stubbed and attributes_for'
3
12
  Implement initialize_with to allow overriding object instantiation
@@ -487,7 +487,7 @@ factory\_girl makes available three callbacks for injecting some code:
487
487
 
488
488
  * after_build - called after a factory is built (via FactoryGirl.build)
489
489
  * after_create - called after a factory is saved (via FactoryGirl.create)
490
- * after_stub - called after a factory is stubbed (via FactoryGirl.stub)
490
+ * after_stub - called after a factory is stubbed (via FactoryGirl.build_stubbed)
491
491
 
492
492
  Examples:
493
493
 
@@ -593,10 +593,10 @@ twenty_year_olds = FactoryGirl.build_list(:user, 25, :date_of_birth => 20.years.
593
593
  Custom Construction
594
594
  -------------------
595
595
 
596
- Instantiating objects can be overridden in the case where you'd rather not
597
- call `new` on your build class or you have some other factory method that
598
- you'd prefer to use. Using custom construction also allows for your objects to
599
- be instantiated with any number of arguments.
596
+ If you want to use factory_girl to construct an object where some attributes
597
+ are passed to `initialize` or if you want to do something other than simply
598
+ calling `new` on your build class, you can override the default behavior by
599
+ defining `to_initialize` on your factory. Example:
600
600
 
601
601
  ```ruby
602
602
  # user.rb
@@ -626,6 +626,19 @@ FactoryGirl.build(:user).name # Bob Hope
626
626
  Notice that I ignored the `name` attribute. If you don't want attributes
627
627
  reassigned after your object has been instantiated, you'll want to `ignore` them.
628
628
 
629
+ Although factory_girl is written to work with ActiveRecord out of the box, it
630
+ can also work with any Ruby class. For maximum compatibiltiy with ActiveRecord,
631
+ the default initializer builds all instances by calling new on your build class
632
+ without any arguments. It then calls attribute writer methods to assign all the
633
+ attribute values. While that works fine for ActiveRecord, it actually doesn't
634
+ work for almost any other Ruby class.
635
+
636
+ You can override the initializer in order to:
637
+
638
+ * Build non-ActiveRecord objects that require arguments to `initialize`
639
+ * Use a method other than `new` to instantiate the instance
640
+ * Do crazy things like decorate the instance after it's built
641
+
629
642
  Cucumber Integration
630
643
  --------------------
631
644
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factory_girl (2.5.0)
4
+ factory_girl (2.5.1)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/joshuaclayton/dev/gems/factory_girl
3
3
  specs:
4
- factory_girl (2.5.0)
4
+ factory_girl (2.5.1)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/joshuaclayton/dev/gems/factory_girl
3
3
  specs:
4
- factory_girl (2.5.0)
4
+ factory_girl (2.5.1)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/joshuaclayton/dev/gems/factory_girl
3
3
  specs:
4
- factory_girl (2.5.0)
4
+ factory_girl (2.5.1)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/joshuaclayton/dev/gems/factory_girl
3
3
  specs:
4
- factory_girl (2.5.0)
4
+ factory_girl (2.5.1)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /Users/joshuaclayton/dev/gems/factory_girl
3
3
  specs:
4
- factory_girl (2.5.0)
4
+ factory_girl (2.5.1)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -11,13 +11,21 @@ module FactoryGirl
11
11
  end
12
12
  end
13
13
  end
14
- undef_method(:id) if method_defined?(:id)
14
+
15
+ private_instance_methods.each do |method|
16
+ undef_method(method) unless method =~ /^__|initialize/
17
+ end
15
18
 
16
19
  def initialize(build_strategy, overrides = {})
17
20
  @build_strategy = build_strategy
18
21
  @overrides = overrides
19
22
  @cached_attributes = overrides
20
23
 
24
+ singleton = class << self; self end
25
+ @overrides.each do |name, value|
26
+ singleton.send :define_method, name, lambda { value }
27
+ end
28
+
21
29
  @build_strategy.add_observer(CallbackRunner.new(self.class.callbacks, self))
22
30
  end
23
31
 
@@ -24,7 +24,8 @@ module FactoryGirl
24
24
  FactoryGirl.register_factory(factory)
25
25
 
26
26
  proxy.child_factories.each do |(child_name, child_options, child_block)|
27
- factory(child_name, child_options.merge(:parent => name), &child_block)
27
+ parent_factory = child_options.delete(:parent) || name
28
+ factory(child_name, child_options.merge(:parent => parent_factory), &child_block)
28
29
  end
29
30
  end
30
31
 
@@ -1,4 +1,4 @@
1
1
  module FactoryGirl
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.1"
3
3
  end
4
4