Cannot include Virtus enabled Modules into other Modules #93

Closed
postmodern opened this Issue Jun 11, 2012 · 1 comment

2 participants

@postmodern
module Mixin
  include Virtus
end

module Mixin2
  include Mixin

  attribute :foo, String
end
NoMethodError: undefined method `superclass' for Mixin2:Module
    from /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/virtus-0.5.0/lib/virtus/class_methods.rb:43:in `attribute_set'
    from /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/virtus-0.5.0/lib/virtus/extensions.rb:89:in `virtus_add_attribute'
    from /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/virtus-0.5.0/lib/virtus/class_methods.rb:110:in `virtus_add_attribute'
    from /home/hal/.rvm/gems/ruby-1.9.3-p194/gems/virtus-0.5.0/lib/virtus/extensions.rb:53:in `attribute'
    from (irb):7:in `'
    from (irb):5
    from /home/hal/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `'
@dkubb dkubb added a commit that referenced this issue Jun 11, 2012
@dkubb dkubb [#93] Fix module inclusion problem
* When a module includes Virtus, and then is included into another
  module an error was thrown.
f75c1f7
@dkubb dkubb closed this Jun 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment