Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New acts_as_taggable_on:sharded_db:install_initializer task is broken #1127

Open
Mr0grog opened this issue Jul 11, 2024 · 0 comments
Open

New acts_as_taggable_on:sharded_db:install_initializer task is broken #1127

Mr0grog opened this issue Jul 11, 2024 · 0 comments

Comments

@Mr0grog
Copy link

Mr0grog commented Jul 11, 2024

I was upgrading to v10, and tried running the new acts_as_taggable_on:sharded_db:install_initializer Rake task, but I get the following error:

Don't know how to build task 'config/initializers/foo' (See the list of available tasks with `rails --tasks`)
Did you mean?  config/initializers

Tasks: TOP => acts_as_taggable_on:sharded_db:install_initializer

I think this is pretty simple; the task just depends on the wrong prequisite and it should be "config/initializers" (see the directory task below the install_initializer task):

desc "Install initializer setting custom base class"
task :install_initializer => [:environment, "config/initializers/foo"] do
source = File.join(
Gem.loaded_specs["acts-as-taggable-on"].full_gem_path,
"lib",
"tasks",
"examples",
"acts_as_taggable_on.rb.example"
)
destination = "config/initializers/acts_as_taggable_on.rb"
cp source, destination
end
directory "config/initializers"

I’m happy to write a PR to fix this! BUT, I was also curious about:

  1. base_class is missing from the “configuration” section of the README. Should I add it there?

  2. There are no docs for this Rake task; I only found it by reading the release notes. Should I add it to the README somewhere?

  3. The current template for the initializer uses the pattern:

    ActsAsTaggableOn.setup do |config|
      config.<whatever> = <value>
    end

    But the docs use the pattern:

    ActsAsTaggableOn.<whatever> = <value>

    Both work fine, but it’s probably good to be consistent. Should one or the other change?

  4. The task is namespaced under sharded_db, but it’s mostly just plopping in a generic initializer. Would it be better to rename it to acts_as_taggable_on:install_initializer and add the other config attributes to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant