Im not sure if this is caused by dm-rails.
The code is here:
You can execute the _setup.sh (copy & paste to terminal) which should setup a rails 3 project with a Gemfile, rspec, the models and one spec. The spec should fail (at least when i execute it it fails with "expected: nil got: nil").
It seems like during the DataMapper.auto_migrate! the columns in the Database for Friendship.request are not created. In a standalone test with the same models though it works and Friendship has one :request_sender_id and :request_receiver_id property. The standalone-spec is here: https://gist.github.com/1010908
Am i doing something wrong or is this a dm-rails/dm-migration/whatever bug?
Is this still a problem?
It seems so. I adjusted the gist to rails 3.1.1 and dm 1.2.0: https://gist.github.com/1011318
The Friendship class has a
belongs_to :request, 'FriendshipRequest'
but the SQL output from auto_migrate is:
CREATE TABLE "friendships" ("user_id" INTEGER NOT NULL, "friend_id" INTEGER NOT NULL, PRIMARY KEY("user_id", "friend_id"))
and the error of the spec is:
Failure/Error: fs.request.should_not be_nil
expected: not nil
# ./spec/models/friendship_spec.rb:16:in `block (2 levels) in <top (required)>'
in the spec: https://gist.github.com/1011318#file_spec_models_friendship_spec.rb
This could be either a dm-migrations or sqlite issue.
If this is still a problem, can you update the gist again. It's no longer runnable.
I'll reopen if this is an issue still.