# File lib/dm-core/model/property.rb, line 50
      def property(name, type, options = {})
        property = DataMapper::Property.new(self, name, type, options)

        properties(repository_name) << property

        # Add property to the other mappings as well if this is for the default
        # repository.
        if repository_name == default_repository_name
          @properties.except(repository_name).each do |repository_name, properties|
            next if properties.named?(name)

            # make sure the property is created within the correct repository scope
            DataMapper.repository(repository_name) do
              properties << DataMapper::Property.new(self, name, type, options)
            end
          end
        end

        # Add the property to the lazy_loads set for this resources repository
        # only.
        # TODO Is this right or should we add the lazy contexts to all
        # repositories?
        if property.lazy?
          context = options.fetch(:lazy, :default)
          context = :default if context == true

          properties = properties(repository_name)

          Array(context).each do |context|
            properties.lazy_context(context) << self
          end
        end

        # add the property to the child classes only if the property was
        # added after the child classes' properties have been copied from
        # the parent
        descendants.each do |descendant|
          descendant.properties(repository_name)[name] ||= property
        end

        create_reader_for(property)
        create_writer_for(property)

        property
      end