hobo 2.0.1 → 2.1.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES-2.1.markdown +57 -0
  3. data/Gemfile +1 -1
  4. data/VERSION +1 -1
  5. data/app/helpers/hobo_permissions_helper.rb +1 -1
  6. data/app/helpers/hobo_route_helper.rb +10 -79
  7. data/config/routes.rb +2 -2
  8. data/hobo.gemspec +1 -1
  9. data/lib/generators/hobo/admin_subsite/admin_subsite_generator.rb +3 -1
  10. data/lib/generators/hobo/controller.rb +4 -1
  11. data/lib/generators/hobo/front_controller/front_controller_generator.rb +7 -6
  12. data/lib/generators/hobo/i18n/templates/hobo.en.yml +2 -1
  13. data/lib/generators/hobo/i18n/templates/hobo.es.yml +1 -0
  14. data/lib/generators/hobo/i18n/templates/hobo.ru.yml +1 -0
  15. data/lib/generators/hobo/routes/router.rb +5 -3
  16. data/lib/generators/hobo/routes/templates/hobo_routes.rb.erb +0 -36
  17. data/lib/generators/hobo/setup_wizard/setup_wizard_generator.rb +2 -2
  18. data/lib/hobo.rb +2 -2
  19. data/lib/hobo/controller.rb +1 -1
  20. data/lib/hobo/controller/model.rb +4 -4
  21. data/lib/hobo/extensions/active_record/associations/association.rb +1 -1
  22. data/lib/hobo/extensions/active_record/associations/scope.rb +6 -5
  23. data/lib/hobo/extensions/active_record/relation_with_origin.rb +9 -7
  24. data/lib/hobo/model.rb +1 -2
  25. data/lib/hobo/model/accessible_associations.rb +4 -5
  26. data/lib/hobo/model/permissions.rb +7 -6
  27. data/lib/hobo/model/scopes.rb +1 -3
  28. data/lib/hobo/model/scopes/apply_scopes.rb +3 -3
  29. data/test/irt/generators/admin_subsite.irt +6 -0
  30. metadata +17 -39
  31. data/test/doctest/hobo/multi_model_forms.rdoctest +0 -260
  32. data/test/doctest/hobo/scopes.rdoctest +0 -375
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5de6d624783c705dfe7dd66c79518ebc2ec68b3f
4
+ data.tar.gz: 634bf9f6c3831df42e818c03fe46a45d0a8e5255
5
+ SHA512:
6
+ metadata.gz: 78ea8f82e5ac95ddcc3085afd7cce6ac1f1d01f499b8b589ab3f2ab1e55111d7671b9e5c735ed8754c7755463b160982a68eceb3847e01549cb407c36205fb07
7
+ data.tar.gz: df53268326185eef5f0cea67c8fe7773a7dc0f9d5883e823aa0a911bf8cf78680e20221dadc1658a9ebcc7bdcd04e12697e09056ec98484b8870cc33d96d98f8
@@ -0,0 +1,57 @@
1
+ Hobo 2.1 Changes
2
+ {: .document-title}
3
+
4
+ Documents the changes made in Hobo 2.1 and the changes required to
5
+ migrate applications to Hobo 2.1
6
+
7
+ Contents
8
+ {: .contents-heading}
9
+
10
+ - contents
11
+ {:toc}
12
+
13
+ # Updating from a Hobo 2.0 application to Hobo 2.1
14
+
15
+ Meta tags: note for collaborators. A meta-tag looks like this {.done}. It's added after a paragraph with no blank spaces. The tags that we support are: {.ruby} {.javascript} {.dryml} and {.diff} for code highlighting. {.todo}, {.done}, {.check}, {.part} and {.nomove} indicate documentation progress moving into the Hobo manuals. {.check} means that it's probably done. {.part} means that it's partly done. {.nomove} means that this section only needs to exist in this CHANGES document. Finally, {.hidden} is used for paragraphs like this one that shouldn't show up on the website.
16
+ {.hidden}
17
+
18
+ {.nomove}
19
+
20
+ Many of the changes required in upgrading a Hobo 2.0 application are necessitated by the switch from Rails 3.2 to 4.0. [Railscasts has a good guide to upgrading to Rails 4.0](http://railscasts.com/episodes/415-upgrading-to-rails-4).
21
+
22
+ From Hobo's point of view, you shouldn't need to change almost anything :).
23
+
24
+ ## Gemfile
25
+
26
+ Now Hobo uses "will_paginate_hobo" gem, instead of the git repository "git://github.com/Hobo/will_paginate.git". This should make it easier to install in systems without Git installed (users have reported problems with Windows and Git).
27
+
28
+ You also need to add the `protected_attributes` gem to your Gemfile.
29
+
30
+
31
+ # Internal changes
32
+
33
+ In order to make Hobo compatible with Rails 4, these are the main changes that have been done:
34
+
35
+ ## Routing
36
+
37
+ * `url_for` does not accept parameters any more
38
+ * Remove deprecated routes system
39
+ * `match` is no longer accepted in routes.rb, it has been replaced by "get" and "post"
40
+
41
+ ## ActiveRecord
42
+
43
+ * `Model.find(:all)` is deprecated
44
+ * `finder.scoped :conditions => conditions` has been replaced with `finder.where(conditions)`
45
+ * raise_on_type_mismatch has been renamed to raise_on_type_mismatch!
46
+
47
+ ## Other
48
+ * `protected_attributes` gem has been added to support the "old" way of protecting attributes
49
+ * Domizio has made Hobo thread safe :)
50
+
51
+
52
+
53
+ # Running the integration tests:
54
+
55
+ The integration tests in the "agility_bootstrap" folder have been updated for Hobo 2.1 and Rails 4.
56
+
57
+ see https://github.com/tablatom/hobo/integration_tests/agility_bootstrap/README
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec :path => "../dryml"
6
6
  gemspec :path => "../hobo_support"
