fixed rake db:index description #347

Merged
merged 1 commit into from Nov 10, 2011

4 participants

@bearded

Hey guys,

Please pull

Thanks!

@bkeepers

Doh, thanks.

@bkeepers bkeepers commented on an outdated diff Nov 10, 2011
lib/mongo_mapper/railtie/database.rake
@@ -55,10 +55,12 @@ namespace :db do
end
end
- desc 'Load the seed data from db/seeds.rb'
- task :index => :environment do
- indexes = File.join(Rails.root, 'db', 'indexes.rb')
- load(indexes) if File.exist?(indexes)
+ unless Rake::Task.task_defined?("db:index")
@bkeepers
bkeepers added a line comment Nov 10, 2011

We shouldn't need the unless since ActiveRecord doesn't define this rake task. But it probably doesn't hurt either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@bearded

Removed unless and rebased

@bkeepers bkeepers merged commit 5896128 into mongomapper:master Nov 10, 2011
@brodock

could you please give an example how to use db/indexes.rb? I'm getting tons of deprecation warnings but didn't found any documentation that could give me a simple example.

@samvincent

@brodock Looks like you just define them like in the documentation

  # db/indexes.rb
  MongoClass.ensure_index(:index_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment