{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1157","repository_url":"https://api.github.com/repos/thoughtbot/factory_bot","labels_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1157/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1157/comments","events_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1157/events","html_url":"https://github.com/thoughtbot/factory_bot/issues/1157","id":340524275,"node_id":"MDU6SXNzdWUzNDA1MjQyNzU=","number":1157,"title":"Customizing scaffold generator of factory_bot","user":{"login":"Kani999","id":17337078,"node_id":"MDQ6VXNlcjE3MzM3MDc4","avatar_url":"https://avatars2.githubusercontent.com/u/17337078?v=4","gravatar_id":"","url":"https://api.github.com/users/Kani999","html_url":"https://github.com/Kani999","followers_url":"https://api.github.com/users/Kani999/followers","following_url":"https://api.github.com/users/Kani999/following{/other_user}","gists_url":"https://api.github.com/users/Kani999/gists{/gist_id}","starred_url":"https://api.github.com/users/Kani999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kani999/subscriptions","organizations_url":"https://api.github.com/users/Kani999/orgs","repos_url":"https://api.github.com/users/Kani999/repos","events_url":"https://api.github.com/users/Kani999/events{/privacy}","received_events_url":"https://api.github.com/users/Kani999/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-12T07:43:38Z","updated_at":"2018-07-13T15:42:28Z","closed_at":"2018-07-13T15:42:28Z","author_association":"NONE","body":"Is there any way how can I rewrite generator for `spec/factories/name_of_factory.rb` to be generated by my needs? \r\n\r\nI tried:\r\n\r\n```\r\nlib/templates/rspec/factory_bot.rb\r\nlib/templates/rspec/scaffold/factory_bot.rb\r\n```\r\n\r\nOr my own generator:\r\n```\r\n\r\nlib/generators/rails/factory_bot_changes\r\nlib/generators/rails/factory_bot_changes/USAGE\r\nlib/generators/rails/factory_bot_changes/factory_bot_changes_generator.rb\r\nlib/generators/rails/factory_bot_changes/templates\r\nlib/generators/rails/factory_bot_changes/templates/factory_bot.rb\r\nI also tried to change the config/application.rb\r\n```\r\n\r\n```\r\nconfig.generators do |gen|\r\n  gen.orm :active_record\r\n  gen.template_engine :haml\r\n  gen.test_framework :rspec,\r\n                     fixtures: true,\r\n                     view_specs: true,\r\n                     helper_specs: true,\r\n                     routing_specs: true,\r\n                     controller_specs: true,\r\n                     request_specs: true\r\n  gen.helper :helper_and_policy\r\n  gen.scaffold_controller :controller_with_smart_listing\r\n  gen.fixture_replacement :factory_bot, dir: \"spec/factories\"\r\n  # gen.fixture_replacement :factory_bot_changes, dir: \"spec/factories\"\r\n  gen.factory_bot false\r\nend\r\n```\r\n\r\nBut nothing seems to be working.\r\n\r\nIs there some folder, where I can put my own template which will be used?"},"comment":{"url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/comments/404871551","html_url":"https://github.com/thoughtbot/factory_bot/issues/1157#issuecomment-404871551","issue_url":"https://api.github.com/repos/thoughtbot/factory_bot/issues/1157","id":404871551,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDg3MTU1MQ==","user":{"login":"composerinteralia","id":13696143,"node_id":"MDQ6VXNlcjEzNjk2MTQz","avatar_url":"https://avatars3.githubusercontent.com/u/13696143?v=4","gravatar_id":"","url":"https://api.github.com/users/composerinteralia","html_url":"https://github.com/composerinteralia","followers_url":"https://api.github.com/users/composerinteralia/followers","following_url":"https://api.github.com/users/composerinteralia/following{/other_user}","gists_url":"https://api.github.com/users/composerinteralia/gists{/gist_id}","starred_url":"https://api.github.com/users/composerinteralia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/composerinteralia/subscriptions","organizations_url":"https://api.github.com/users/composerinteralia/orgs","repos_url":"https://api.github.com/users/composerinteralia/repos","events_url":"https://api.github.com/users/composerinteralia/events{/privacy}","received_events_url":"https://api.github.com/users/composerinteralia/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T15:42:28Z","updated_at":"2018-07-13T15:42:28Z","author_association":"MEMBER","body":"This sounds like a`factory_bot_rails` issues, related to https://github.com/thoughtbot/factory_bot_rails/issues/14 and https://github.com/thoughtbot/factory_bot_rails/issues/148. I think there may have been a custom template option in earlier versions, but it maybe got removed. I haven't looked into it too deeply. I'm going to close this issue, but feel free to add a comment on one of those other issues with any additional information. Thanks!"}}
{"actor":{"display_login":"composerinteralia"}}