7
7
  gemspec :path => "../hobo_fields"
8
8
  gemspec
9
- gem 'will_paginate', :git => 'git://github.com/Hobo/will_paginate.git'
9
+ gem 'hobo_will_paginate'
10
10
  platform :ruby do
11
11
  gem 'sqlite3'
12
12
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.1.0.pre1
@@ -38,7 +38,7 @@ module HoboPermissionsHelper
38
38
 
39
39
  def can_edit?(*args)
40
40
  object, field = if args.empty?
41
- if this.respond_to?(:editable_by?) && !this_field_reflection
41
+ if !this.respond_to?(:to_a) && this.respond_to?(:editable_by?) && !this_field_reflection
42
42
  [this, nil]
43
43
  elsif this_parent && this_field
44
44
  [this_parent, this_field]
@@ -1,13 +1,8 @@
1
1
  module HoboRouteHelper
2
+ include Rails.application.routes.url_helpers
2
3
  extend HoboHelperBase
3
4
  def object_url(obj, *args)
4
5
  new_ = object_url_new(obj, *args)
5
-
6
- unless Rails.configuration.hobo.dont_emit_deprecated_routes
7
- old_ = object_url_old(obj, *args)
8
- debugger if old_ != new_
9
- Rails.logger.debug "new style url #{new_} does not match old style url #{old_}. obj: #{obj.inspect}. args: #{args.inspect}. backtrace: #{caller.inspect}" if old_ != new_
10
- end
11
6
  new_
12
7
  end
13
8
 
@@ -31,64 +26,6 @@ module HoboRouteHelper
31
26
 
32
27
  IMPLICIT_ACTIONS = [:index, :show, :create, :update, :destroy]
33
28
 
34
- def object_url_old(obj, *args)
35
- params = args.extract_options!
36
- action = args.first._?.to_sym
37
- options, params = params.partition_hash([:subsite, :method, :format])
38
- options[:subsite] ||= self.subsite
39
- subsite, method = options.get :subsite, :method
40
-
41
- if obj.respond_to?(:member_class) && obj.respond_to?(:origin) && obj.origin
42
- # Asking for URL of a collection, e.g. category/1/adverts or category/1/adverts/new
43
-
44
- refl = obj.origin.class.reverse_reflection(obj.origin_attribute)
45
- owner_name = refl.name.to_s
46
- owner_name = owner_name.singularize if refl.macro == :has_many
47
- if action == :new
48
- action_path = "#{obj.origin_attribute}/new"
49
- action = :"new_for_#{owner_name}"
50
- elsif action.nil?
51
- action_path = obj.origin_attribute
52
- if method.to_s == 'post'
53
- action = :"create_for_#{owner_name}"
54
- else
55
- action = :"index_for_#{owner_name}"
56
- end
57
- end
58
- klass = obj.member_class
59
- obj = obj.origin
60
- else
61
- action ||= case options[:method].to_s
62
- when 'put'; :update
63
- when 'post'; :create
64
- when 'delete'; :destroy
65
- else; obj.is_a?(Class) ? :index : :show
66
- end
67
-
68
- if options[:method].to_s == 'post' && obj.try.new_record?
69
- # Asking for url to post new record to
70
- obj = obj.class
71
- end
72
-
73
- klass = if obj.is_a?(Class)
74
- obj
75
- elsif obj.respond_to?(:member_class)
76
- obj.member_class # We get here if we're passed a scoped class
77
- else
78
- obj.class
79
- end
80
- end
81
-
82
- if Hobo::Routes.linkable?(klass, action, options)
83
-
84
- url = base_url_for(obj, subsite, action)
85
- url += "/#{action_path || action}" unless action.in?(IMPLICIT_ACTIONS)
86
-
87
- params = make_params(params)
88
- params.blank? ? url : "#{url}?#{params}"
89
- end
90
- end
91
-
92
29
  def object_url_new(obj, *args)
93
30
  options = args.extract_options!
94
31
  action = args.first._?.to_sym
@@ -161,26 +98,20 @@ module HoboRouteHelper
161
98
  "#{base_url}#{'/' + subsite unless subsite.blank?}/#{path}"
162
99
  end
163
100
 
164
-
165
101
  def recognize_page_path
166
- # round tripping params through the router will remove
167
- # unnecessary params
168
102
  if params[:page_path]
169
103
  url = params[:page_path]
170
104
  method = "GET"
105
+ Rails.application.routes.recognize_path(url, :method => method)
171
106
  else
