[Nitro] [BUG] Timestamped mixin masks Aspects

vseguip at gmail.com vseguip at gmail.com
Tue Sep 12 12:43:08 EDT 2006


When making a class Timestamped, it will mask the "after", et al
methods  of aspects, so you have to include Aspects explicitly again.
Facets is version 1.4.5, og is latest from manveru.

require 'rubygems'
require 'facets'
require 'test/unit'
require 'ostruct'

require 'og'
require 'glue/timestamped'

class TestCaseOgTimestampedAspect < Test::Unit::TestCase # :nodoc: all

  class Article
    is Glue::Timestamped
    property :body, String

    def initialize(body = nil)
      @body = body
    end
    after :read_hook,
    def read_hook
    end
  end

  $og1.manage_classes Article

  def test_all
    a = Article.create('article')
    a.save

    a = Article[1]
    assert a.create_time
  end

end


Doing some more investigation I found aout that any mixin that
includes Aspects shows the same behavior as Timestamped (that is it
will mask the methods)


Cheers
V. Segui


More information about the Nitro-general mailing list