00:21
zombor has quit [Remote host closed the connection]
00:30
kurko_ has quit [Ping timeout: 264 seconds]
00:31
kurko_ has joined #datamapper
01:13
Sylvain1 has quit [Ping timeout: 246 seconds]
01:21
kurko_ has quit [Ping timeout: 240 seconds]
01:21
v0n has joined #datamapper
01:22
kurko_ has joined #datamapper
01:36
elskwid has quit [Ping timeout: 260 seconds]
01:36
elskwid has joined #datamapper
01:41
xargoon has quit [Ping timeout: 260 seconds]
01:43
Eiam has quit [Ping timeout: 260 seconds]
01:43
onewheelskyward has quit [Ping timeout: 260 seconds]
01:43
xargoon has joined #datamapper
01:48
onewheelskyward has joined #datamapper
01:58
MarcWeber has quit [Ping timeout: 260 seconds]
01:58
mralk3 has quit [Ping timeout: 260 seconds]
01:58
mralk3 has joined #datamapper
01:58
MarcWeber has joined #datamapper
02:26
zombor has joined #datamapper
02:26
zombor has joined #datamapper
02:50
snusnu has quit [Quit: Leaving.]
02:52
kurko_ has quit [Ping timeout: 245 seconds]
02:53
kurko_ has joined #datamapper
03:37
zombor has quit [Remote host closed the connection]
03:56
rsim has joined #datamapper
04:00
rsim has quit [Ping timeout: 240 seconds]
04:20
Sylvain1 has joined #datamapper
04:32
Sylvain1 has quit [Quit: Leaving.]
04:33
Sylvain1 has joined #datamapper
05:10
Eiam has joined #datamapper
05:10
<
Eiam >
well thats odd
05:10
<
Eiam >
my .save started failing..
05:10
v0n has quit [Ping timeout: 245 seconds]
05:10
<
Eiam >
any useful way to find out
*why* its failing?
05:10
<
Eiam >
SaveFailureError: #save returned false
05:10
<
Eiam >
great.. why? =)
05:15
kurko_ has quit [Ping timeout: 245 seconds]
05:16
kurko_ has joined #datamapper
05:21
kurko_ has quit [Ping timeout: 246 seconds]
05:23
kurko_ has joined #datamapper
05:24
milesforrest|afk is now known as milesforrest
05:24
milesforrest has left #datamapper [#datamapper]
06:05
Sylvain1 has quit [Quit: Leaving.]
06:06
<
onewheelskyward >
Yep.
06:06
<
onewheelskyward >
model.valid? and model.errors
06:06
<
onewheelskyward >
model.errors.inspect will give you the why you're looking for.
06:06
<
onewheelskyward >
Eiam
06:07
Sylvain1 has joined #datamapper
06:08
Sylvain1 has quit [Client Quit]
06:55
rsim has joined #datamapper
07:59
kurko_ has quit [Ping timeout: 264 seconds]
08:00
kurko_ has joined #datamapper
08:26
mikecmpbll has joined #datamapper
08:37
snusnu has joined #datamapper
09:00
snusnu has quit [Quit: Leaving.]
09:09
snusnu has joined #datamapper
09:10
kurko_ has quit [Ping timeout: 276 seconds]
09:12
kurko_ has joined #datamapper
09:51
kurko_ has quit [Quit: Computer has gone to sleep.]
10:03
postmodern has quit [Quit: Leaving]
11:01
mikecmpbll has joined #datamapper
12:46
zombor has joined #datamapper
12:46
zombor has joined #datamapper
12:55
jeremyevans has quit [Ping timeout: 264 seconds]
13:00
jeremyevans has joined #datamapper
13:28
mikecmpbll has joined #datamapper
13:52
kurko_ has joined #datamapper
14:06
cobbr2 has joined #datamapper
14:39
bobocopy has joined #datamapper
14:48
cobbr2 has quit [Quit: Leaving.]
15:11
cobbr2 has joined #datamapper
15:22
dkubb has joined #datamapper
15:35
mikecmpbll has joined #datamapper
15:37
v0n has joined #datamapper
15:38
bobocopy has quit [Quit: Leaving.]
15:38
bobocopy has joined #datamapper
16:21
v0n has quit [Quit: WeeChat 0.4.2-dev]
16:21
v0n has joined #datamapper
16:58
Sylvain1 has joined #datamapper
17:05
mbj has joined #datamapper
17:23
mbj has quit [Read error: Connection reset by peer]
17:32
snusnu has quit [Quit: Leaving.]
17:44
snusnu has joined #datamapper
17:45
mbj has joined #datamapper
18:14
<
Eiam >
why the hell didn't it tell me that
18:15
<
Eiam >
must be at most 50 characters
18:17
<
dkubb >
it's all over the docs
18:18
<
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
18:19
<
Eiam >
I meant more about the throw on save failure
18:19
<
Eiam >
I'm still trying to get it to by default tell me whats up
18:19
<
Eiam >
I brought in dm-noisy-failures
18:19
<
Eiam >
but its not helping
18:19
<
Eiam >
i ended up just binding.pry and calling .error to find out wtf was up
18:21
<
Eiam >
raise_on_save_failure isn't helpful cause then I've gotta go rescue and find out whats going on
18:21
<
onewheelskyward >
Well, yeah, that's kind of the point. :)
18:21
<
dkubb >
the exception you rescue has a #resource attribute. so you can do: exception.resource.errors
18:24
<
Eiam >
onewheelskyward: right, except I don't want to begin rescue end every time I interact with the model
18:24
<
Eiam >
basically, same issue
18:27
<
Eiam >
woo there we go got it working
18:28
<
dkubb >
I'd accept a patch to dm-validations that makes the DataMapper::SaveFailureError message include the errors like this
18:30
<
Eiam >
oh, good to know. ok
18:33
<
Eiam >
will work on it then =)
18:35
<
Eiam >
so to change from a property :blah, String to property :blah, Text
18:35
<
Eiam >
I need a migration?
18:56
<
Eiam >
hmm went with this
18:57
<
Cinchy >
[gist] gist:eaa80ae70181130e4f5d (at gist.github.com, on 2013-08-07 18:56)
18:57
<
Eiam >
undefined method 'modify_table' for main:object
18:59
<
onewheelskyward >
alter table?
19:16
mbj has quit [Ping timeout: 264 seconds]
19:22
mbj has joined #datamapper
19:48
<
Eiam >
still undefined..
19:50
rsim has quit [Quit: Leaving.]
20:03
bobocopy has quit [Quit: Leaving.]
20:03
bobocopy has joined #datamapper
20:12
cobbr2 has quit [Quit: Leaving.]
20:33
<
onewheelskyward >
hmm.
20:40
<
Eiam >
poking in padrino
20:40
<
Eiam >
maybe thats the issue
20:44
<
namelessjon >
Eiam: wrong format
20:44
<
Eiam >
namelessjon: okay.. whats it supposed to be?
20:46
<
namelessjon >
see comment on gist
20:47
<
namelessjon >
Eiam: you were wrapping it task, not migration
20:47
mbj_ has joined #datamapper
20:47
<
Eiam >
namelessjon: okay, well I moved it to a db/migrate/001_modify_message_column_type
20:47
<
Eiam >
migration 1, :modify_message_column_type do
20:48
<
namelessjon >
working now?
20:48
<
Eiam >
no =( rake dm:migrate "Don't know how to build task "dm:migrate"
20:48
<
namelessjon >
Eiam: Well, you need some kind of migrate task
20:49
<
Eiam >
rake dm:migrate # Migrates the database to the latest version
20:49
mbj has quit [Ping timeout: 240 seconds]
20:49
<
Eiam >
so I think I'm over in padrino land now and i guess its out of y'alls hair =)
20:50
<
namelessjon >
That's padrino :) Though, there is a sample Rakefile in the dm-migrations/examples directory
20:57
dkubb has joined #datamapper
21:10
rsim has joined #datamapper
21:31
v0n has quit [Ping timeout: 276 seconds]
21:36
postmodern has joined #datamapper
21:44
<
Eiam >
okay, dario set me straight
21:44
<
Eiam >
so now it runs
21:45
<
Eiam >
query: ALTER TABLE "f_edit" ALTER COLUMN "message" text, uri: my db
21:45
<
Eiam >
syntax error
21:46
v0n has joined #datamapper
21:47
mbj has joined #datamapper
21:49
mbj_ has quit [Ping timeout: 246 seconds]
21:58
<
namelessjon >
Hmmm, if you just copy/paste that query into the DB, what does it say
22:08
v0n has quit [Quit: WeeChat 0.4.2-dev]
22:08
v0n has joined #datamapper
22:19
mbj_ has joined #datamapper
22:22
mbj has quit [Ping timeout: 264 seconds]
22:22
rsim has quit [Quit: Leaving.]
22:31
mbj has joined #datamapper
22:34
mbj_ has quit [Ping timeout: 264 seconds]
22:35
<
Eiam >
syntax error at or near "text"
22:38
<
Eiam >
i don't think thats valid sql
22:38
<
Eiam >
shouldn't it be ALTER TABLE "my_table" ALTER COLUMN "my_column" TYPE text ?
22:41
<
Eiam >
it doesn't seem to be constructing the correct query
23:02
myobie has joined #datamapper
23:08
<
Eiam >
indeed, thats not the right query that its trying
23:11
<
Eiam >
so in postgres.rb in dm-migrations
23:11
<
Eiam >
I see def change_column_type_statement
23:12
<
Eiam >
"ALTER TABLE #{name} ALTER COLUMN #{column}"
23:17
v0n has quit [Ping timeout: 276 seconds]
23:18
<
Eiam >
and indeed, stepping through in Pry I see... execute(sql).. sql = "ALTER TABLE "\my_table"\ ALTER COLUMN \"my column\" text"
23:20
<
Eiam >
in pry i manually changed to string to include TYPE text
23:20
<
Eiam >
and let it continue and the migrate ran successfully
23:20
<
Eiam >
bug in dm-migrate I guess
23:21
<
Eiam >
and there it is
23:22
<
Eiam >
Seems to me that the SQL being ran is:
23:22
<
Eiam >
when it needs to be
23:22
<
Eiam >
ALTER TABLE "hotels" ALTER COLUMN "url" VARCHAR(1 AND 255)
23:22
<
Eiam >
ALTER TABLE "hotels" ALTER COLUMN "url" TYPE VARCHAR(1 AND 255)
23:28
v0n has joined #datamapper
23:34
<
Eiam >
okay so I need to write some raw SQL in my migration for now
23:35
<
Eiam >
since I cannot figure out how the fuck that bad sql is being generated based on the code
23:37
v0n has quit [Ping timeout: 248 seconds]
23:40
mbj_ has joined #datamapper
23:42
mbj has quit [Ping timeout: 248 seconds]
23:44
zombor has quit [Remote host closed the connection]
23:45
<
Eiam >
okay so @type is wrong
23:45
<
Eiam >
its set to "my_column text"
23:46
zombor has joined #datamapper
23:46
zombor has joined #datamapper
23:46
zombor has quit [Changing host]
23:51
<
Eiam >
instead of "text"
23:52
<
Eiam >
so the bug is somewhere in build_type? it doesn't look like it ever returns anything so I'm confused now
23:52
v0n has joined #datamapper
23:52
zombor has quit [Remote host closed the connection]