We need to describe the overall goal we're trying to achieve with DM2
, break it up into manageable small steps and come up with a realistic timeframe / amount of hours to make it happen.
PATH | |
remote: /Users/snusnu/projects/github/shared/datamapper/dm-core | |
specs: | |
dm-core (1.0.2) | |
addressable (~> 2.2) | |
extlib (~> 0.9.15) | |
PATH | |
remote: /Users/snusnu/projects/github/shared/datamapper/dm-do-adapter | |
specs: |
## Problem | |
Currently, relationships are stored in a hash. This means that the order in which they were created gets lost. | |
* A model with a composite primary key that is made up of two foreign keys (e.g. a join table) | |
* Only the relationships are defined (using #belongs_to) | |
* Properties are *not* explicitly defined (using #property) | |
class PersonTask | |
include DataMapper::Resource |
require 'dm-core' | |
require 'dm-migrations' | |
URI = 'postgres://localhost/test'.freeze | |
DataMapper::Logger.new($stdout, :debug) | |
DataMapper.setup(:default, URI) | |
class Account | |
include DataMapper::Resource |
<mxGraphModel dx="1626" dy="1969" scale="0.833" grid="1" guides="1" tooltips="1" connect="1" fold="1" page="0" pageScale="1" pageWidth="826" pageHeight="1169" style="default-style2"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="46" value="" style="rounded=1" parent="1" vertex="1"><mxGeometry x="10" y="-10" width="770" height="340" as="geometry"/></mxCell><mxCell id="47" value="Address.belongs_to :user, User" style="text;fontFamily=Courier New;strokeWidth=1;fillColor=#999999;fontStyle=1" parent="1" vertex="1"><mxGeometry x="270" y="6.500000000000078" width="250" height="29" as="geometry"/></mxCell><mxCell id="48" value="" style="group;fontFamily=Courier New" parent="1" vertex="1" connectable="0"><mxGeometry x="125" y="86" width="520" height="80" as="geometry"/></mxCell><mxCell id="13" value="addresses__X__users" style="rhombus;fontFamily=Courier New" parent="48" vertex="1"><mxGeometry x="170" width="170" height="70" as="geometry"/></mxCell><mxCell id="27" value=":user" style="fontFamily=Courier |
Heckle found 279 mutations that didn't cause spec violations | |
DataMapper::RelationRegistry::RelationNode contains the following poorly-specified methods: | |
- #initialize | |
DataMapper::RelationRegistry::RelationEdge contains the following poorly-specified methods: | |
- #relation | |
DataMapper::RelationRegistry::Builder::BaseBuilder contains the following poorly-specified methods: | |
- #name |
require 'equalizer' | |
require 'abstract_type' | |
module DataMapper | |
module Relation | |
class Graph | |
class Node | |
class Aliases |
require 'pp' | |
require 'adamantium' | |
require 'equalizer' | |
require 'concord' | |
require 'abstract_type' | |
require 'aequitas' | |
require 'ducktrap' | |
require 'anima' | |
require 'substation' |
Graph::Node
only exists because of our pimped jersey header that supports renaming the attributes during a join (and currently only a join, i.e. no support for other binary ops). If axiom would support Relation#join(other, join_definition)
there would be no need for Graph::Node
. The graph's nodes would be Axiom::Relation
instances and the (directed) edges would continue to be composed of a name, a JoinDefinition
instance and pointers to both source
and target
nodes.
ROM::Relation
instances should be composed of an Axiom::Relation
and a Mapper
. Pushing the mapper to the tuple level renders our current AttributeSet
useless, or rather, i suspect that its functionality will be subsumed in Mapper
. If axiom would support an injectable EvaluatorContext
for operations that accept a block (like #join etc), we should be able to come up with a context that is composed of the axiom relation and the mapper, thus allowing us to use "object land" attribute names inside the block, while still const
" a function that preserves the state | |
" see http://technotales.wordpress.com/2010/03/31/preserve-a-vim-function-that-keeps-your-state/ | |
function! Preserve(command) | |
" Preparation: save last search, and cursor position. | |
let _s=@/ | |
let l = line(".") | |
let c = col(".") | |
" Do the business: | |
execute a:command | |
" Clean up: restore previous search history, and cursor position |