spree 0.11.2 → 0.11.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 (249) hide show
  1. data/Rakefile +9 -8
  2. data/app/controllers/admin/base_controller.rb +31 -0
  3. data/app/controllers/admin/general_settings_controller.rb +9 -0
  4. data/app/controllers/admin/orders_controller.rb +8 -3
  5. data/app/controllers/admin/payments_controller.rb +8 -3
  6. data/app/controllers/admin/shipments_controller.rb +7 -2
  7. data/app/models/address.rb +42 -25
  8. data/app/models/app_configuration.rb +3 -0
  9. data/app/models/billing_integration.rb +1 -1
  10. data/app/models/line_item.rb +1 -1
  11. data/app/models/payment.rb +1 -1
  12. data/app/models/product_group.rb +8 -4
  13. data/app/models/spree/alert.rb +13 -0
  14. data/config/boot.rb +1 -1
  15. data/config/environment.rb +3 -3
  16. data/config/environments/test.rb +1 -1
  17. data/config/locales/en_spree.yml +3 -0
  18. data/config/routes.rb +2 -1
  19. data/lib/generators/extension/templates/Rakefile +1 -1
  20. data/lib/plugins/option_tags_with_disable/Rakefile +1 -1
  21. data/lib/spree.rb +2 -2
  22. data/lib/spree/checkout/action_options.rb +2 -2
  23. data/lib/spree/extension_loader.rb +1 -1
  24. data/lib/spree/initializer.rb +3 -2
  25. data/lib/validation_group.rb +2 -2
  26. data/vendor/extensions/api/Rakefile +1 -1
  27. data/vendor/extensions/overview_dashboard/Rakefile +1 -1
  28. data/vendor/extensions/payment_gateway/Rakefile +1 -1
  29. data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net.rb +8 -2
  30. data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +6 -0
  31. data/vendor/extensions/theme_default/Rakefile +1 -1
  32. data/vendor/extensions/theme_default/app/views/admin/adjustments/_form.html.erb +0 -3
  33. data/vendor/extensions/theme_default/app/views/admin/adjustments/new.html.erb +3 -0
  34. data/vendor/extensions/theme_default/app/views/admin/general_settings/edit.html.erb +8 -0
  35. data/vendor/extensions/theme_default/app/views/admin/general_settings/show.html.erb +5 -0
  36. data/vendor/extensions/theme_default/app/views/admin/shared/_alert.html.erb +11 -0
  37. data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +1 -1
  38. data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +30 -1
  39. data/vendor/plugins/acts_as_tree/Rakefile +1 -1
  40. data/vendor/plugins/attribute_fu/Rakefile +1 -1
  41. data/vendor/plugins/auto_complete/Rakefile +1 -1
  42. data/vendor/plugins/awesome_nested_set/Rakefile +1 -1
  43. data/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb +3 -3
  44. data/vendor/plugins/delegate_belongs_to/Rakefile +1 -1
  45. data/vendor/plugins/enumerable_constants/Rakefile +1 -1
  46. data/vendor/plugins/find_by_param/Rakefile +1 -1
  47. data/vendor/plugins/in_place_editing/Rakefile +1 -1
  48. data/vendor/plugins/jrails_auto_complete/Rakefile +1 -1
  49. data/vendor/plugins/mail_queue/Rakefile +1 -1
  50. data/vendor/plugins/open_id_authentication/Rakefile +1 -1
  51. data/vendor/plugins/resource_controller/lib/resource_controller/action_options.rb +1 -1
  52. data/vendor/plugins/resource_controller/lib/resource_controller/failable_action_options.rb +1 -1
  53. data/vendor/plugins/resource_controller/test/app/controllers/accounts_controller.rb +6 -0
  54. data/vendor/plugins/resource_controller/test/app/controllers/application.rb +7 -0
  55. data/vendor/plugins/resource_controller/test/app/controllers/cms/options_controller.rb +3 -0
  56. data/vendor/plugins/resource_controller/test/app/controllers/cms/personnel_controller.rb +2 -0
  57. data/vendor/plugins/resource_controller/test/app/controllers/cms/photos_controller.rb +6 -0
  58. data/vendor/plugins/resource_controller/test/app/controllers/cms/products_controller.rb +3 -0
  59. data/vendor/plugins/resource_controller/test/app/controllers/comments_controller.rb +3 -0
  60. data/vendor/plugins/resource_controller/test/app/controllers/images_controller.rb +4 -0
  61. data/vendor/plugins/resource_controller/test/app/controllers/options_controller.rb +8 -0
  62. data/vendor/plugins/resource_controller/test/app/controllers/people_controller.rb +9 -0
  63. data/vendor/plugins/resource_controller/test/app/controllers/photos_controller.rb +11 -0
  64. data/vendor/plugins/resource_controller/test/app/controllers/posts_controller.rb +10 -0
  65. data/vendor/plugins/resource_controller/test/app/controllers/projects_controller.rb +3 -0
  66. data/vendor/plugins/resource_controller/test/app/controllers/somethings_controller.rb +3 -0
  67. data/vendor/plugins/resource_controller/test/app/controllers/tags_controller.rb +13 -0
  68. data/vendor/plugins/resource_controller/test/app/controllers/users_controller.rb +12 -0
  69. data/vendor/plugins/resource_controller/test/app/helpers/accounts_helper.rb +2 -0
  70. data/vendor/plugins/resource_controller/test/app/helpers/application_helper.rb +3 -0
  71. data/vendor/plugins/resource_controller/test/app/helpers/cms/products_helper.rb +2 -0
  72. data/vendor/plugins/resource_controller/test/app/helpers/comments_helper.rb +2 -0
  73. data/vendor/plugins/resource_controller/test/app/helpers/images_helper.rb +2 -0
  74. data/vendor/plugins/resource_controller/test/app/helpers/options_helper.rb +2 -0
  75. data/vendor/plugins/resource_controller/test/app/helpers/people_helper.rb +2 -0
  76. data/vendor/plugins/resource_controller/test/app/helpers/photos_helper.rb +2 -0
  77. data/vendor/plugins/resource_controller/test/app/helpers/posts_helper.rb +2 -0
  78. data/vendor/plugins/resource_controller/test/app/helpers/projects_helper.rb +2 -0
  79. data/vendor/plugins/resource_controller/test/app/helpers/somethings_helper.rb +2 -0
  80. data/vendor/plugins/resource_controller/test/app/helpers/tags_helper.rb +2 -0
  81. data/vendor/plugins/resource_controller/test/app/helpers/users_helper.rb +2 -0
  82. data/vendor/plugins/resource_controller/test/app/models/account.rb +4 -0
  83. data/vendor/plugins/resource_controller/test/app/models/comment.rb +3 -0
  84. data/vendor/plugins/resource_controller/test/app/models/image.rb +3 -0
  85. data/vendor/plugins/resource_controller/test/app/models/option.rb +3 -0
  86. data/vendor/plugins/resource_controller/test/app/models/personnel.rb +3 -0
  87. data/vendor/plugins/resource_controller/test/app/models/photo.rb +5 -0
  88. data/vendor/plugins/resource_controller/test/app/models/post.rb +3 -0
  89. data/vendor/plugins/resource_controller/test/app/models/product.rb +3 -0
  90. data/vendor/plugins/resource_controller/test/app/models/project.rb +2 -0
  91. data/vendor/plugins/resource_controller/test/app/models/something.rb +2 -0
  92. data/vendor/plugins/resource_controller/test/app/models/tag.rb +3 -0
  93. data/vendor/plugins/resource_controller/test/app/models/user.rb +3 -0
  94. data/vendor/plugins/resource_controller/test/app/views/accounts/_form.html.erb +4 -0
  95. data/vendor/plugins/resource_controller/test/app/views/accounts/edit.html.erb +14 -0
  96. data/vendor/plugins/resource_controller/test/app/views/accounts/new.html.erb +12 -0
  97. data/vendor/plugins/resource_controller/test/app/views/accounts/show.html.erb +5 -0
  98. data/vendor/plugins/resource_controller/test/app/views/cms/options/edit.rhtml +17 -0
  99. data/vendor/plugins/resource_controller/test/app/views/cms/options/index.rhtml +20 -0
  100. data/vendor/plugins/resource_controller/test/app/views/cms/options/new.rhtml +16 -0
  101. data/vendor/plugins/resource_controller/test/app/views/cms/options/show.rhtml +8 -0
  102. data/vendor/plugins/resource_controller/test/app/views/cms/photos/edit.rhtml +17 -0
  103. data/vendor/plugins/resource_controller/test/app/views/cms/photos/index.rhtml +20 -0
  104. data/vendor/plugins/resource_controller/test/app/views/cms/photos/new.rhtml +16 -0
  105. data/vendor/plugins/resource_controller/test/app/views/cms/photos/show.rhtml +8 -0
  106. data/vendor/plugins/resource_controller/test/app/views/cms/products/edit.rhtml +17 -0
  107. data/vendor/plugins/resource_controller/test/app/views/cms/products/index.rhtml +20 -0
  108. data/vendor/plugins/resource_controller/test/app/views/cms/products/new.rhtml +16 -0
  109. data/vendor/plugins/resource_controller/test/app/views/cms/products/show.rhtml +8 -0
  110. data/vendor/plugins/resource_controller/test/app/views/comments/edit.rhtml +27 -0
  111. data/vendor/plugins/resource_controller/test/app/views/comments/index.rhtml +24 -0
  112. data/vendor/plugins/resource_controller/test/app/views/comments/new.rhtml +26 -0
  113. data/vendor/plugins/resource_controller/test/app/views/comments/show.rhtml +18 -0
  114. data/vendor/plugins/resource_controller/test/app/views/images/_form.html.erb +4 -0
  115. data/vendor/plugins/resource_controller/test/app/views/images/edit.html.erb +14 -0
  116. data/vendor/plugins/resource_controller/test/app/views/images/new.html.erb +12 -0
  117. data/vendor/plugins/resource_controller/test/app/views/layouts/application.rhtml +17 -0
  118. data/vendor/plugins/resource_controller/test/app/views/layouts/comments.rhtml +17 -0
  119. data/vendor/plugins/resource_controller/test/app/views/layouts/options.rhtml +17 -0
  120. data/vendor/plugins/resource_controller/test/app/views/layouts/people.rhtml +17 -0
  121. data/vendor/plugins/resource_controller/test/app/views/layouts/photos.rhtml +17 -0
  122. data/vendor/plugins/resource_controller/test/app/views/layouts/projects.rhtml +17 -0
  123. data/vendor/plugins/resource_controller/test/app/views/layouts/somethings.rhtml +17 -0
  124. data/vendor/plugins/resource_controller/test/app/views/layouts/tags.rhtml +17 -0
  125. data/vendor/plugins/resource_controller/test/app/views/options/_form.html.erb +8 -0
  126. data/vendor/plugins/resource_controller/test/app/views/options/edit.html.erb +16 -0
  127. data/vendor/plugins/resource_controller/test/app/views/options/index.html.erb +21 -0
  128. data/vendor/plugins/resource_controller/test/app/views/options/new.html.erb +12 -0
  129. data/vendor/plugins/resource_controller/test/app/views/options/show.html.erb +10 -0
  130. data/vendor/plugins/resource_controller/test/app/views/people/edit.rhtml +17 -0
  131. data/vendor/plugins/resource_controller/test/app/views/people/index.rhtml +20 -0
  132. data/vendor/plugins/resource_controller/test/app/views/people/new.rhtml +16 -0
  133. data/vendor/plugins/resource_controller/test/app/views/people/show.rhtml +8 -0
  134. data/vendor/plugins/resource_controller/test/app/views/photos/edit.rhtml +17 -0
  135. data/vendor/plugins/resource_controller/test/app/views/photos/index.rhtml +20 -0
  136. data/vendor/plugins/resource_controller/test/app/views/photos/new.rhtml +16 -0
  137. data/vendor/plugins/resource_controller/test/app/views/photos/show.rhtml +8 -0
  138. data/vendor/plugins/resource_controller/test/app/views/posts/edit.rhtml +22 -0
  139. data/vendor/plugins/resource_controller/test/app/views/posts/index.rhtml +22 -0
  140. data/vendor/plugins/resource_controller/test/app/views/posts/new.rhtml +21 -0
  141. data/vendor/plugins/resource_controller/test/app/views/posts/show.rhtml +13 -0
  142. data/vendor/plugins/resource_controller/test/app/views/projects/edit.rhtml +17 -0
  143. data/vendor/plugins/resource_controller/test/app/views/projects/index.rhtml +20 -0
  144. data/vendor/plugins/resource_controller/test/app/views/projects/new.rhtml +16 -0
  145. data/vendor/plugins/resource_controller/test/app/views/projects/show.rhtml +8 -0
  146. data/vendor/plugins/resource_controller/test/app/views/somethings/edit.rhtml +17 -0
  147. data/vendor/plugins/resource_controller/test/app/views/somethings/index.rhtml +20 -0
  148. data/vendor/plugins/resource_controller/test/app/views/somethings/new.rhtml +16 -0
  149. data/vendor/plugins/resource_controller/test/app/views/somethings/show.rhtml +8 -0
  150. data/vendor/plugins/resource_controller/test/app/views/tags/edit.rhtml +17 -0
  151. data/vendor/plugins/resource_controller/test/app/views/tags/index.rhtml +20 -0
  152. data/vendor/plugins/resource_controller/test/app/views/tags/index.rjs +0 -0
  153. data/vendor/plugins/resource_controller/test/app/views/tags/new.rhtml +16 -0
  154. data/vendor/plugins/resource_controller/test/app/views/tags/show.rhtml +8 -0
  155. data/vendor/plugins/resource_controller/test/app/views/users/edit.rhtml +17 -0
  156. data/vendor/plugins/resource_controller/test/app/views/users/index.rhtml +20 -0
  157. data/vendor/plugins/resource_controller/test/app/views/users/new.rhtml +16 -0
  158. data/vendor/plugins/resource_controller/test/app/views/users/show.rhtml +8 -0
  159. data/vendor/plugins/resource_controller/test/config/boot.rb +109 -0
  160. data/vendor/plugins/resource_controller/test/config/database.yml +9 -0
  161. data/vendor/plugins/resource_controller/test/config/environment.rb +47 -0
  162. data/vendor/plugins/resource_controller/test/config/environments/development.rb +21 -0
  163. data/vendor/plugins/resource_controller/test/config/environments/test.rb +19 -0
  164. data/vendor/plugins/resource_controller/test/config/initializers/inflections.rb +14 -0
  165. data/vendor/plugins/resource_controller/test/config/routes.rb +61 -0
  166. data/vendor/plugins/resource_controller/test/db/migrate/001_create_posts.rb +12 -0
  167. data/vendor/plugins/resource_controller/test/db/migrate/002_create_products.rb +11 -0
  168. data/vendor/plugins/resource_controller/test/db/migrate/003_create_comments.rb +13 -0
  169. data/vendor/plugins/resource_controller/test/db/migrate/004_create_options.rb +13 -0
  170. data/vendor/plugins/resource_controller/test/db/migrate/005_create_photos.rb +11 -0
  171. data/vendor/plugins/resource_controller/test/db/migrate/006_create_tags.rb +17 -0
  172. data/vendor/plugins/resource_controller/test/db/migrate/007_create_somethings.rb +11 -0
  173. data/vendor/plugins/resource_controller/test/db/migrate/008_create_accounts.rb +11 -0
  174. data/vendor/plugins/resource_controller/test/db/migrate/009_add_account_id_to_photos.rb +9 -0
  175. data/vendor/plugins/resource_controller/test/db/migrate/010_create_projects.rb +11 -0
  176. data/vendor/plugins/resource_controller/test/db/migrate/011_create_images.rb +12 -0
  177. data/vendor/plugins/resource_controller/test/db/migrate/012_create_users.rb +11 -0
  178. data/vendor/plugins/resource_controller/test/db/migrate/013_create_personnel.rb +11 -0
  179. data/vendor/plugins/resource_controller/test/db/migrate/014_add_personnel_id_to_photos.rb +9 -0
  180. data/vendor/plugins/resource_controller/test/db/schema.rb +78 -0
  181. data/vendor/plugins/resource_controller/test/script/console +3 -0
  182. data/vendor/plugins/resource_controller/test/script/destroy +3 -0
  183. data/vendor/plugins/resource_controller/test/script/generate +3 -0
  184. data/vendor/plugins/resource_controller/test/script/server +3 -0
  185. data/vendor/plugins/resource_controller/test/test/fixtures/accounts.yml +7 -0
  186. data/vendor/plugins/resource_controller/test/test/fixtures/comments.yml +11 -0
  187. data/vendor/plugins/resource_controller/test/test/fixtures/images.yml +6 -0
  188. data/vendor/plugins/resource_controller/test/test/fixtures/options.yml +9 -0
  189. data/vendor/plugins/resource_controller/test/test/fixtures/personnel.yml +5 -0
  190. data/vendor/plugins/resource_controller/test/test/fixtures/photos.yml +9 -0
  191. data/vendor/plugins/resource_controller/test/test/fixtures/photos_tags.yml +3 -0
  192. data/vendor/plugins/resource_controller/test/test/fixtures/posts.yml +9 -0
  193. data/vendor/plugins/resource_controller/test/test/fixtures/products.yml +7 -0
  194. data/vendor/plugins/resource_controller/test/test/fixtures/projects.yml +7 -0
  195. data/vendor/plugins/resource_controller/test/test/fixtures/somethings.yml +7 -0
  196. data/vendor/plugins/resource_controller/test/test/fixtures/tags.yml +7 -0
  197. data/vendor/plugins/resource_controller/test/test/fixtures/users.yml +5 -0
  198. data/vendor/plugins/resource_controller/test/test/functional/cms/options_controller_test.rb +23 -0
  199. data/vendor/plugins/resource_controller/test/test/functional/cms/photos_controller_test.rb +43 -0
  200. data/vendor/plugins/resource_controller/test/test/functional/cms/products_controller_test.rb +23 -0
  201. data/vendor/plugins/resource_controller/test/test/functional/comments_controller_test.rb +26 -0
  202. data/vendor/plugins/resource_controller/test/test/functional/images_controller_test.rb +37 -0
  203. data/vendor/plugins/resource_controller/test/test/functional/people_controller_test.rb +34 -0
  204. data/vendor/plugins/resource_controller/test/test/functional/photos_controller_test.rb +130 -0
  205. data/vendor/plugins/resource_controller/test/test/functional/posts_controller_test.rb +34 -0
  206. data/vendor/plugins/resource_controller/test/test/functional/projects_controller_test.rb +18 -0
  207. data/vendor/plugins/resource_controller/test/test/functional/somethings_controller_test.rb +28 -0
  208. data/vendor/plugins/resource_controller/test/test/functional/tags_controller_test.rb +64 -0
  209. data/vendor/plugins/resource_controller/test/test/functional/users_controller_test.rb +24 -0
  210. data/vendor/plugins/resource_controller/test/test/test_helper.rb +12 -0
  211. data/vendor/plugins/resource_controller/test/test/unit/accessors_test.rb +110 -0
  212. data/vendor/plugins/resource_controller/test/test/unit/account_test.rb +7 -0
  213. data/vendor/plugins/resource_controller/test/test/unit/action_options_test.rb +109 -0
  214. data/vendor/plugins/resource_controller/test/test/unit/base_test.rb +11 -0
  215. data/vendor/plugins/resource_controller/test/test/unit/comment_test.rb +10 -0
  216. data/vendor/plugins/resource_controller/test/test/unit/failable_action_options_test.rb +77 -0
  217. data/vendor/plugins/resource_controller/test/test/unit/helpers/current_objects_test.rb +133 -0
  218. data/vendor/plugins/resource_controller/test/test/unit/helpers/internal_test.rb +106 -0
  219. data/vendor/plugins/resource_controller/test/test/unit/helpers/nested_test.rb +86 -0
  220. data/vendor/plugins/resource_controller/test/test/unit/helpers/singleton_current_objects_test.rb +68 -0
  221. data/vendor/plugins/resource_controller/test/test/unit/helpers/singleton_nested_test.rb +77 -0
  222. data/vendor/plugins/resource_controller/test/test/unit/helpers/singleton_urls_test.rb +67 -0
  223. data/vendor/plugins/resource_controller/test/test/unit/helpers/urls_test.rb +75 -0
  224. data/vendor/plugins/resource_controller/test/test/unit/helpers_test.rb +25 -0
  225. data/vendor/plugins/resource_controller/test/test/unit/image_test.rb +7 -0
  226. data/vendor/plugins/resource_controller/test/test/unit/option_test.rb +10 -0
  227. data/vendor/plugins/resource_controller/test/test/unit/photo_test.rb +10 -0
  228. data/vendor/plugins/resource_controller/test/test/unit/post_test.rb +10 -0
  229. data/vendor/plugins/resource_controller/test/test/unit/project_test.rb +10 -0
  230. data/vendor/plugins/resource_controller/test/test/unit/response_collector_test.rb +49 -0
  231. data/vendor/plugins/resource_controller/test/test/unit/something_test.rb +10 -0
  232. data/vendor/plugins/resource_controller/test/test/unit/tag_test.rb +10 -0
  233. data/vendor/plugins/resource_controller/test/test/unit/urligence_test.rb +203 -0
  234. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/Rakefile +32 -0
  235. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/bin/convert_to_should_syntax +40 -0
  236. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/init.rb +3 -0
  237. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda.rb +43 -0
  238. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/active_record_helpers.rb +580 -0
  239. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/color.rb +77 -0
  240. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/controller_tests/controller_tests.rb +467 -0
  241. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/controller_tests/formats/html.rb +201 -0
  242. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/controller_tests/formats/xml.rb +170 -0
  243. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/proc_extensions.rb +14 -0
  244. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/gem/shoulda.rb +239 -0
  245. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/general.rb +118 -0
  246. data/vendor/plugins/resource_controller/test/vendor/plugins/shoulda/lib/shoulda/private_helpers.rb +22 -0
  247. data/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +2 -2
  248. data/vendor/plugins/unobtrusive_date_picker/Rakefile +1 -1
  249. metadata +270 -145
