Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

dm-is-remixable fails with namespaced models #9

Open
lupine opened this issue Dec 17, 2010 · 0 comments
Open

dm-is-remixable fails with namespaced models #9

lupine opened this issue Dec 17, 2010 · 0 comments
Milestone

Comments

@lupine
Copy link

lupine commented Dec 17, 2010

Here's a simple testcase:

require 'rubygems'
require 'dm-core'

#  See issue 8 for why I'm doing this
require 'extlib/inflection'
module ActiveSupport
  Inflector = ::Extlib::Inflection
end

require 'dm-is-remixable'

module Test

  module Foo
    include DataMapper::Resource
    is :remixable

    property :id, Serial
  end

  class WorkingFoo
    include DataMapper::Resource
    property :id, Serial
    property :bar_id, Integer
  end

  class Bar
    include DataMapper::Resource
    property :id, Serial
    has n, :working_foos  # Works
    remix n, :foos        # Doesn't work
  end
end

I get:
NameError: uninitialized constant Foo
from dm-core-1.0.2/lib/dm-core/core_ext/object.rb:13:in full_const_get' from dm-core-1.0.2/lib/dm-core/core_ext/object.rb:10:ineach'
from dm-core-1.0.2/lib/dm-core/core_ext/object.rb:10:in full_const_get' from dm-is-remixable-1.0.2/lib/dm-is-remixable/is/remixable.rb:160:inremix'

It might actually be a bug in dm-core, I guess (since we're using full_const_get) - but the has n, :working_foos doesn't raise in the same manner.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant