implementing using `ActiveSupport::Concern` in Ruby module with instance variables
I'm working on a project and hit a roadblock. I'm reviewing some code and I'm upgrading from an older version and I've been trying to use `ActiveSupport::Concern` to create a shared module for my Rails 6 application, but I'm running into issues when trying to access instance variables in my included class. My module looks like this: ```ruby module MyModule extend ActiveSupport::Concern included do before_action :set_variable end def set_variable @my_variable = 'Hello World' end def print_variable puts @my_variable end end ``` And in my controller, I'm including this module: ```ruby class MyController < ApplicationController include MyModule def index print_variable end end ``` When I run the application and navigate to the index action, I get the following behavior: ``` NoMethodError: undefined method `print_variable` for MyController:Class ``` I initially thought it was a scoping scenario, but I verified that the `print_variable` method is defined in the module. I've also tried explicitly calling `self.print_variable` inside the controller, but that didn't work either. Any ideas on why this is happening? Is there a specific way I should be defining or including these methods to access instance variables correctly? Could it be due to how I'm using `ActiveSupport::Concern`? I'm currently using Ruby 2.6 and Rails 6.1. For context: I'm using Ruby on Ubuntu. What am I doing wrong? This issue appeared after updating to Ruby stable. Has anyone dealt with something similar? This is my first time working with Ruby 3.9. Any feedback is welcome! My team is using Ruby for this microservice.