@@ -42,7 +42,7 @@ module Spree
42
42
  end
43
43
 
44
44
  # Provide the load paths for the Spree installation
45
- def default_load_paths
45
+ def default_autoload_paths
46
46
  paths = ["#{SPREE_ROOT}/test/mocks/#{environment}"]
47
47
 
48
48
  # Add the app's controller directory
@@ -129,7 +129,7 @@ module Spree
129
129
 
130
130
 
131
131
  def initialize_framework_views
132
- view_paths = returning [] do |arr|
132
+ view_paths = [].tap do |arr|
133
133
  # Add the singular view path if it's not in the list
134
134
  arr << configuration.view_path if !configuration.view_paths.include?(configuration.view_path)
135
135
  # Add the default view paths
@@ -158,6 +158,7 @@ module Spree
158
158
  extension_loader.add_controller_paths
159
159
  super
160
160
  end
161
+
161
162
 
162
163
  def initialize_metal
163
164
  Rails::Rack::Metal.metal_paths += ["#{SPREE_ROOT}/app/metal"]
@@ -14,7 +14,7 @@ module ValidationGroup
14
14
  def self.validation_groups(all_classes = false)
15
15
  return (self.validation_group_classes[self] || {}) unless all_classes
16
16
  klasses = ValidationGroup::Util.current_and_ancestors(self).reverse
