<    March 2010    >
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
00:16 jnicklas joined
00:19 benburkert joined
00:25 path[l] joined
00:37 RichGuk joined
00:41 flexd joined
00:45 pietia joined
00:50 dkubb joined
01:04 <knowtheory> hmm, Zamous was having fail
01:04 <knowtheory> and blamed dm :(
01:05 pietia joined
01:09 <dkubb> yeah, that's too bad
01:10 <dkubb> I would've helped him if he didn't split
01:10 <knowtheory> hey dkubb
01:10 <knowtheory> yeah
01:10 <dkubb> knowtheory: hey
01:16 <dkubb> I'm not entirely sure what his problem was, but I would've said that uniqueness has nothing to do with the intermediaries, but rather the target objects
01:16 <dkubb> the result of most collection operations are a unique set of resources
01:17 <dkubb> by default anyway, or it should be
01:17 <knowtheory> i'm guessing it had to do w/ chaining stuff probably
01:17 <knowtheory> instead of doing User.all.map{|u|u.items}
01:18 <knowtheory> he was doing users = User.all; users.items
01:18 <knowtheory> or something
01:18 <dkubb> User.all.items works fine
01:18 <dkubb> it would return a unique list of Item resources associated with at least one User
01:19 <knowtheory> right
01:19 <knowtheory> he was unhappy about having a uniqed list
01:19 <dkubb> possibly
01:19 <knowtheory> yeah :)
01:19 <dkubb> User.all.items(:unique => false)
01:19 flexd joined
01:19 <knowtheory> hard to say w/o more feedback
01:19 <dkubb> ya
01:22 <knowtheory> yay my nexus one has shipped
01:30 splattael joined
01:34 <dkubb> knowtheory: you thinking of doing dev for it?
01:35 <knowtheory> thought about it, not seriously though. i need to get into more java dev in general i guess
01:35 <knowtheory> or maybe using V8 to do JS dev for it
01:37 <knowtheory> i'm joining the smartphone age :P
01:37 <knowtheory> i haven't had one up to now
01:38 <knowtheory> and wanted to get an unlocked phone
01:38 <dkubb> I have been cell-phone free for a long time
01:38 <knowtheory> otherwise i probably would have gotten an iphone
01:38 <knowtheory> oh yeah? :)
01:38 <knowtheory> i wanted a mobile computing devices that wasn't my laptop
01:38 <dkubb> I'm plugged in all day long, when I am away from the computer I don't want to be plugged in then
01:38 <knowtheory> because as much as i love my MBP hauling it out all the time isn't exactly the height of convenience, nor does it have mobile connectivity
01:38 <knowtheory> yeah, i know how that feels
01:55 botanicus joined
02:04 RichGuk joined
02:36 pdelgallego joined
02:39 dkubb joined
02:50 solnic joined
02:54 jeremyevans joined
03:10 jeremyevans joined
03:18 myabc joined
03:26 <myabc> Anyone using Rails 3 + DM + multiple repositories?
03:49 giom joined
03:52 hipe joined
04:08 snusnu joined
04:31 krisso joined
04:55 ashley_moran joined
04:56 giom joined
04:59 hipe joined
05:05 balint joined
05:15 hipe joined
05:23 mtkd joined
05:40 g0blin joined
05:42 g0blin joined
05:48 g0bl1n joined
05:58 giom joined
06:00 snusnu joined
06:11 robgleeson joined
06:17 Booster joined
06:21 greeneggandham joined
06:25 greeneggandham joined
06:32 pietia_ joined
06:39 kriso joined
06:51 pietia joined
07:11 adri_ joined
07:14 adri_ left
07:34 dfd joined
07:44 mtkd joined
07:45 avdi joined
07:51 <knowtheory> myabc: nope, Merb + DM + multirepo here
07:54 <myabc> knowtheory: hey, how's it going?
07:54 <myabc> knowtheory: do you have Merb::Plugins.config[:merb_datamapper][:use_repository_block] set to true?
07:54 <knowtheory> hey hey
07:54 <myabc> knowtheory: (default is true, AFAIK)
07:55 <knowtheory> yeah, for merb i think the default is true, i'm just verifying to be sure
07:55 <knowtheory> we do use multiple repository blocks. we've actually got it wrapped up in an object for convenience
07:55 <knowtheory> yes, it's set to true
07:55 <knowtheory> why out of curiosity?
07:59 <myabc> knowtheory: well I partly resolved - or at least understand my problem now.. I was wondering why Model#default_repository_name was being observed in console, but not in controllers.
07:59 <myabc> knowtheory: (this is the first time I've used this feature outside of a small Sinatra /CLI apps)
07:59 <knowtheory> interesting
07:59 <myabc> knowtheory: But I had missed the fact that Rails 3 (as Merb), Controller actions are wrapped in a repository block by default.
08:00 <knowtheory> ah yeah.
08:00 <knowtheory> the model we decided upon
08:00 <knowtheory> was to always make the block one is operating in explicit
08:01 isheridan joined
08:01 <knowtheory> so our Application class requires knowing which repository to use, or it'll throw an exception
08:02 <myabc> knowtheory: Oh, interesting.. that would make sense.
08:02 <isheridan> Is anyone on that is familiar with over-riding accessors in a model class?
08:02 <knowtheory> isheridan: like... overriding properties?
08:02 <isheridan> yes
08:02 <knowtheory> myabc: yeah we have a default repository just to make sure the app boots up, but otherwise, we don't use it.
08:02 <knowtheory> isheridan: what are you overriding properties for?
08:03 <knowtheory> my first question would be, should you rename your property, and create a method/accessor to point to the actual property you want to store stuff in?
08:03 <isheridan> I have two properties that are Strings but I need have the output of the property transformed to an Array.
08:03 <knowtheory> and my second question is, are you just trying to add behavior that could be accomplished using a before, or after block?
08:03 <knowtheory> ah
08:04 <knowtheory> yeh in the event that i've had to do that i tend to have gone for the first option there
08:04 <isheridan> knowtheory: no I am defining methods... here is a gist ... https://gist.github.com/0b74bcceedbb7ce47bec
08:06 giom joined
08:07 <isheridan> knowtheory: When I initiate an object and populate it... all seems good. but when I try to save the new record "nothing" the save returns false but I can soo not error messages or anything that would enlighten me as to what I am doing wrong.
08:08 <isheridan> knowtheory: see no errors that is
08:08 <knowtheory> calling errors on the object doesn't return anything?
08:08 <knowtheory> you can check the attributes hash
08:08 <isheridan> one sec
08:08 <knowtheory> and the dirty_attributes hash to see whether DM is aware that you've changed things
08:09 <namelessjon> attribute_set takes care of dirtyness.
08:09 <knowtheory> mmhmm
08:09 altrux joined
08:10 <isheridan> hrmmm this is the error that I get ... :statuses=>["Statuses must be of type String"], :categories=>["Categories must be of type String"]
08:10 <isheridan> yet
08:11 <isheridan> when I look at the object I see this ... #<Filter @id=nil @name="Newly Imported" @statuses="1" @categories="" @start_date=nil @end_date=nil @is_default=true @is_temp=false @created_at=nil @updated_at=nil @user_id=1>
08:11 <knowtheory> what happens when you call the "cateogries" method on the object?
08:12 <knowtheory> it returns [""]?
08:12 <knowtheory> I don't know enough about DM's save chain
08:12 <knowtheory> do you namelessjon?
08:12 <isheridan> yes but that is what I want
08:12 <knowtheory> actually... call "attributes" on the filter
08:12 <knowtheory> if you could
08:12 <isheridan> well it returns []
08:12 <knowtheory> and paste what the hash looks like
08:13 <isheridan> {:categories=>[], :statuses=>["1"], :start_date=>nil, :user_id=>1, :created_at=>nil, :end_date=>nil, :is_default=>true, :is_temp=>false, :name=>"Newly Imported", :updated_at=>nil}
08:13 <isheridan> ugh
08:13 <knowtheory> hehe :) interesting
08:14 <namelessjon> Hmmm. the assignments should definitely be set when the method is called, not (i.e. before save even becomes involved)
08:14 <isheridan> this is why I made sure to use "attribute_set"
08:16 <* namelessjon> nods.
08:17 hipe joined
08:18 <isheridan> While it is not the big a deal to work around this... I do not think that this was the intended behavior of "attribute_set" or the over-ride feature.
08:22 <namelessjon> isheridan: It's definitely being called (the method)
08:24 <isheridan> namelessjon: ah you tested it? yeah I thought so too.
08:26 <isheridan> namelessjon: maybe the returned value should be the resulting string ... but what would "attribute_set" usefulness be? handling the dirty stuff?
08:26 <namelessjon> Oh. Of course.
08:26 <isheridan> ?
08:26 <namelessjon> I figured it out, I think.
08:27 <namelessjon> The validator calls your reader method.
08:27 <isheridan> <sigh>
08:27 <namelessjon> When its checking its a string.
08:29 <isheridan> namelessjon: so this means over-riding is useless for me and I should do the data transformation outside of the model object. hrmmm
08:31 <namelessjon> isheridan: You can turn off auto_validation for that field.
08:31 <isheridan> duh /smack
08:31 <namelessjon> isheridan: That removes the primitive validator, and dm handles the saving as a string properly
08:35 <isheridan> so basically in this circumstance one should set ":auto_validation => false" and make sure that you do your own validation in the over-riding method.
08:36 <knowtheory> you can also add your on validator
08:36 <knowtheory> which does what you want it to do
08:36 <knowtheory> rather than what it thinks is the right thing to do of course
08:36 <isheridan> yes of course
08:36 <isheridan> good point
08:37 benburkert joined
08:37 <isheridan> Thank you both for your help
08:38 <isheridan> I was taring my hair out trying to figure this out.
08:42 irjudson joined
08:43 _pol joined
08:46 andreich joined
08:47 <andreich> hello, please could someone point me to :dependent => :destroy in associations? I've searched the documentation but I haven't found where is this mentioned. The ticket on this is marked as resolved
08:48 <andreich> I tried also with dm-constraints, but I get "condition :dependent does not map to a property or relationship" no matter what I include
08:49 <knowtheory> sorry i do not know :(
08:52 <namelessjon> andreich: :constraint => :destroy
08:52 <andreich> just found it
08:52 <andreich> thank you
08:59 snusnu joined
09:01 _pol joined
09:02 jdomg joined
09:33 jstad joined
10:06 _pol joined
10:16 pdelgallego joined
10:44 benburkert joined
10:57 em-dash joined
10:59 botanicus joined
11:10 RichGuk joined
11:29 zodiak joined
11:30 adamaig joined
11:31 hipe joined
11:34 github joined
11:34 <github> datamapper.github.com: master Alex Coles * da9b532 (1 files in 1 dirs): Work-around a Maruku Markdown-parsing warning ... - http://bit.ly/bK259z
11:34 github left
11:37 github joined
11:37 <github> datamapper.github.com: master Alex Coles * b3b55fb (1 files in 1 dirs): Fix typo in Properties documentation ... - http://bit.ly/9e3qsi
11:37 github left
11:45 RichGuk joined
11:59 kstephens joined
12:36 _pol joined
12:38 fpauser2 joined
12:41 sickill joined
12:48 RichGuk joined
13:27 jbrennan joined
13:42 jstad joined
13:46 zodiak joined
13:52 mayo joined
13:57 stepheneb joined
13:58 xshay joined
13:59 <xshay> hey I'm trying to get a complex aggregate function through DM
13:59 <xshay> SELECT SUM(LEAST(20, value * 0.2)) FROM X WHERE Y
13:59 <xshay> It doesn't seem this is possible?
14:19 pjwal joined
14:20 botanicus joined
14:22 rsim joined
14:24 altrux joined
14:24 <pjwal> Is it possible to create a many to many relationship with a composite key for the many to many table?
14:30 qhoxie joined
14:47 kriso joined
15:03 robgleeson joined
15:14 path[l] joined
15:16 rsim joined
15:34 <Tass`> xshay, :value.least => 100 # probably
16:02 adamaig_ joined
16:10 robgleeson joined
16:12 postmodern joined
16:13 g0bl1n joined
16:13 <g0bl1n> hi, in OSX (Snow Leopard) I installed PostgreSQL EnterpiseDB package then: gem install do_postgres
16:14 <g0bl1n> It installs fine
16:14 <g0bl1n> but
16:14 <g0bl1n> when trying to connect to a local or remote Postgres server, I get:
16:14 <g0bl1n> dyld: lazy symbol binding failed: Symbol not found: _PQsetdbLogin
16:15 <g0bl1n> Referenced from: /Library/Ruby/Gems/1.8/gems/do_postgres-0.10.1/lib/do_postgres/do_postgres.bundle
16:15 <g0bl1n> Expected in: flat namespace
16:15 <g0bl1n> dyld: Symbol not found: _PQsetdbLogin
16:15 <g0bl1n> any idea ?
16:16 mnoble joined
16:36 kenphused joined
17:08 adamaig joined
17:18 snusnu joined
17:18 snusnu joined
17:43 <xshay> Tass`: LEAST isn't an aggregation function, but my point was more "I have this random SQL function and want to push it through DM"
17:43 <xshay> Tass`: would be nice to get all the query building and conditions and scope and stuff, and only drop down to raw SQL for the function
17:47 stepheneb joined
18:13 irjudson joined
18:19 _pol joined
18:27 Booster joined
18:27 stepheneb joined
18:42 irjudson1 joined
18:51 snusnu1 joined
18:52 kenphused joined
19:09 irjudson joined
19:14 mayo_ joined
19:15 irjudson1 joined
19:26 irjudson joined
19:30 irjudson1 joined
19:33 irjudson joined
19:37 qhoxie joined
19:38 Booster_ joined
19:41 irjudson1 joined
19:49 irjudson joined
20:07 em-dash joined
20:21 chuck joined
20:21 hobbsc_ joined
20:21 hobbsc_ joined
20:21 notheory joined
20:21 <chuck> I can never get DataMapper.setup and DataMapper.auto_migrate! to work :(
20:21 <chuck> DataMapper.setup(:default, "sqlite3://#{File.join(File.dirname(__FILE__), 'talker.db')}")
20:21 <chuck> that's my setup line
20:22 <chuck> and I'm calling DataMapper.auto_migrate! after I require my model files, but talker.db is not created
20:22 <chuck> oh.. it's being created at / for some reason... hmm
20:23 benburkert joined
20:26 postmodern joined
20:27 beawesomeinstead joined
20:27 <namelessjon> chuck: You probably want an File.expand_path in there.
20:28 kstephens joined
20:28 knowtheory joined
20:28 Tass` joined
20:28 <namelessjon> chuck: or alternatively: "sqlite3:#{File.join(File.dirname(__FILE__), 'talker.db')}"
20:31 fpauser joined
20:40 irjudson1 joined
20:45 <chuck> namelessjon, I threw expand_path in there, and it works, thanks!
21:07 hipe_ joined
21:17 benburkert joined
21:39 jbrennan joined
21:40 irjudson joined
21:53 path[l] joined
22:37 zodiak joined
23:08 kstephens joined
23:29 flexd joined
23:53 benburkert joined