Sha256: bdb8570aa6b987b642db1246ed2eff5bcccab9efa23572028c7098fb93c382b8

Contents?: true

Size: 477 Bytes

Versions: 4

Compression:

Stored size: 477 Bytes

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe 'Legacy mappings' do
  
  it('should allow models to map with custom attribute names') do
    Fruit.first.name.should == 'Kiwi'
  end
  
  it('should allow custom foreign-key mappings') do
    database do
      Fruit.first(:name => 'Watermelon').devourer_of_souls.should == Animal.first(:name => 'Cup')
      Animal.first(:name => 'Cup').favourite_fruit.should == Fruit.first(:name => 'Watermelon')
    end
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datamapper-0.2.5 spec/legacy_spec.rb
datamapper-0.3.0 spec/legacy_spec.rb
datamapper-0.3.1 spec/legacy_spec.rb
datamapper-0.3.2 spec/legacy_spec.rb