17
- returning Hash.new do |hash|
17
+ Hash.new.tap do |hash|
18
18
  klasses.each do |klass|
19
19
  hash.merge! self.validation_group_classes[klass]
20
20
  end
@@ -129,7 +129,7 @@ end
129
129
  # Return array consisting of current and its superclasses down to and
130
130
  # including base_class.
131
131
  def self.current_and_ancestors(current)
132
- returning [] do |klasses|
132
+ [].tap do |klasses|
133
133
  klasses << current
134
134
  root = current.base_class
135
135
  until current == root
@@ -18,7 +18,7 @@ unless defined? SPREE_ROOT
18
18
  end
19
19
 
20
20
  require 'rake'
21
- require 'rake/rdoctask'
21
+ require 'rdoc/task'
22
22
  require 'rake/testtask'
23
23
 
24
24
  rspec_base = File.expand_path(SPREE_ROOT + '/vendor/plugins/rspec/lib')
@@ -18,7 +18,7 @@ unless defined? SPREE_ROOT
18
18
  end
19
19
 
20
20
  require 'rake'
21
- require 'rake/rdoctask'
21
+ require 'rdoc/task'
22
22
  require 'rake/testtask'
23
23
 
24
24
  rspec_base = File.expand_path(SPREE_ROOT + '/vendor/plugins/rspec/lib')
