dkubb changed the topic of #datamapper to: Datamapper v1.2.0 | Mailing List: http://is.gd/aa9D | Logs: http://is.gd/qWAL7V | DataMapper 2 Renamed to ROM, see #rom-rb for development
brianpWins has quit [Quit: brianpWins]
the_hack has quit [Quit: Leaving...]
zombor_ has joined #datamapper
zombor_ has joined #datamapper
zombor has quit [Ping timeout: 246 seconds]
zombor_ has quit [Read error: Connection reset by peer]
zombor has joined #datamapper
Sylvain1 has quit [Ping timeout: 246 seconds]
snusnu has quit [Quit: Leaving.]
kurko_ has quit [Ping timeout: 256 seconds]
zombor_ has joined #datamapper
zombor_ has quit [Changing host]
zombor_ has joined #datamapper
zombor has quit [Read error: Connection reset by peer]
kurko_ has joined #datamapper
zombor_ has quit [Ping timeout: 264 seconds]
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Read error: Connection reset by peer]
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
facerip has quit [Quit: leaving]
zombor has quit [Remote host closed the connection]
jhn has joined #datamapper
kurko_ has quit [Quit: Computer has gone to sleep.]
jhn has quit [Ping timeout: 240 seconds]
brianpWins has joined #datamapper
v0n has quit [Ping timeout: 240 seconds]
brianpWins has quit [Quit: brianpWins]
pekup has joined #datamapper
pekup has quit [Client Quit]
priyam_ has joined #datamapper
mikecmpbll has joined #datamapper
mbj has joined #datamapper
mbj has quit [Read error: Operation timed out]
brianpWins has joined #datamapper
snusnu has joined #datamapper
stormwind has quit [Remote host closed the connection]
snusnu has quit [Quit: Leaving.]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
snusnu has joined #datamapper
mikecmpbll has joined #datamapper
kurko_ has joined #datamapper
kurko_ has quit [Quit: Computer has gone to sleep.]
postmodern has quit [Quit: Leaving]
postmodern has joined #datamapper
postmodern has quit [Quit: Leaving]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
knowtheory has quit [Ping timeout: 240 seconds]
knowtheory has joined #datamapper
zombor has joined #datamapper
kurko_ has joined #datamapper
kurko_ has quit [Read error: Connection reset by peer]
jack has joined #datamapper
jack is now known as Guest78268
Guest78268 has quit [Client Quit]
v0n has joined #datamapper
knowtheory has quit [Ping timeout: 245 seconds]
mbj has joined #datamapper
knowtheory has joined #datamapper
calebdre has joined #datamapper
<calebdre> Hello?
mbj has quit [Quit: leaving]
mikecmpbll has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
calebdre has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
kurko_ has joined #datamapper
kurko_ has quit [Client Quit]
mbj has joined #datamapper
Sylvain1 has joined #datamapper
snusnu has quit [Quit: Leaving.]
Sylvain1 has quit [Quit: Leaving.]
snusnu has joined #datamapper
Sylvain1 has joined #datamapper
brianpWins has quit [Quit: brianpWins]
kurko_ has joined #datamapper
kurko_ has quit [Ping timeout: 245 seconds]
mbj has quit [Quit: leaving]
<Eiam> namelessjon_: yeah, I've been having that same problem, I can't get a repro case
<Eiam> namelessjon_: all I've got is data in the DB that shouldn't be there, and tracing the only way data is input (first_or_create)
<Eiam> I've already gotten a couple use reports about it, and the data is clearly duplicated
<Eiam> (in the DB)
<Eiam> but fuck if I can repro it
<Eiam> I'm tempted to just yeah, force it on the model level and let i t throw an error
<Eiam> how can you make a set of columns unique?
<Eiam> e.g. id+id = must be unique for this given set
<namelessjon_> Eiam: :unique => :symbol
<Eiam> right but that would just set it unique within all records
<Eiam> e.g. couldn't have two model objects with a model.attr the same
<Eiam> what i need is model.attr + model.attr2 = must be unique
mbj has joined #datamapper
<Eiam> I can have many cats. Cats may only have one Owner as a Cat + Owner combination
<Eiam> I may have two copies of the same cat
<Eiam> but the intersection of each copy of the cat may only have 1 owner
<Eiam> e.g. the only thing that makes these cats different (at first) would be that they have different owners.
<Eiam> over time they may differentiate
brianpWins has joined #datamapper
<namelessjon_> Eiam: Okay, so I remembered the syntax a little wrong: http://pastie.org/private/itdsw4olhfjbzcy18fzqcw
<Cinchy> [pastie] Private Paste - Pastie (at pastie.org, on 2013-08-23 22:01)
<Eiam> ahh, :scope + unique_index
<Eiam> thanks will give it a shot
<namelessjon_> Eiam: That's doing two things: (1) creating a validation which will be run by DM and (2) creating an index on the database, so it will throw an error if the validation fails
<Eiam> right
<Eiam> in my particular case the attributes span two different models , so going to try and set the validation against the belongs_to and has n
<namelessjon_> Eiam: Two different models? Perhaps I'm mis-understanding... Can you put together a small example which shows what you want to do (perhaps as Cat/Owner)?
<Eiam> namelessjon_: hmm sure
<Cinchy> [gist] gist:d2de3ee2586fe7a697c9 (at gist.github.com, on 2013-08-23 18:17)
<Eiam> all Topic and TopicEdits are created off instances of the TopicReview via first_or_create
<namelessjon_> Okay
brianpWins has quit [Quit: brianpWins]
brianpWins has joined #datamapper
<namelessjon_> Yeah, I can't see why/how that could lead to dupes, except for a race condition, so I would go for the validation approach
kurko_ has joined #datamapper
knowtheory has quit [Ping timeout: 245 seconds]
<Eiam> right, so a validation across models however
<Eiam> doesn't seem to be working
<Eiam> because it doesn't know the :ob outside of that class
kurko_ has quit [Ping timeout: 245 seconds]
postmodern has joined #datamapper
kurko_ has joined #datamapper
kurko_ has quit [Ping timeout: 256 seconds]
mbj has quit [Ping timeout: 276 seconds]
kurko_ has joined #datamapper
kurko_ has quit [Ping timeout: 240 seconds]
kurko_ has joined #datamapper
kurko_ has quit [Ping timeout: 260 seconds]
kurko_ has joined #datamapper
abuiles has joined #datamapper
kurko_ has quit [Ping timeout: 264 seconds]
<namelessjon_> I thought the problem was multiple topics for the same review, where (ob,topic_id) should be unique
<Eiam> yes, correct it should be unique
<Eiam> but Topic doesn't have a property for its belongs_to :topic_review
<Eiam> and TopicReview doesn't have a property for its has n :topics ob value
<Eiam> so how could either model set a validator to check those attributes when neither model knows the others value?
<namelessjon_> Try validates_uniqueness_of :ob, :scope => :topic
<namelessjon_> err, :topic_review
<namelessjon_> Or :topic_review_id
kurko_ has joined #datamapper
kurko_ has quit [Client Quit]
v0n has quit [Ping timeout: 245 seconds]
brianpWins has quit [Quit: brianpWins]
knowtheory has joined #datamapper
brianpWins has joined #datamapper
zombor has quit [Remote host closed the connection]
slainer6_ has joined #datamapper
slainer6_ has quit [Remote host closed the connection]
<postmodern> does anyone have experience with dm-yaml-adapter?
<postmodern> thinking of using it as a cache for metadata
<postmodern> but wondering if queries still work with it?
<postmodern> or does it load the data into memory, and do the query there?
mbj has joined #datamapper
<namelessjon_> postmodern: I think it does that, yeah
<namelessjon_> Unfortunately, it doesn't use pstore/yaml either.
<postmodern> good point
<postmodern> also doesn't appear to use YAML's streaming API