172
- url = url_for(params)
173
- method = request.method
174
- end
175
- if ENV['RAILS_RELATIVE_URL_ROOT']
176
- url.gsub!(/^#{ENV['RAILS_RELATIVE_URL_ROOT']}/, "")
177
- url.gsub!(/^https?:\/\/.*?#{ENV['RAILS_RELATIVE_URL_ROOT']}/, "")
107
+ # We used to use "url_for(params)", but with Rails 4 stopped working
108
+ # It seems that we can send back the params directly
109
+ params
178
110
  end
179
- Rails.application.routes.recognize_path(url, :method => method)
180
111
  end
181
112
 
182
113
  def url_for_page_path(options={})
183
- url_for recognize_page_path.merge(options)
114
+ url_for recognize_page_path.merge(options).merge({:only_path => true})
184
115
  end
185
116
 
186
117
  def controller_action_from_page_path
@@ -220,19 +151,19 @@ module HoboRouteHelper
220
151
 
221
152
  # Login url for a given user record or user class
222
153
  def forgot_password_url(user_class=Hobo::Model::UserBase.default_user_model)
223
- send("#{user_class.name.underscore}_forgot_password_url") rescue nil
154
+ send("#{user_class.name.underscore}_forgot_password_path") rescue nil
224
155
  end
225
156
 
226
157
 
227
158
  # Login url for a given user record or user class
228
159
  def login_url(user_class=Hobo::Model::UserBase.default_user_model)
229
- send("#{user_class.name.underscore}_login_url") rescue nil
160
+ send("#{user_class.name.underscore}_login_path") rescue nil
230
161
  end
231
162
 
232
163
 
233
164
  # Sign-up url for a given user record or user class
234
165
  def signup_url(user_class=Hobo::Model::UserBase.default_user_model)
235
- send("signup_#{user_class.name.underscore.pluralize}_url") rescue nil
166
+ send("signup_#{user_class.name.underscore.pluralize}_path") rescue nil
236
167
  end
237
168
 
238
169
 
@@ -245,7 +176,7 @@ module HoboRouteHelper
245
176
  else
246
177
  user_or_class.class
247
178
  end
248
- send("#{c.name.underscore}_logout_url") rescue nil
179
+ send("#{c.name.underscore}_logout_path") rescue nil
249
180
  end
250
181
 
251
182
  def new_for_current_user(model_or_assoc=nil)
@@ -1,6 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
- match 'dryml/:action', :controller => 'dryml_support', :as => 'dryml_support'
4
- match 'dev/:action', :controller => 'dev', :as => 'dev_support' if Rails.application.config.hobo.developer_features
3
+ get 'dryml/:action', :controller => 'dryml_support', :as => 'dryml_support'
4
+ get 'dev/:action', :controller => 'dev', :as => 'dev_support' if Rails.application.config.hobo.developer_features
5
5
 
6
6
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.add_runtime_dependency('hobo_support', ["= #{version}"])
15
15
  s.add_runtime_dependency('hobo_fields', ["= #{version}"])
16
16
  s.add_runtime_dependency('dryml', ["= #{version}"])
17
- s.add_runtime_dependency('will_paginate', ["~> 3.0.0"])
17
+ s.add_runtime_dependency('hobo_will_paginate')
18
18
 
19
19
  s.add_development_dependency('rubydoctest', [">= 1.1.3"])
20
20
  s.add_development_dependency('shoulda', [">= 0"])
@@ -16,7 +16,9 @@ module Hobo
16
16
  end
17
17
 
18
18
  def generate_admin_user_controller
19
- invoke "hobo:controller", ["#{file_name}/#{options[:user_resource_name].pluralize.underscore}"], options
19
+ fixed_options = {:subsite_controller_is_being_created => 1}
20
+ options.each{|k,v| fixed_options[k] = v}
21
+ invoke "hobo:controller", ["#{file_name}/#{options[:user_resource_name].pluralize.underscore}"], fixed_options
20
22
  template "users_index.dryml", "app/views/#{file_name}/#{options[:user_resource_name].pluralize.underscore}/index.dryml" if invite_only?
21
23
  end
22
24
 
@@ -15,7 +15,10 @@ module Generators
15
15
  def generate_controller
16
16
  if class_path.length == 1 and
17
17
  subsite = class_path.first and
18
- File.exist?(File.join('app/controllers', class_path, "#{subsite}_site_controller.rb"))
18
+ (
19
+ options[:subsite_controller_is_being_created] or
20
+ File.exist?(File.join('app/controllers', class_path, "#{subsite}_site_controller.rb"))
21
+ )
19
22
  @subsite = subsite.camelize
20
23
  end
21
24
  template 'controller.rb.erb', File.join('app/controllers',"#{file_path}_controller.rb")
@@ -43,15 +43,16 @@ module Hobo
43
43
 
44
44
  def add_routes
45
45
  return unless options[:add_routes]
46
- route "match 'search' => '#{file_path}#search', :as => 'site_search'"
47
- route "match '#{options[:user_resource_name]}s/:id/activate_from_email/:key' => '#{options[:user_resource_name]}s#activate', :as => 'activate_from_email'"
48
- route "match '#{options[:user_resource_name]}s/:id/accept_invitation_from_email/:key' => '#{options[:user_resource_name]}s#accept_invitation', :as => 'accept_invitation_from_email'"
49
- route "match '#{options[:user_resource_name]}s/:id/reset_password_from_email/:key' => '#{options[:user_resource_name]}s#reset_password', :as => 'reset_password_from_email'"
46
+ route "get 'search' => '#{file_path}#search', :as => 'site_search'"
47
+ route "post 'search' => '#{file_path}#search', :as => 'site_search_post'"
48
+ route "get '#{options[:user_resource_name]}s/:id/activate_from_email/:key' => '#{options[:user_resource_name]}s#activate', :as => 'activate_from_email'"
49
+ route "get '#{options[:user_resource_name]}s/:id/accept_invitation_from_email/:key' => '#{options[:user_resource_name]}s#accept_invitation', :as => 'accept_invitation_from_email'"
50
+ route "get '#{options[:user_resource_name]}s/:id/reset_password_from_email/:key' => '#{options[:user_resource_name]}s#reset_password', :as => 'reset_password_from_email'"
50
51
  if class_path.empty?
51
52
  route "root :to => '#{file_path}#index'"
52
- route "match ENV['RAILS_RELATIVE_URL_ROOT'] => 'front#index' if ENV['RAILS_RELATIVE_URL_ROOT']"
53
+ route "get ENV['RAILS_RELATIVE_URL_ROOT'] => 'front#index' if ENV['RAILS_RELATIVE_URL_ROOT']"
53
54
  else
54
- route "match '#{file_path}' => '#{file_path}#index', :as => '#{file_path.gsub(/\//,'_')}'"
55
+ route "get '#{file_path}' => '#{file_path}#index', :as => '#{file_path.gsub(/\//,'_')}'"
55
56
  end
56
57
  end
57
58
 
@@ -114,7 +114,7 @@ en:
114
114
  update:
115
115
  no_attribute_error: "No update specified in params"
116
116
  success: "Changes to the %{model} were saved"
117
- error: "There was a problem with that change.\\n%{errors}"
117
+ error: "There was a problem with that change.\n%{errors}"
118
118
  destroy:
119
119
  success: "The %{model} was deleted"
120
120
  signup:
@@ -167,6 +167,7 @@ en:
167
167
  table_plus:
168
168
  search: "Search"
169
169
  submit_label: "Go"
170
+ clear_label: "Clear"
170
171
 
171
172
  live_search:
172
173
  label: "Search"
@@ -175,6 +175,7 @@ es:
175
175
  table_plus:
176
176
  search: "Buscar"
177
177
  submit_label: "Ir"
178
+ clear_label: "Limpiar"
178
179
 
179
180
  live_search:
180
181
  label: "Buscar"
@@ -172,6 +172,7 @@ ru:
172
172
  table_plus:
173
173
  search: "Поиск"
174
174
  submit_label: "Искать"
175
+ clear_label: "Очистить"
175
176
 
176
177
  live_search:
177
178
  label: "Найти"
@@ -4,7 +4,7 @@ module Generators
4
4
  class Router
5
5
 
6
6
  # specify that an id CANNOT be null - needed to disambiguate /models from /models/[nil]
7
- ID_REQUIREMENT = "{ :id => %r([^#{ActionController::Routing::SEPARATORS.join}]+) }"
7
+ ID_REQUIREMENT = "{ :id => %r([^#{ActionDispatch::Routing::SEPARATORS.join}]+) }"
8
8
 
9
9
  attr_reader :subsite, :controller, :model, :record, :records
10
10
 
@@ -210,9 +210,11 @@ module Generators
210
210
  return [] unless controller < ::Hobo::Controller::UserBase
211
211
  prefix = records == "users" ? "" : "#{record}_"
212
212
  [
213
- link("match '#{prefix}login(.:format)' => '#{records}#login', :as => '#{record}_login'", 'login'),
213
+ link("post '#{prefix}login(.:format)' => '#{records}#login', :as => '#{record}_login_post'", 'login'),
214
+ link("get '#{prefix}login(.:format)' => '#{records}#login', :as => '#{record}_login'", 'login'),
214
215
  link("get '#{prefix}logout(.:format)' => '#{records}#logout', :as => '#{record}_logout'", 'logout'),
215
- link("match '#{prefix}forgot_password(.:format)' => '#{records}#forgot_password', :as => '#{record}_forgot_password'", 'forgot_password'),
216
+ link("get '#{prefix}forgot_password(.:format)' => '#{records}#forgot_password', :as => '#{record}_forgot_password'", 'forgot_password'),
217
+ link("post '#{prefix}forgot_password(.:format)' => '#{records}#forgot_password', :as => '#{record}_forgot_password_post'", 'forgot_password'),
216
218
  ].compact
217
219
  end
218
220
 
@@ -33,40 +33,4 @@
33
33
  <%- end -%>
34
34
  <%- end -%>
35
35
 
36
- <% unless Rails.configuration.hobo.dont_emit_deprecated_routes %>
37
-
38
- # These are the Hobo 1.3 style routes. They've been included for backwards
39
- # compatibility reasons because the names of some named routes have been changed.
40
- # Please update your views to use the new named route names and then disable this
41
- # section by setting config.hobo.dont_emit_deprecated_routes = true. blah blah
42
-
43
- <% puts "Warning: deprecated routes emitted into config/hobo_routes.rb. These will be removed in Hobo 2.1. Disable this warning by setting config.hobo.dont_emit_deprecated_routes = true." unless subsites.blank? %>
44
- <% for subsite in subsites -%>
45
- <%- if subsite -%>
46
-
47
- <%= "namespace :#{subsite} do" %>
48
- <%- end -%>
49
- <%- for controller in controllers_for(subsite) -%>
50
- <%- router = router_for(subsite, controller)
51
- groups = %w[ index_action lifecycle owner web_method show_action reorder resource ] -%>
52
-
53
- <%- for group in groups -%>
54
- <%- gr = "#{group}_routes"
55
- routes = gr == 'lifecycle_routes' ? router.send(gr.to_sym, subsite) : router.send(gr.to_sym) -%>
56
- <%- unless routes.empty? -%>
57
-
58
- <%= " " if subsite %><%= "# DEPRECATED #{gr.humanize} for controller #{controller.controller_path}" %>
59
- <%- end -%>
60
- <%- for route in routes -%>
61
- <%= " " if subsite %><%= route %>
62
- <%- end -%>
63
- <%- end -%>
64
- <%- end -%>
65
- <%- if subsite -%>
66
-
67
- end
68
- <%- end -%>
69
- <%- end -%>
70
-
71
- <%- end -%>
72
36
  end
@@ -146,8 +146,8 @@ EOI
146
146
  end
147
147
 
148
148
  def will_paginate
149
- say "Adding will_paginate gem"
150
- gem_with_comments('will_paginate', :git => "git://github.com/Hobo/will_paginate.git", :comments => "\n# Hobo's version of will_paginate is required.")
149
+ say "Adding hobo_will_paginate gem"
150
+ gem_with_comments('hobo_will_paginate', :comments => "\n# Hobo's version of will_paginate is required.")
151
151
  end
152
152
 
153
153
  def choose_test_framework
@@ -2,9 +2,9 @@ require 'hobo_support'
2
2
  require 'hobo_fields'
3
3
  require 'dryml'
4
4
  begin
5
- gem 'will_paginate', "3.0.4.hobo"
5
+ gem 'hobo_will_paginate'
6
6
  rescue Gem::LoadError => e
7
- puts "WARNING: unable to activate will_paginate 3.0.4.hobo. Please add gem \"will_paginate\", :git => \"git://github.com/Hobo/will_paginate.git\" to your Gemfile." if File.exist?("app/views/taglibs/application.dryml")
7
+ puts "WARNING: unable to activate hobo_will_paginate. Please add gem \"hobo_will_paginate\" to your Gemfile." if File.exist?("app/views/taglibs/application.dryml")
8
8
  # don't print warning if setup not complete
9
9
  end
10
10
  require 'hobo/extensions/enumerable'
@@ -96,7 +96,7 @@ module Hobo
96
96
  page << "#{function}(#{dom_id.to_json}, #{part_content.to_json})\n"
97
97
  elsif spec[:result]
98
98
  result = results[spec[:result].to_sym]
99
- page << "#{function}(#{dom_id.to_json}, #{result.to_json})\n"
99
+ page << "#{function}(#{dom_id.to_json}, #{result.to_json});\n"
100
100
  else
101
101
  page << "alert('ajax_update_response: render_spec did not provide action');\n"
102
102
  end
@@ -341,7 +341,7 @@ module Hobo
341
341
  hash = args.extract_options!
342
342
  db_sort_field = (hash[field] || hash[field.to_sym] || (field if field.in?(args) || field.to_sym.in?(args))).to_s
343
343
 
344
- if db_sort_field
344
+ unless db_sort_field.blank?
345
345
  if db_sort_field == field && field.match(/\./)
346
346
  fields = field.split(".", 2)
347
347
  db_sort_field = "#{fields[0].pluralize}.#{fields[1]}"
@@ -692,7 +692,7 @@ module Hobo
692
692
  if params[:render]
693
693
  hobo_ajax_response || render(:nothing => true)
694
694
  else
695
- respond_with(self.this, :location => destination_after_submit(this, true, options))
695
+ redirect_to destination_after_submit(this, true, options)
696
696
  end
697
697
  end
698
698
 
@@ -774,12 +774,12 @@ module Hobo
774
774
 
775
775
  begin
776
776
  finder = finder.send(options[:query_scope], params[options[:param]])
777
- items = finder.find(:all).select { |r| r.viewable_by?(current_user) }
777
+ items = finder.select { |r| r.viewable_by?(current_user) }
778
778
  rescue TypeError # must be a list of methods instead
779
779
  items = []
780
780
  options[:query_scope].each do |qscope|
781
781
  finder2 = finder.send(qscope, params[options[:param]])
782
- items += finder2.find(:all).select { |r| r.viewable_by?(current_user) }
782
+ items += finder2.all.select { |r| r.viewable_by?(current_user) }
783
783
  end
784
784
  end
785
785
  if request.xhr?