Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8511251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:56:15+00:00 2026-06-11T03:56:15+00:00

I have a class Ryte::Theme. If I call included_modules on the class I get

  • 0

I have a class Ryte::Theme. If I call included_modules on the class I get back (abbreviated):

[Ryte::Bundleable::Core, Ryte::Bundleable::Validators,
Ryte::Bundleable::Builder, ActiveModel::Validations::HelperMethods,
ActiveModel::Validations, ActiveSupport::Callbacks, Ryte::Bundleable]

Ryte::Theme is pulling in nested modules through a single module Ryte::Bundleable. Here are the relevant class and module definitions:

class Ryte::Theme
  include Ryte::Bundleable
end


module Ryte::Bundleable
  extend ActiveSupport::Concern

  included do
    include ActiveModel::Validations
    include Ryte::Bundleable::Builder
    include Ryte::Bundleable::Validators
    include Ryte::Bundleable::Core
  end
end

Given this, why is it I receive the following response:

Ryte::Theme.include?(Ryte::Theme::Validators)
=> true

I have not included this additional module (yet).. This is evident in the included_modules response. Is this related to ActiveSupport Concern? I want to be able to include Ryte::Theme::Validators and have it mixin as well but since it thinks it is already included it does not include it ‘again’ (as it shouldn’t if that were true). As such it gets left behind when I add the include to the class definition, like so:

class Ryte::Theme
  include Ryte::Bundleable
  include Ryte::Theme::Validators # <- Does not load
end

Why is this additional module Ryte::Theme::Validators not mixing in as well?

ADDED

Ok just realized:

1.9.3p194 :005 > Ryte::Bundleable::Validators == Ryte::Theme::Validators
 => true 

Odd.. why is this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:56:17+00:00Added an answer on June 11, 2026 at 3:56 am

    UPDATE: This is related to ActiveSupport::Concern (see below).

    Try the following:

    # initialize constants
    class A; end                               # class Ryte
    module A::B; end                           # module Ryte::Bundleable
    module A::B::C; end                        # module Ryte::Bundleable::Validators
    
    module A::B                                # module Ryte::Bundleable
      def self.include(base)
        base.class_eval do
          include A::B::C                      # include Ryte::Bundleable::Validators
        end
      end
    end
    
    class D                                    # class Ryte::Theme
      include A::B                             # include Ryte::Bundleable
    end
    
    A::B::C == D::C                            #=> true
    

    This happens because of the way the modules and classes are namespaced: when you include A::B::C from inside of A::B, the module name is referenced relative to the module itself, which becomes just C (in your case, just Validators). Thus when you include A::B in some other class D, rather than including a module named A::B::C (i.e. Ryte::Bundleable::Validators), ruby includes a module named just C (i.e. Validators). This is why Ryte::Bundleable::Validators == Ryte::Theme::Validators evaluates to true.

    However, with the example above:

    D.include?(A::B::C)                       #=> false
    

    So this is where ActiveSupport::Concern kicks in. Redefine the module A::B above as follows:

    module A::B                                # module Ryte::Bundleable
      extend ActiveSupport::Concern
    
      included do
        include A::B::C                      # include Ryte::Bundleable::Validators
      end
    end
    

    And you will find that D.include?(A::B::C) now evaluates to true. I’m honestly not sure why this happens, but it must have something to do with the namespacing above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class with back reference: public class Employee : Entity { private string
I have class that extends BroadcastReceiver and gets all new sms. When I get
I have class with internal property: internal virtual StateEnum EnrolmentState { get { ..getter
I have class Myadapter extends BaseAdapter.in Myadapter i changed the MyListView data then call
I have Class and Student objects. Both have collection of another as property. Which
I have class LegacyClass which inherits OldBaseClass. I'm considering a change to introduce a
I have class that extend FragmentActivity in it I add fragment to layout as
I have class grades that I need to check if a specific grade is
I have class with collection as below public class MyClass:IXmlSerializable { int vesrion; private
I have class Meat extends Food { $var = Food::foodFunction… } I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.