@@ -18,7 +18,7 @@ unless defined? SPREE_ROOT
18
18
  end
19
19
 
20
20
  require 'rake'
21
- require 'rake/rdoctask'
21
+ require 'rdoc/task'
22
22
  require 'rake/testtask'
23
23
 
24
24
  rspec_base = File.expand_path(SPREE_ROOT + '/vendor/plugins/rspec/lib')
@@ -1,8 +1,14 @@
1
1
  class Gateway::AuthorizeNet < Gateway
2
2
  preference :login, :string
3
3
  preference :password, :string
4
-
4
+
5
5
  def provider_class
6
6
  ActiveMerchant::Billing::AuthorizeNetGateway
7
- end
7
+ end
8
+
9
+ def options
10
+ # add :test key in the options hash, as that is what the ActiveMerchant::Billing::AuthorizeNetGateway expects
11
+ self.class.default_preferences[:test] = true if self.prefers? :test_mode
12
+ super
13
+ end
8
14
  end
@@ -12,6 +12,12 @@ class Gateway::AuthorizeNetCim < Gateway
12
12
  self.class
13
13
  end
14
14
 
15
+ def options
16
+ # add :test key in the options hash, as that is what the ActiveMerchant::Billing::AuthorizeNetGateway expects
17
+ self.class.default_preferences[:test] = true if self.prefers? :test_mode
18
+ super
19
+ end
20
+
15
21
  def authorize(amount, creditcard, gateway_options)
