lib/groonga_client_model/railties/groonga.rake in groonga-client-model-1.0.1 vs lib/groonga_client_model/railties/groonga.rake in groonga-client-model-1.0.2

- old
+ new

@@ -26,12 +26,17 @@ GroongaClientModel::Client.url = config["url"] end end namespace :schema do - desc "Loads db/schema.grn into the Groonga database" + schema_path = GroongaClientModel::SchemaLoader.default_path + desc "Loads #{schema_path} into the Groonga database" task load: ["config:load"] do - schema_loader = GroongaClientModel::SchemaLoader.new(Rails.root) + full_schema_path = Rails.root + schema_path + unless full_schema_path.exist? + raise "Schema file doesn't exist: #{full_schema_path}" + end + schema_loader = GroongaClientModel::SchemaLoader.new(full_schema_path) schema_loader.load end end namespace :migrate do