Sha256: 491a69abfa07c34cfe3f1583341553d6650c754e9c326aa4eff4eade808de99e

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

require 'dm-is-predefined'

class TestModel

  include DataMapper::Resource

  is :predefined

  # Primary key of the test model
  property :id, Serial

  # Name property to test String values
  property :name, String

  # Number property to test Integer values
  property :number, Integer

  # Optional property to test default values
  property :optional, String, :default => 'hello'

  # Body property to test Text values
  property :body, Text

  predefine :test1, :name => 'test1',
                    :number => 1,
                    :optional => 'yo',
                    :body => %{This is a test.}

  predefine :test2, :name => 'test2', :number => 2

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dm-is-predefined-0.4.0 spec/integration/models/test_model.rb
dm-is-predefined-0.3.1 spec/integration/models/test_model.rb
dm-is-predefined-0.3.0 spec/integration/models/test_model.rb