16
22
  create_transaction(amount, creditcard, :auth_only)
17
23
  end
@@ -18,7 +18,7 @@ unless defined? SPREE_ROOT
18
18
  end
19
19
 
20
20
  require 'rake'
21
- require 'rake/rdoctask'
21
+ require 'rdoc/task'
22
22
  require 'rake/testtask'
23
23
 
24
24
  rspec_base = File.expand_path(SPREE_ROOT + '/vendor/plugins/rspec/lib')
@@ -1,6 +1,3 @@
1
- <%= hidden_field :adjustment, :adjustment_source_id, :value => @order.id %>
2
- <%= hidden_field :adjustment, :adjustment_source_type, :value => @order.class %>
3
-
4
1
  <% f.field_container :amount do %>
5
2
  <%= f.label :amount, t("amount")%> <span class="required">*</span><br />
6
3
  <%= text_field :adjustment, :amount, {:style => "width:80px;"} %>
@@ -4,6 +4,9 @@
4
4
 
5
5
  <%=error_messages_for :adjustment %>
6
6
  <% form_for @adjustment, :url => collection_url do |f| %>
7
+ <%= hidden_field :adjustment, :adjustment_source_id, :value => @order.id %>
8
+ <%= hidden_field :adjustment, :adjustment_source_type, :value => @order.class %>
9
+
7
10
  <%= render :partial => "form", :locals => {:f => f} %>
