solnic / virtus

[DISCONTINUED ] Attributes on Steroids for Plain Old Ruby Objects
MIT License
3.77k stars 229 forks source link

Added an example using Boolean in a module #169

Closed rawsyntax closed 11 years ago

rawsyntax commented 11 years ago

Ran into a namespacing issue using virtus in a module:

module Admin
  include Virtus

  attribute :admin, Boolean
end

Including that module in a class would give `const_missing': uninitialized constant Boolean (NameError)

However, spelling it out as Virtus::Attribute::Boolean resolved the error

solnic commented 11 years ago

Thanks. That should be considered as a bug. So I'm gonna fix it rather than to tell people to treat Boolean in a special way :)