Skip to content

Commit

Permalink
Also search subdirectories of models in rake sunspot:mongo:reindex.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaw authored and dblock committed Jan 27, 2015
1 parent 99b1b67 commit 55e2bf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [#5](https://github.com/derekharmel/sunspot_mongo/pull/5): Added CONTRIBUTING and CHANGELOG - [@dblock](https://github.com/dblock).
* [#5](https://github.com/derekharmel/sunspot_mongo/pull/5): Added Travis-CI - [@dblock](https://github.com/dblock).
* [#5](https://github.com/derekharmel/sunspot_mongo/pull/5): Added RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock).
* [#1](https://github.com/derekharmel/sunspot_mongo/pull/1): Also search subdirectories of models in `rake sunspot:mongo:reindex` - [@aaw](https://github.com/aaw).
* Your contribution here.

#### 1.0.1 (2011/10/08)
Expand Down
2 changes: 1 addition & 1 deletion lib/sunspot/mongo/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
sunspot_models = if args[:models]
args[:models].split('+').map(&:constantize)
else
all_files = Dir.glob(Rails.root.join('app', 'models', '*.rb'))
all_files = Dir.glob(Rails.root.join('app', 'models', '**', '*.rb'))
all_models = all_files.map { |path| File.basename(path, '.rb').camelize.constantize }
all_models.select { |m| m.include?(Sunspot::Mongo) && m.searchable? }
end
Expand Down

0 comments on commit 55e2bf1

Please sign in to comment.