8
11
 
9
12
  <p class="form-buttons">
@@ -28,6 +28,14 @@
28
28
  </label>
29
29
  </p>
30
30
 
31
+ <p>
32
+ <label>
33
+ <input name="preferences[check_for_spree_alerts]" type="hidden" value="0" />
34
+ <%= check_box_tag('preferences[check_for_spree_alerts]', "1", Spree::Config[:check_for_spree_alerts]) %>
35
+ <%= t('spree_alert_checking') %>
36
+ </label>
37
+ </p>
38
+
31
39
  <p class="form-buttons">
32
40
  <%= button t('update') %>
33
41
  <%= t("or") %> <%= link_to t("cancel"), admin_general_settings_url %>
@@ -21,6 +21,11 @@
21
21
  <%= (Spree::Config[:allow_ssl_in_development_and_test] ? t("ssl_will_be_used_in_development_and_test_modes") : t("ssl_will_not_be_used_in_development_and_test_modes")) %>
22
22
  </td>
23
23
  </tr>
24
+ <tr>
25
+ <td colspan="2">
26
+ <%= (Spree::Config[:check_for_spree_alerts] ? t("spree_alert_checking") : t("spree_alert_not_checking")) %>
27
+ </td>
28
+ </tr>
24
29
  </table>
25
30
 
