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
chevtchenko has joined #datamapper
chevtchenko has quit [Remote host closed the connection]
skade has quit [Quit: Computer has gone to sleep.]
zombor has quit [Remote host closed the connection]
zombor has joined #datamapper
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
lfox has joined #datamapper
zombor has quit [Remote host closed the connection]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
lfox has quit [Quit: ZZZzzz…]
rsim has joined #datamapper
rsim has quit [Ping timeout: 245 seconds]
rsim has joined #datamapper
solars has joined #datamapper
dkubb has joined #datamapper
skade has joined #datamapper
skade has quit [Quit: Computer has gone to sleep.]
rsim has quit [Quit: Leaving.]
dkubb has quit [Quit: Linkinus - http://linkinus.com]
skade has joined #datamapper
mbj has joined #datamapper
mikecmpbll has joined #datamapper
rsim has joined #datamapper
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
skade has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mikecmpbll has joined #datamapper
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 joined #datamapper
zombor has quit [Ping timeout: 252 seconds]
lfox has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
zombor_ has quit [Remote host closed the connection]
viranch_ has joined #datamapper
skade_ has joined #datamapper
lfox has quit [*.net *.split]
skade has quit [*.net *.split]
mbj has quit [*.net *.split]
viranch has quit [*.net *.split]
irclogger_com has quit [*.net *.split]
irclogger_com has joined #datamapper
skade_ has quit [Ping timeout: 245 seconds]
mbj has joined #datamapper
skade has joined #datamapper
zombor has joined #datamapper
mikecmpbll has joined #datamapper
g0bl1n has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Client Quit]
skade has joined #datamapper
skade has quit [Client Quit]
skade has joined #datamapper
akasper has joined #datamapper
alessand1o has joined #datamapper
_br_- has joined #datamapper
noca has joined #datamapper
_br_ has quit [Ping timeout: 248 seconds]
Spockz has quit [Ping timeout: 248 seconds]
jpr5 has quit [Ping timeout: 248 seconds]
stormwind has joined #datamapper
_br_- has quit [*.net *.split]
stormwin1 has quit [*.net *.split]
indrek has quit [*.net *.split]
alessand1o has quit [*.net *.split]
akasper has quit [*.net *.split]
g0bl1n has quit [*.net *.split]
zombor has quit [*.net *.split]
mouse-_ has quit [*.net *.split]
shingara has quit [*.net *.split]
skade has quit [Quit: Computer has gone to sleep.]
shingara has joined #datamapper
zombor has joined #datamapper
mouse-_ has joined #datamapper
alessand1o has joined #datamapper
akasper has joined #datamapper
indrek has joined #datamapper
_br_ has joined #datamapper
_br_ has quit [Max SendQ exceeded]
_br_ has joined #datamapper
_br_ has quit [Ping timeout: 240 seconds]
_br_ has joined #datamapper
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
skade has joined #datamapper
mikecmpbll has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
belyaev has joined #datamapper
skade has quit [Read error: Connection reset by peer]
belyaev has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
skade has joined #datamapper
mbj has quit [Ping timeout: 252 seconds]
dkubb has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
mbj has joined #datamapper
rrules has joined #datamapper
rrules has quit [Remote host closed the connection]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
sunsin has joined #datamapper
skade has joined #datamapper
sunsin has quit [Remote host closed the connection]
rsim has quit [Quit: Leaving.]
g0bl1n has joined #datamapper
g0bl1n has quit [Max SendQ exceeded]
mkf has quit [Ping timeout: 272 seconds]
g0bl1n has joined #datamapper
mkf has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
rsim has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
skade has joined #datamapper
skade has quit [Read error: Connection reset by peer]
g0bl1n has quit [Ping timeout: 248 seconds]
mbj has quit [Read error: Connection reset by peer]
mbj has joined #datamapper
postmodern has joined #datamapper
skade has joined #datamapper
lfox has joined #datamapper
lgierth has joined #datamapper
skade has quit [Quit: Computer has gone to sleep.]
g0bl1n has joined #datamapper
g0bl1n has quit [Ping timeout: 246 seconds]
skade has joined #datamapper
skade has quit [Client Quit]
g0bl1n has joined #datamapper
g0bl1n has joined #datamapper
dankieless has joined #datamapper
<dankieless> hello
<dankieless> anyone on?
<lgierth> dankieless: how can i help?
<dankieless> hey!
<dankieless> so I'm having a little bit of an issue. Postewd on stack to no prevail
<dankieless> as to the errors I'm getting:
<dankieless> just as a note i'm using sqllite not mysql
<lgierth> there's a NOT NULL constraint on friendships.user_id right?
<lgierth> in sql i mean
<dankieless> oh wow... do you think it's validates_presence_of :user
<lgierth> is the issue that you don't want that constraint, or that there should be no condition in datamapper where that columns is NULL?
<dankieless> i'm using that to ensure the user that is being called actually exists
<dankieless> Nope. deleting that line did not work. Sorry, a bit new to this. How could I check if there is a restraint?
<lgierth> dankieless: regarding validates_presence_of, it only validates that the resource has this property set, it doesn't neccessarily mean that the references record also exists in the database
<lgierth> s/references/referenced/
<lgierth> mh let me see
<dankieless> thank you for the help, much appreciated
<lgierth> ok i think i understand your code. what columns do the sqlite tables have?
<lgierth> only those referenced in your code, or more?
<lgierth> asking because friendships.user_id is not references in the code
<lgierth> so might only need to remove it from the table
<lgierth> maybe that's why the one answer on stackoverflow says it's working for them
<dankieless> Sorry, extremely new to databasing. When you refer to a column, are you referring to an attribute of a model? Like a column of user is :id?
<lgierth> now, those are attributes/properties
<lgierth> datamapper connects to a database, or in the case of sqlite, opens a db file
<lgierth> and the structure of that file isn't automatically equal to the attributes you define in your code using datamapper
rsim has quit [Quit: Leaving.]
<lgierth> are you using rails or something like that?
<dankieless> interesting. Well, maybe this is where I screwed up. Initially i did have a :user_id row. However, i deleted it and replaced it with :source and :target id's
<dankieless> no, sinatra
<dankieless> everything in the friendship/user model is in the stack code
<lgierth> ok then the user_id column is probably still in the db file, if you only removed the datamapper code for it
<dankieless> how do I access the db?
<dankieless> I have a development.db file that when I click on is gibberish. just delete it?
<lgierth> yep
<lgierth> but how did you create the table and column structure in it? dm-migrations?
<lgierth> ah the tutorial
<dankieless> hey!
<dankieless> it worked!
<dankieless> I just deleted the old db and its runinng. thanks a lot!
<dankieless> yep, dm-migrations
<lgierth> so what do you do next time you remove a datamapper attribute from your code? :)
<dankieless> delete the db :)
<dankieless> thanks bud, i appreciate it.
<dankieless> learning one step at a time haha
<lgierth> no! :)
<dankieless> what do I do?
<lgierth> i guess you probably removed it from your Friendship model, and the from the migration, right?
<dankieless> Well I understand what I did wrong. When I initially built it, i used :user_id. Created that column. Fixed up my code, removed :user_id from the model, but I was naive enough to think that it would handle taking the column out on its own
<dankieless> ruby has spoiled me too much
<lgierth> ah ok
<lgierth> what i meant is that, at some point deleting the db won't be an otpion
<lgierth> and what you can do then is writing a migration that removes the column
<lgierth> think of it this way: migrations are like deploys, but for your data
<dankieless> I think i remember this from when I was screwing around with RoR
<lgierth> yes rails' migrations are similar
<lgierth> same concept
<dankieless> yeah ok I just looked it up. I definitely do.
<dankieless> If I remember correctly, the rails project came with a migration file
<dankieless> not the case with sinatra
<lgierth> that's because sinatra doesn't come with a database layer
<lgierth> you integrate datamapper on your own
<dankieless> what's a layer
<lgierth> routes, dispatch, and controller are sinatra
<lgierth> model is datamapper
<lgierth> and view is also sinatra (the .to_json calls)
<lgierth> or rather, the .to_json calls are the view
<lgierth> frails on the other hand covers all of these layers
<lgierth> rails that is
<dankieless> are you a datamapper dev?
<dankieless> excuse me, do you contribute to the development of datamapper*
<lgierth> no just an experienced user
<dankieless> what do you do if you dont mind my asking
<lgierth> and the datamapper developers have move on to developing rom-rb
<lgierth> with datamapper? at the moment not that much, but for 1.5 years i developed a couple of applications using it at soundcloud
<dankieless> I meant as a profession, so I'm guessing a programmer
<lgierth> hehe yes programmer :)
<onewheelskyward> Is soundcloud sinatra?
<lgierth> rails, but the rails app got way too big, and we started to split non-core functionality out into background services and sites
<onewheelskyward> Nice.
<lgierth> and some of the use datamapper
<dankieless> One last question... How could I append two database queries? I've just realized that if i was to call user.friendships, it would only return the friendships of the user who is :source_id, not :target_id
akasper has quit [Quit: Leaving.]
<dankieless> or I could fix this by making a second friendship with the source_id and the target_id reversed, right?
<lgierth> dankieless: yeah the terminology is a bit mixed up. friendships are usually mutual, while here they're directed from user 1 to user 2
<lgierth> so it should be called followings actually, and have user.followers and user.followings
<lgierth> or something like that
solars has quit [Ping timeout: 251 seconds]
mbj has quit [Quit: leaving]
lgierth has quit [Ping timeout: 245 seconds]
zombor has quit [Remote host closed the connection]
lgierth has joined #datamapper
dankieless has quit [Ping timeout: 272 seconds]
g0bl1n has quit [Ping timeout: 245 seconds]