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
snusnu has joined #datamapper
ckrailo has joined #datamapper
snusnu has quit [Quit: Leaving.]
v0n has joined #datamapper
jeremyevans has quit [Ping timeout: 252 seconds]
zombor has quit [Remote host closed the connection]
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
zombor has joined #datamapper
zombor has quit [Changing host]
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
stepheneb has joined #datamapper
stepheneb has quit [Changing host]
stepheneb has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
zombor has joined #datamapper
zombor has quit [Remote host closed the connection]
jeremyevans has joined #datamapper
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Changing host]
zombor has quit [Remote host closed the connection]
v0n has quit [Read error: Connection reset by peer]
zombor has joined #datamapper
zombor has joined #datamapper
zombor has quit [Ping timeout: 260 seconds]
rsim has joined #datamapper
v0n has joined #datamapper
rsim has quit [Ping timeout: 240 seconds]
mtrisoline has joined #datamapper
_pol has joined #datamapper
yeban has joined #datamapper
v0n has quit [Ping timeout: 246 seconds]
ckrailo has quit [Quit: Computer has gone to sleep.]
carlad has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
brianpWins has joined #datamapper
mtrisoline has quit [Quit: mtrisoline]
brianpWins has quit [Quit: brianpWins]
brianpWins has joined #datamapper
luke__ has joined #datamapper
gix has quit [Ping timeout: 264 seconds]
_pol has joined #datamapper
<luke__>
I'm just getting started with datamapper, and am connecting my rack app to my postgres database on heroku. If I do Model.create(:foo => "bar"), then a new record is created in my database, but none of the fields save. If I call .saved? it returns true, but nothing I do ever changes the database, with the exception of calling .create creating a new blank record
<luke__>
Does this sound like a common problem - something obvious I could be missing?
gix has joined #datamapper
<onewheelskyward>
luke__ Try calling .valid and then looking for model.errors.
<onewheelskyward>
sorry, .valid?
<luke__>
u.valid? also returns true
<onewheelskyward>
That's odd.
<onewheelskyward>
Are you sure you're connected to the database you think you're connected to?
<onewheelskyward>
Oh, Heroku.
<luke__>
Yeah
<luke__>
So it creates a blank record
<luke__>
and returns the id correctly
<luke__>
but just nothing else saves
<luke__>
It's my first time using datamapper and heroku, so I could definitely be missing something obvious
bhaak has quit [Read error: Operation timed out]
<onewheelskyward>
oh
<onewheelskyward>
check your types.
<onewheelskyward>
I've had to .to_i and .to_s a bunch of times to get things to save.
<onewheelskyward>
For instance, saving an integer from the parameters list won't work without an integer conversion.
<luke__>
Hmm, that doesn't seem to make a difference unfortunately
<luke__>
I'm making all the calls through racksh, so maybe there's a problem with that
rsim has joined #datamapper
bhaak has joined #datamapper
<luke__>
nope, that's not the issue
rsim has quit [Ping timeout: 241 seconds]
<luke__>
OK, so I turned logging on, and I see this
<luke__>
>> User.create(:email => "foo@bar.com")
<luke__>
~ (0.119341) INSERT INTO "users" DEFAULT VALUES RETURNING "id"
<luke__>
So it seems that datamapper isn't telling the database to do anything, except create a record with blank values. The question is - why? :)
<onewheelskyward>
If you output a u.inspect before the save, does it show your values?
brianpWins has quit [Quit: brianpWins]
dkubb has joined #datamapper
<luke__>
yes
<luke__>
Ruby knows the values, they're just not being saved
<onewheelskyward>
It sounds like they're getting parsed out.
<onewheelskyward>
Is there an accompanying update statement in the logs?
<luke__>
nope
<luke__>
Gimme a sec - I'll do a pastebin
<onewheelskyward>
Does the returned object in that User.create line have the email?
<onewheelskyward>
Does it work locally, before heroku deployment?
brianpWins has joined #datamapper
<luke__>
The app is running locally, it's just connecting to a heroku database
<onewheelskyward>
What happens if you connect to a local database?
<luke__>
I haven't tried! Let me see...
<luke__>
same problem
<luke__>
I'm using Ruby 2.0 - I'm gonna switch to 1.9.3 and see if that makes a differnce
dward has joined #datamapper
<dward>
I'm getting inconsistent data reads using datamapper with the postgres driver.
<dward>
A select will return a query object but every row in the row array will be the same.
<dward>
Using the logger and running the exact query in postgres returns the correct results.
<dward>
The first row in the query seems to be the repeated result in the datamapper response
<dward>
I'm pretty sure this is a bug so i'll write up and submit a bug report when in the next couple of days if nobody has any extra input. postgres version 9.1.
<luke__>
onewheelskyward: Same thing with 1.9.3. Really weird. I'll play a round a bit more I guess and see if I can find out what's going on