26
31
  <p><%= link_to_with_icon 'edit', t("edit"), edit_admin_general_settings_path %></p>
@@ -0,0 +1,11 @@
1
+ <div class="alert <%= alert.severity.downcase %>">
2
+ <%= alert.message %> <%= link_to alert.url_name, alert.url if alert.url %>
3
+ <%= link_to_remote 'X',{ :url => { :controller=>"admin/general_settings",
4
+ :action=>"dismiss_alert",
5
+ :alert_id => alert.id,
6
+ :method => :post } },
7
+ :class => "dismiss" %>
8
+ </div>
9
+
10
+
11
+
@@ -42,7 +42,6 @@
42
42
 
43
43
  <div class="<%= 'with-sidebar ' unless @content_for_sidebar.blank? %> clear tile_bg" id="content">
44
44
 
45
-
46
45
  <% if flash[:error] %>
47
46
  <div class="flash error"><%= flash[:error] %></div>
48
47
  <% end %>
@@ -50,6 +49,7 @@
50
49
  <div class="flash notice"><%= self.notice %></div>
51
50
  <% end %>
52
51
 
52
+ <%= render :partial => 'admin/shared/alert', :collection => session[:alerts] %>
53
53
 
54
54
  <%= yield %>
55
55
 
@@ -573,4 +573,33 @@ table#product_scopes tr td table tr td {
573
573
  #new_product_group_form p {
574
574
  text-align: right;
575
575
  margin: 0;
576
- }
576
+ }
577
+
578
+ .alert {
579
+ -moz-border-radius: 5px;
580
+ -webkit-border-radius: 5px;
581
+ border-radius: 5px;
582
+ font-size: 1.3em;
583
+ margin-bottom: 1em;
584
+ padding: 0.8em;
585
+ }
586
+ .alert a.dismiss {
587
+ float:right;
588
+ font-size: 0.8em;
589
+ }
590
+ .alert.release {
591
+ background: #ccddff url(../images/shadow_top.png) 0px -50px repeat-x;
592
+ color: #556699;
593
+ border: 1px solid #99aacc;
594
+ }
595
+ .alert.security {
596
+ background: #f4b4b4 url(../images/shadow_top.png) 0px -50px repeat-x;
597
+ color: #000000;
598
+ border: 1px solid #e75b5b;
599
+ }
600
+ .alert.news {
601
+ background: #ccffd4 url(../images/shadow_top.png) 0px -50px repeat-x;
602
+ color: #000000;
603
+ border: 1px solid #66ff7e;
604
+ }
605
+
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -1,7 +1,7 @@
1
1
  require 'rake'
2
2
  require "load_multi_rails_rake_tasks"
3
3
  require 'rake/testtask'
4
- require 'rake/rdoctask'
4
+ require 'rdoc/task'
5
5
 
