{"id":16065720,"url":"https://github.com/marcoroth/conventional_extensions-repro","last_synced_at":"2025-02-23T04:16:38.644Z","repository":{"id":98534736,"uuid":"564958885","full_name":"marcoroth/conventional_extensions-repro","owner":"marcoroth","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-11T23:25:07.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T23:32:50.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcoroth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-11T23:11:28.000Z","updated_at":"2022-11-11T23:23:22.000Z","dependencies_parsed_at":"2023-03-07T00:15:38.566Z","dependency_job_id":null,"html_url":"https://github.com/marcoroth/conventional_extensions-repro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fconventional_extensions-repro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fconventional_extensions-repro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fconventional_extensions-repro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fconventional_extensions-repro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcoroth","download_url":"https://codeload.github.com/marcoroth/conventional_extensions-repro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240266874,"owners_count":19774081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T05:20:29.298Z","updated_at":"2025-02-23T04:16:38.590Z","avatar_url":"https://github.com/marcoroth.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## conventional_extensions-repro\n\n### Versions\n\nconventional_extensions Version: 0.3.0\n\nRuby Version: 3.1.2\n\nRails Version: 7.0.4\n\n### Relevant Files\n\n* [`app/models/post.rb`](https://github.com/marcoroth/conventional_extensions-bug/blob/main/app/models/post.rb)\n* [`app/models/post/extensions/mailroom.rb`](https://github.com/marcoroth/conventional_extensions-bug/blob/main/app/models/post/extensions/mailroom.rb)\n\n### Reproducion Steps\n\n```shell\nbundle install\n```\n\n```shell\nrails db:create db:migrate \n```\n\n```shell\nrails c\n```\n\n```\nLoading development environment (Rails 7.0.4)\nirb(main):001:0\u003e Post.new.mailroom\n/Users/marcoroth/.anyenv/envs/rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/conventional_extensions-0.3.0/lib/conventional_extensions.rb:15:in `load_extensions': private method `load' called for nil:NilClass (NoMethodError)\n\n    @loader.load(*extensions)\n           ^^^^^\n```\n\n### Possible fix?\n\nThis seems to fix it locally, but honestly I haven't fully grokked why `@loader` wouldn't need to be defined in some cases. This \"fix\" possibly also has some unwanted side-effects since `@loader` is not going to be cleaned up in the `ensure` block because of the `loader_defined_before_entrance` condition.\n\n```diff\n  def load_extensions(*extensions, from: Frame.previous.path)\n-   @loader = Loader.new(self, from) unless loader_defined_before_entrance = defined?(@loader)\n+   loader_defined_before_entrance = defined?(@loader)\n+   @loader = Loader.new(self, from) unless loader_defined_before_entrance\n+   @loader = Loader.new(self, from) if @loader.nil\n    @loader.load(*extensions)\n  ensure\n    @loader = nil unless loader_defined_before_entrance\n  end\n```\n\nAm I even supposed to use `load_exentions` inside a model class under `app/models/`?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fconventional_extensions-repro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoroth%2Fconventional_extensions-repro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fconventional_extensions-repro/lists"}