Sha256: 9069a0a0a7fbd127ae7160cde23c0461ca45bd010879e788584cdbebb9a39aec

Contents?: true

Size: 624 Bytes

Versions: 4

Compression:

Stored size: 624 Bytes

Contents

module DataMapper
  module Types
    module Fixtures

      class Article
        #
        # Behaviors
        #

        include ::DataMapper::Resource

        #
        # Properties
        #

        property :id,         Serial

        property :title,      String, :length => 255
        property :body,       Text

        property :created_at,   DateTime
        property :updated_at,   DateTime
        property :published_at, DateTime

        property :slug, Slug

        #
        # Hooks
        #

        before :valid? do
          self.slug = self.title
        end
      end # Article
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dm-types-1.0.0 spec/fixtures/article.rb
dm-types-1.0.0.rc3 spec/fixtures/article.rb
dm-types-1.0.0.rc2 spec/fixtures/article.rb
dm-types-1.0.0.rc1 spec/fixtures/article.rb