6
6
  desc 'Default: run unit tests.'
7
7
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -5,7 +5,7 @@ rescue LoadError
5
5
  exit 1
6
6
  end
7
7
  require 'rake/testtask'
8
- require 'rake/rdoctask'
8
+ require 'rdoc/task'
9
9
  require 'rcov/rcovtask'
10
10
  require "load_multi_rails_rake_tasks"
11
11
 
@@ -60,9 +60,9 @@ module CollectiveIdea #:nodoc:
60
60
  extend Columns
61
61
  extend ClassMethods
62
62
 
63
- belongs_to :parent, :class_name => self.base_class.class_name,
63
+ belongs_to :parent, :class_name => self.base_class.model_name,
64
64
  :foreign_key => parent_column_name
65
- has_many :children, :class_name => self.base_class.class_name,
65
+ has_many :children, :class_name => self.base_class.model_name,
66
66
  :foreign_key => parent_column_name, :order => quoted_left_column_name
67
67
 
68
68
  attr_accessor :skip_before_destroy
@@ -149,7 +149,7 @@ module CollectiveIdea #:nodoc:
149
149
  def each_root_valid?(roots_to_validate)
150
150
  left = right = 0
151
151
  roots_to_validate.all? do |root|
152
- returning(root.left > left && root.right > right) do
152
+ (root.left > left && root.right > right).tap do
153
153
  left = root.left
154
154
  right = root.right
155
155
  end
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'spec/rake/spectask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run specs.'
6
6
  task :default => :spec
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -28,7 +28,7 @@ module ResourceController
28
28
  end
29
29
 
30
30
  def dup
31
- returning self.class.new do |duplicate|
31
+ self.class.new.tap do |duplicate|
32
32
  duplicate.instance_variable_set(:@collector, wants.dup)
33
33
  duplicate.instance_variable_set(:@before, before.dup) unless before.nil?
34
34
  duplicate.instance_variable_set(:@after, after.dup) unless after.nil?
@@ -15,7 +15,7 @@ module ResourceController
15
15
  delegate :flash, :flash_now, :after, :response, :wants, :to => :success
16
16
 
17
17
  def dup
18
- returning self.class.new do |duplicate|
18
+ self.class.new.tap do |duplicate|
19
19
  duplicate.instance_variable_set(:@success, success.dup)
20
20
  duplicate.instance_variable_set(:@fails, fails.dup)
21
21
  duplicate.instance_variable_set(:@before, before.dup) unless before.nil?
@@ -0,0 +1,6 @@
1
+ class AccountsController < ResourceController::Singleton
2
+ protected
3
+ def object
4
+ Account.find(:first)
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ # Filters added to this controller apply to all controllers in the application.
2
+ # Likewise, all the methods added will be available for all controllers.
3
+
4
+ class ApplicationController < ActionController::Base
5
+ # Pick a unique cookie name to distinguish our session data from others'
6
+ session :session_key => '_myapp_session'
7
+ end
@@ -0,0 +1,3 @@
1
+ class Cms::OptionsController < ResourceController::Base
2
+ belongs_to :product
3
+ end
@@ -0,0 +1,2 @@
1
+ class Cms::PersonnelController < ResourceController::Base
2
+ end
@@ -0,0 +1,6 @@
1
+ class Cms::PhotosController < ResourceController::Base
2
+ actions :all, :except => :update
3
+
4
+ belongs_to :personnel
5
+ create.flash { "#{@photo.title} was created!" }
6
+ end
@@ -0,0 +1,3 @@
1
+ class Cms::ProductsController < ResourceController::Base
2
+ create.flash 'something'
3
+ end
@@ -0,0 +1,3 @@
1
+ class CommentsController < ResourceController::Base
2
+ belongs_to :post
3
+ end
@@ -0,0 +1,4 @@
1
+ class ImagesController < ResourceController::Singleton
2
+ belongs_to :user
3
+ actions :create
4
+ end
@@ -0,0 +1,8 @@
1
+ class OptionsController < ResourceController::Base
2
+ belongs_to :account
3
+
4
+ protected
5
+ def parent_object
6
+ Account.find(:first)
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ class PeopleController < ResourceController::Base
2
+ create.before :name_person
3
+ model_name :account
4
+
5
+ private
6
+ def name_person
7
+ @person.name = "Bob Loblaw"
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class PhotosController < ResourceController::Base
2
+ actions :all, :except => :update
3
+
4
+ belongs_to :user
5
+ create.flash { "#{@photo.title} was created!" }
6
+
7
+ private
8
+ def parent_model
9
+ Account
10
+ end
11
+ end