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
zombor has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 264 seconds]
kurko_ has joined #datamapper
Sylvain1 has quit [Ping timeout: 246 seconds]
kurko_ has quit [Ping timeout: 240 seconds]
v0n has joined #datamapper
kurko_ has joined #datamapper
elskwid has quit [Ping timeout: 260 seconds]
elskwid has joined #datamapper
xargoon has quit [Ping timeout: 260 seconds]
Eiam has quit [Ping timeout: 260 seconds]
onewheelskyward has quit [Ping timeout: 260 seconds]
xargoon has joined #datamapper
onewheelskyward has joined #datamapper
MarcWeber has quit [Ping timeout: 260 seconds]
mralk3 has quit [Ping timeout: 260 seconds]
mralk3 has joined #datamapper
MarcWeber has joined #datamapper
knowtheory has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
zombor has joined #datamapper
zombor has joined #datamapper
snusnu has quit [Quit: Leaving.]
kurko_ has quit [Ping timeout: 245 seconds]
kurko_ has joined #datamapper
zombor has quit [Remote host closed the connection]
rsim has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
Sylvain1 has joined #datamapper
Sylvain1 has quit [Quit: Leaving.]
Sylvain1 has joined #datamapper
Eiam has joined #datamapper
<Eiam> well thats odd
<Eiam> my .save started failing..
v0n has quit [Ping timeout: 245 seconds]
<Eiam> any useful way to find out *why* its failing?
<Eiam> SaveFailureError: #save returned false
<Eiam> great.. why? =)
kurko_ has quit [Ping timeout: 245 seconds]
kurko_ has joined #datamapper
kurko_ has quit [Ping timeout: 246 seconds]
kurko_ has joined #datamapper
milesforrest|afk is now known as milesforrest
milesforrest has left #datamapper [#datamapper]
Sylvain1 has quit [Quit: Leaving.]
<onewheelskyward> Yep.
<onewheelskyward> model.valid? and model.errors
<onewheelskyward> model.errors.inspect will give you the why you're looking for.
<onewheelskyward> Eiam
Sylvain1 has joined #datamapper
Sylvain1 has quit [Client Quit]
rsim has joined #datamapper
kurko_ has quit [Ping timeout: 264 seconds]
kurko_ has joined #datamapper
mikecmpbll has joined #datamapper
snusnu has joined #datamapper
snusnu has quit [Quit: Leaving.]
snusnu has joined #datamapper
kurko_ has quit [Ping timeout: 276 seconds]
kurko_ has joined #datamapper
kurko_ has quit [Quit: Computer has gone to sleep.]
postmodern has quit [Quit: Leaving]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
zombor has joined #datamapper
zombor has joined #datamapper
jeremyevans has quit [Ping timeout: 264 seconds]
jeremyevans has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<kalleth> https://github.com/initforthe/forum2discourse - built w/ datamapper :)
mikecmpbll has joined #datamapper
kurko_ has joined #datamapper
cobbr2 has joined #datamapper
bobocopy has joined #datamapper
cobbr2 has quit [Quit: Leaving.]
cobbr2 has joined #datamapper
dkubb has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
v0n has joined #datamapper
bobocopy has quit [Quit: Leaving.]
bobocopy has joined #datamapper
v0n has quit [Quit: WeeChat 0.4.2-dev]
v0n has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Sylvain1 has joined #datamapper
mbj has joined #datamapper
mbj has quit [Read error: Connection reset by peer]
snusnu has quit [Quit: Leaving.]
snusnu has joined #datamapper
mbj has joined #datamapper
<Eiam> oh, nice
<Eiam> why the hell didn't it tell me that
<Eiam> must be at most 50 characters
<dkubb> it's all over the docs
<dkubb> of course I realize no one (including myself) reads all the docs. we put it in a few places just in case. we could warn about it, but then people who wanted to use the implicit length would be annoyed. tbh, I kind of wish we threw an exception when :length is not specified
<Eiam> I meant more about the throw on save failure
<Eiam> I'm still trying to get it to by default tell me whats up
<Eiam> I brought in dm-noisy-failures
<Eiam> but its not helping
<Eiam> i ended up just binding.pry and calling .error to find out wtf was up
<Eiam> raise_on_save_failure isn't helpful cause then I've gotta go rescue and find out whats going on
<onewheelskyward> Well, yeah, that's kind of the point. :)
<dkubb> the exception you rescue has a #resource attribute. so you can do: exception.resource.errors
<Eiam> onewheelskyward: right, except I don't want to begin rescue end every time I interact with the model
<Eiam> basically, same issue
<Eiam> woo there we go got it working
<dkubb> I'd accept a patch to dm-validations that makes the DataMapper::SaveFailureError message include the errors like this
<Eiam> oh, good to know. ok
<Eiam> will work on it then =)
<Eiam> so to change from a property :blah, String to property :blah, Text
<Eiam> I need a migration?
dkubb has quit [Quit: Linkinus - http://linkinus.com]
<Eiam> hmm went with this
<Cinchy> [gist] gist:eaa80ae70181130e4f5d (at gist.github.com, on 2013-08-07 18:56)
<Eiam> undefined method 'modify_table' for main:object
<onewheelskyward> alter table?
mbj has quit [Ping timeout: 264 seconds]
mbj has joined #datamapper
<Eiam> still undefined..
rsim has quit [Quit: Leaving.]
bobocopy has quit [Quit: Leaving.]
bobocopy has joined #datamapper
cobbr2 has quit [Quit: Leaving.]
<onewheelskyward> hmm.
<Eiam> poking in padrino
<Eiam> maybe thats the issue
<namelessjon> Eiam: wrong format
<Eiam> namelessjon: okay.. whats it supposed to be?
<namelessjon> see comment on gist
<Eiam> namelessjon: seems in line with https://github.com/datamapper/dm-migrations ?
<namelessjon> Eiam: you were wrapping it task, not migration
mbj_ has joined #datamapper
<Eiam> namelessjon: okay, well I moved it to a db/migrate/001_modify_message_column_type
<Eiam> migration 1, :modify_message_column_type do
<Eiam> up do
<Eiam> and so on..
<namelessjon> working now?
<Eiam> no =( rake dm:migrate "Don't know how to build task "dm:migrate"
<namelessjon> Eiam: Well, you need some kind of migrate task
<Eiam> rake dm:migrate # Migrates the database to the latest version
mbj has quit [Ping timeout: 240 seconds]
<Eiam> so I think I'm over in padrino land now and i guess its out of y'alls hair =)
<namelessjon> That's padrino :) Though, there is a sample Rakefile in the dm-migrations/examples directory
dkubb has joined #datamapper
rsim has joined #datamapper
v0n has quit [Ping timeout: 276 seconds]
postmodern has joined #datamapper
<Eiam> okay, dario set me straight
<Eiam> was padrino
<Eiam> so now it runs
<Eiam> query: ALTER TABLE "f_edit" ALTER COLUMN "message" text, uri: my db
<Eiam> syntax error
<Eiam> =(
<Eiam> its a copy paste of https://github.com/datamapper/dm-migrations !
v0n has joined #datamapper
mbj has joined #datamapper
mbj_ has quit [Ping timeout: 246 seconds]
<namelessjon> Hmmm, if you just copy/paste that query into the DB, what does it say
v0n has quit [Quit: WeeChat 0.4.2-dev]
v0n has joined #datamapper
mbj_ has joined #datamapper
mbj has quit [Ping timeout: 264 seconds]
rsim has quit [Quit: Leaving.]
mbj has joined #datamapper
mbj_ has quit [Ping timeout: 264 seconds]
<Eiam> syntax error at or near "text"
<Eiam> i don't think thats valid sql
<Eiam> shouldn't it be ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE text ?
<Eiam> it doesn't seem to be constructing the correct query
dkubb has left #datamapper ["Linkinus - http://linkinus.com"]
myobie has joined #datamapper
<Eiam> indeed, thats not the right query that its trying
<Eiam> so in postgres.rb in dm-migrations
<Eiam> I see def change_column_type_statement
<Eiam> "ALTER TABLE #{name} ALTER COLUMN #{column}"
<Eiam> no type...
v0n has quit [Ping timeout: 276 seconds]
<Eiam> and indeed, stepping through in Pry I see... execute(sql).. sql = "ALTER TABLE "\my_table"\ ALTER COLUMN \"my column\" text"
<Eiam> in pry i manually changed to string to include TYPE text
<Eiam> and let it continue and the migrate ran successfully
<Eiam> so..
<Eiam> bug in dm-migrate I guess
<Eiam> and there it is
<Eiam> Seems to me that the SQL being ran is:
<Eiam> when it needs to be
<Eiam> ALTER TABLE "hotels" ALTER COLUMN "url" VARCHAR(1 AND 255)
<Eiam> ALTER TABLE "hotels" ALTER COLUMN "url" TYPE VARCHAR(1 AND 255)
v0n has joined #datamapper
<Eiam> okay so I need to write some raw SQL in my migration for now
<Eiam> since I cannot figure out how the fuck that bad sql is being generated based on the code
v0n has quit [Ping timeout: 248 seconds]
mbj_ has joined #datamapper
mbj has quit [Ping timeout: 248 seconds]
zombor has quit [Remote host closed the connection]
<Eiam> hmm
<Eiam> okay so @type is wrong
<Eiam> its set to "my_column text"
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
<Eiam> instead of "text"
<Eiam> so the bug is somewhere in build_type? it doesn't look like it ever returns anything so I'm confused now
v0n has joined #datamapper
zombor has quit [Remote host closed the connection]