diff --git a/README.md b/README.md index 4b61cee..3ebeceb 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ gem install solid_cable Now, you need to run the installer: ```bash -$ bin/rails generate solid_cable:install +$ bin/rails solid_cable:install ``` This will create the `db/cable_schema.rb` file. @@ -57,7 +57,7 @@ production: ``` > [!NOTE] -> Calling `bin/rails generate solid_cable:install` will automatically setup `config/cable.yml`, so no additional configuration is needed there (although you must make sure that you use the `cable` name in `database.yml` for this to match!). But if you want to use Solid Cable in a different environment (like staging or even development), you'll have to manually add that `connects_to` block to the respective environment in the `config/cable.yml` file. And, as always, make sure that the name you're using for the database in `config/cable.yml` matches the name you define in `config/database.yml`. +> Calling `bin/rails solid_cable:install` will automatically setup `config/cable.yml`, so no additional configuration is needed there (although you must make sure that you use the `cable` name in `database.yml` for this to match!). But if you want to use Solid Cable in a different environment (like staging or even development), you'll have to manually add that `connects_to` block to the respective environment in the `config/cable.yml` file. And, as always, make sure that the name you're using for the database in `config/cable.yml` matches the name you define in `config/database.yml`. Then run `db:prepare` in production to ensure the database is created and the schema is loaded. diff --git a/lib/tasks/solid_cable_tasks.rake b/lib/tasks/solid_cable_tasks.rake new file mode 100644 index 0000000..5eaaef5 --- /dev/null +++ b/lib/tasks/solid_cable_tasks.rake @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +desc "Copy over the schema and set cache for Solid Cable" +namespace :solid_cable do + task :install do + Rails::Command.invoke :generate, ["solid_cable:install"] + end +end