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
Ortuna has quit [Quit: IRC Leave]
kurko_ has quit [Quit: Computer has gone to sleep.]
aschepis has joined #datamapper
<aschepis> hey all.. how can i tell why a record is getting loaded as immutable.. doing a really simple find by id and its throwing an immutable error when i try to update any field.
<aschepis> loc = Location.first(id: params["location_id"])
aschepis has quit [Quit: aschepis]
rsim has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
snusnu has quit [Quit: Leaving.]
zombor has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 240 seconds]
dkubb has joined #datamapper
<dkubb> memos
<Cinchy> dkubb: [21h 0m 9s ago] <solnic> fair enough :) I just don't consider this a big issue given early stage of ROM's code. As I said, this will become more important when we reach a higher version number (at least IMHO).
<dkubb> solnic: actually, I think disabling yardstick altogether when stuff is pre-alpha is fine. I suggested it a few days ago actually. what I'm more concerned about is if yardstick is giving you incorrect results, or if there are bugs that are making you less effective at writing YARD docs when you actually set out to document something
<dkubb> solnic: one simple change I was going to make is to report the documentation that is not currently covered along with the percentage coverage, the same way rubocop reports stuff
campezzi has joined #datamapper
<campezzi> hey folks. trying to use a ParanoidDateTime property on a model here... how would I go about setting FactoryGirl to understand that? setting it to a regular DateTime object doesn't seem to pass validation
<campezzi> ie. my factory has this (which doesn't work): deleted_at Chronic.parse("yesterday")
<campezzi> if I make the column a simple DateTime, it does work as intended but that leaves me to implement paranoia :P
mkf has quit [Ping timeout: 240 seconds]
mkf has joined #datamapper
lnormous has joined #datamapper
rsim has joined #datamapper
dkubb has quit [Quit: Linkinus - http://linkinus.com]
DireFog has quit [Remote host closed the connection]
campezzi has quit [Quit: campezzi]
lnormous has quit [Ping timeout: 260 seconds]
mbj has joined #datamapper
DireFog has joined #datamapper
irclogger_com has quit [Ping timeout: 264 seconds]
irclogger_com has joined #datamapper
irclogger_com has quit [Excess Flood]
irclogger_com has joined #datamapper
irclogger_com has quit [Excess Flood]
mikecmpbll has joined #datamapper
irclogger_com has joined #datamapper
bobocopy has joined #datamapper
mbj has quit [Quit: leaving]
postmodern has quit [Quit: Leaving]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mkf has quit [Disconnected by services]
mkf has joined #datamapper
bobocopy has quit [Quit: Leaving.]
snusnu has joined #datamapper
<solnic> !memo dkubb the biggest bug in yardstick is that its configuration isn’t really working :) if I could, let’s say, turn off checks for private methods it could save a lot of my time. I also think having @example’s w/o any kind of verification if they are valid is pretty much useless (as snusnu already described in the commit comment). Maybe we could put
<solnic> examples in actual executable specs and embed them later with some yard extension. We could also just use relishapp but I don’t really like its output to be honest.
<Cinchy> solnic: Memo recorded for dkubb.
snusnu has quit [Quit: Leaving.]
zombor has joined #datamapper
_whitelogger has joined #datamapper
DireFog_ is now known as DireFog
kurko_ has joined #datamapper
v0n has joined #datamapper
knowtheory has joined #datamapper
snusnu has joined #datamapper
bobocopy has joined #datamapper
bobocopy has quit [Client Quit]
bobocopy has joined #datamapper
bobocopy has quit [Read error: Connection reset by peer]
bobocopy has joined #datamapper
bobocopy has quit [Quit: Leaving.]
bobocopy has joined #datamapper
mbj has joined #datamapper
knowtheory has quit [Quit: Computer has gone to sleep]
dkubb has joined #datamapper
<dkubb> memos
<Cinchy> dkubb: [3h 47m 35s ago] <solnic> the biggest bug in yardstick is that its configuration isn’t really working :) if I could, let’s say, turn off checks for private methods it could save a lot of my time. I also think having @example’s w/o any kind of verification if they are valid is pretty much useless (as snusnu already described in the commit comment). Maybe we could put
g0bl1n has joined #datamapper
Sylvain1 has joined #datamapper
careo has joined #datamapper
lnormous has joined #datamapper
mbj has quit [Quit: leaving]
myobie has joined #datamapper
kyle_l5l has quit [Remote host closed the connection]
milesforrest is now known as milesforrest|afk
_whitelogger_ has joined #datamapper
mouse-_ has joined #datamapper
theCrab has joined #datamapper
<theCrab> evening yall
postmodern has joined #datamapper
mbj has joined #datamapper
g0bl1n has quit [Ping timeout: 245 seconds]
snusnu has quit [Quit: Leaving.]
snusnu has joined #datamapper
<theCrab> hi dkubb
<theCrab> hey snusnu
<dkubb> theCrab: hello
<theCrab> I have a dm question. I am trying to do a better job at extracting a gem. https://gist.github.com/theCrab/a5602852bc2e6a70ae4d
<Cinchy> [gist] How would I build a better relationship? Whenever I create a license for a person, I have to pass in a vehicle relation too. (at gist.github.com, theCrab on 2013-08-05 20:18)
<theCrab> dkubb: ^^ any wise words?
<dkubb> theCrab: OT, but can you not have a drivers relationship?
<theCrab> dkubb: if I do belongs_to :vehicle, required: false. There's no effect and I think it would
<theCrab> dkubb: I did have a Drivers relation, But then it meant I had to have a Passenger, Owners, Employees etc. All are Person.
<theCrab> dkubb: Maybe I should do it that way. But all those are Roles no?
<theCrab> snusnu: Any awesomeness sir?
<dkubb> it's interesting a license belongs to a vehicle
<dkubb> it's not that way in Canada or the US afaik
<dkubb> we have separate insurance registration for the vehicles. it's decoupled from our license
<theCrab> dkubb: In the UK a vehicle has to have at least 2 certificates/licenses. MOT and ROAD TAX, the driver is always insured on a named vehicle.
<theCrab> dkubb: i just called all of them licenses, since they all behave like one.
<dkubb> theCrab: btw, you could use dm-timestamps's "timestamp :at" line in the model
<dkubb> theCrab: sometimes what I do is create a base resource that I mix into my models
<theCrab> dkubb: timestamps :created_at, :updated_at??
<dkubb> theCrab: see: http://pastie.org/8209256
<Cinchy> [pastie] #8209256 - Pastie (at pastie.org, on 2013-08-06 00:33)
<theCrab> dkubb: so how would I use this in my case for example?
rsim has quit [Quit: Leaving.]
<dkubb> theCrab: oh, it could just be used to remove those id keys and the created_at stuff
<dkubb> theCrab: it doesn't solve your problem, I was just sharing. usually before fixing a problem I look at ways to reduce complexity first
<theCrab> dkubb: I am now including it :)
<dkubb> theCrab: also, you don't need self. in most of those method calls
<theCrab> dkubb: does self cost a lot?
<theCrab> never checked it
<theCrab> meant never measured it
myobie has quit [Quit: myobie]
<dkubb> the only cost is extra parsing time in our heads ;)
<dkubb> maybe some people like it, but I just see it as extra noise
<theCrab> dkubb: haha! cool. I'll remove it
<theCrab> dkubb: now am going to sound like a noob proper. I need to extend Memoist?
<theCrab> dkubb: BTW am on DataMapper not DM2/ROM
<dkubb> oh heh, Memoist is a normal ruby gem
<dkubb> I use it in my DM models to memoize methods that are idempotent
<kalleth> ok
<kalleth> valid? returns true
<kalleth> save returns false
<kalleth> sec, gisting
<theCrab> obj.errors
<theCrab> kelleth: what does obj.error return?
<theCrab> kalleth: ^^
<theCrab> kalleth: obj.errors can't even type
<kalleth> errors is nil
<kalleth> checked that already
<Cinchy> [gist] DataMapper 1.4 wtf (at gist.github.com, kalleth on 2013-08-05 20:56)
<kalleth> i *think* it's a datatype issue
<kalleth> 1.4?!
<kalleth> 1.2
<theCrab> dkubb: the module extension is not working
<theCrab> the timestamp fields are not created
<kalleth> pretty sure it doesn't like BigDecimal
<kalleth> hmm, no, that's not it
<dkubb> kalleth: I would start with one property and start adding properties until you can repro it
<kalleth> meh, so i have to remove properties from my db using autoupgrade etc?
<kalleth> this has worked previously, haven't touched this model
<kalleth> wonder what's wrong
<theCrab> dkubb: kalleth I looked through the dm-types and can't see Decimal as a type? Any special reason?
<theCrab> kalleth: I'd do the same
<kalleth> theCrab: far as i know it's a core type
<kalleth> i'll remove the decimal fields and attempt to resave
<theCrab> kalleth: Ah! cool
mbj has quit [Quit: leaving]
<kalleth> *reboots app server after commenting out the decimal properties*
<theCrab> aaaaaaaand (o)
<kalleth> oh, fuck
<kalleth> its not the decimal types
<kalleth> i wonder if...
<kalleth> i wonder if it's the enforcing of the foreign key
<theCrab> kalleth: Whats the best way to design Organization has n, :teams; Tean has n, :people
<kalleth> like that?
<theCrab> kalleth: are you doing Booking.new?
<kalleth> theCrab: yeah, but its nested attributes, so it saves the parent and then updates the child with the parents id
<theCrab> kalleth: hahaha
<kalleth> parent saves fine, child validates file
<kalleth> *fine
<theCrab> try Booking.create
<kalleth> i don't want to create it in the same step as creating the object
<kalleth> i have some setup work to do first
<theCrab> hmm
<kalleth> *thinks*
<theCrab> yup
<theCrab> ka;;
myobie has joined #datamapper
<kalleth> i think it could possibly be failing on the insert because of Postgres vs MySQL (i swithed databases a while back)
<kalleth> but i'd see an SQL error if that was the case
<theCrab> kalleth: so booking.payment_information.create is not working?
<kalleth> accepts_nested_attributes_for
<kalleth> booking.new(params[:booking]) passes inparams[:booking][:payment_information] which intrnally creates the payment ino
<theCrab> kalleth: why is property :commission a decimal?
<kalleth> afaik
<kalleth> theCrab: i've commented out both of those and it still fails to save. Pretty sure it's not those and that was a blind alley.
<kalleth> I'm going to see if i can get some datamapper debug infos
v0n has quit [Ping timeout: 245 seconds]
<dkubb> kalleth: if you change the property to Object does it still save?
<theCrab> kalleth: dkubb advised me to put this somewhere DataMapper::Model.raise_on_save_failure = true
<kalleth> dkubb: which property?
<kalleth> theCrab: yeah, did that, check the gist
<theCrab> i put it in my spec helpers and its saving me the digging
<kalleth> oh, it's not in the gist
<kalleth> it just raises 'save returned false'
<kalleth> dkubb: I assume you mean the decimal properties. Sec
<theCrab> property :paid is a Bool without a default? but it should not affect it
mbj has joined #datamapper
<kalleth> theCrab: hmm, shouldn't be an issue
<kalleth> mbj: help :P
<kalleth> goddamn
* kalleth bypasses methods again
<dkubb> I've noticed cases where this was more constrained than validations, causing save to fail without any validation errors
<dkubb> one simple test of this would be to monkey patch this method to do nothing and then see if the problem persists
<kalleth> dkubb: if you have a sec, i can easily tmate you a shell with pry open?
<dkubb> tmate?
<theCrab> tmate???? wtf
<kalleth> PM
<mbj> kalleth: hola
<kalleth> tmix terminal sharing
<kalleth> *tmux
<theCrab> ah
<theCrab> i nearly pooooood myself
<dkubb> oh that's neat
<dkubb> I was going to say "nah, I don't use textmate anymore"
<theCrab> dkubb: check this
<theCrab> one min
<kalleth> dkubb: you can dive ow
<kalleth> *drive
<kalleth> :)
<kalleth> just dont go scping up .ssh/id_rsa
<kalleth> ;)
<dkubb> hehe
<kalleth> dkubb: remember the booking is fine, but the booking.payment_information is what won't sae
<kalleth> *save
<kalleth> that's the ID attribute
<kalleth> from the relationship
<kalleth> dkubb: @booking.payment_infoirmation
<dkubb> hehe
mbj has quit [Quit: leaving]
<kalleth> theCrab: tmate.io
<kalleth> really cool pairing tool imo
<dkubb> kalleth: it's weird that it is failing
<theCrab> i have been trying many out
<theCrab> i'll check it out
<kalleth> dkubb: i've done autoupgrade a few times, could it be that it's got some indexes left behind that aren't valid anymore?
<dkubb> kalleth: you could try using #save! which will bypass most of DM's validation stuff
<kalleth> encoding?
<kalleth> looks like
<kalleth> perhaps my postgres is wrong
<theCrab> kalleth: always use utf-8 on unicode
<kalleth> yeah, its possibly that
<kalleth> i guarantee this is me doing something dumb fs
<kalleth> like my PG isn't set up right
<kalleth> could be my precision/scale things
<kalleth> haha
<kalleth> hmm, frustrating
* kalleth has a think about what to try next
<kalleth> dkubb: pretty sure i owe you a pint now, btw :)
<kalleth> no worries if you have to head off, you've been more helpful than i expected already
<dkubb> haha
<dkubb> I always get messed up by precion/scale
<kalleth> well, I *am* using it for what it's probably not intended for, so..
<kalleth> (money)
<kalleth> pretty sure there's blog articles saying DON'T DO THAT
* kalleth debates replacing htem with integers and just /100'ing everything when displayed
<kalleth> or dm-money
<kalleth> though i'm not *entirely* convinced this isn't a blind alley
<kalleth> hmm, let's try this another way
<dkubb> kalleth: does that payments_info stuff have any associations that could be invalid?
<kalleth> one, to its parent (@booking), nothing more
viranch has joined #datamapper
<dkubb> fwiw I wish DM reported association errors by default
<kalleth> dkubb: i'm going to try modifying the controller to extract the [:payment_information] params and pass them directly in
<kalleth> to a PaymentInformation.new(booking: booking)
<kalleth> or whatever
viranch_ has quit [Ping timeout: 264 seconds]
<dkubb> I would accept a patch to add that to the errors, provided it didn't break rails error helpers
<dkubb> kalleth: kk, do you need me in the shell anymore?
<kalleth> nope, you've been way helpful :)
<dkubb> feel free to send me another invite if you get stuck
<kalleth> <3 tmate
rsim has joined #datamapper
<dkubb> I need to get into tmux more
<kalleth> not sure wtf is different between using accepts_nested_attributes_for in Booking and creating it manually
<kalleth> i don't actually use tmux, tbh
<kalleth> i just use tmate which boots a tmux session when i use tmate :)
<kalleth> goddamnit i wanted to bill tonight for this :p
<kalleth> fuck it
* kalleth adds @booking.payment_information.save! and wraps it in validation
rsim has quit [Ping timeout: 240 seconds]
<kalleth> dkubb: i made ther elationship optional, then checked valid? and called save! if it's valid
<kalleth> s'how i got around it. though it's a kludge
<kalleth> my gut says the problem lies in building it with association_name.build/.create through accepts_nested_attributes_for
<kalleth> but attributes reports the same for that and one created outside of it, so...
<kalleth> for the laterbase, methinks
* kalleth adds to asana to investigate that one
<theCrab> kalleth: you there?
<theCrab> dkubb: you there?
<theCrab> oh! you've left
<kalleth> i'm here
<kalleth> perhaps i can help
* theCrab wanted to try something with sharing
<kalleth> sure
<theCrab> hey
<theCrab> try that
zombor has quit [Remote host closed the connection]
<kalleth> got a loading screen then redirected back :)
<kalleth> hmm, interesting
<theCrab> hmm
<theCrab> holdon
<kalleth> so with tmate for terminal sharing and localtunnel for the web application itself you can totally remote code
* kalleth makes a note
<theCrab> kalleth: try again
<kalleth> auth failed :)
<kalleth> ('can't let you do that dave')
<kalleth> i'd guess its some kind ofk ey
<kalleth> right, i have to deploy this fix, brb
<theCrab> kalleth: I think its my firewall or Router refusing to do it
<kalleth> i'd imagine so :) that's what's awesome about tmate
<kalleth> it runs through a third party ssh middleman
<theCrab> Portforwarding on a cheap router isn't cool
<kalleth> so both people are just sshing out, no firewall issues
<kalleth> indeed, i have a draytek
<kalleth> (expensive SOHO)
<theCrab> I have a Huawei from TalkTalk
<theCrab> pretty cheap after i screwed up with Virgin while on Holiday
<theCrab> Ah! We'll leave it for now
<kalleth> :)
<kalleth> deployed
<kalleth> awesome.
bobocopy has quit [Quit: Leaving.]
bobocopy has joined #datamapper
bobocopy has quit [Client Quit]
theCrab has quit [Quit: theCrab]
campezzi has joined #datamapper
banditron has quit [Remote host closed the connection]
g0bl1n has joined #datamapper