03:12
<helllen>
how do I create a empty DataMapper::Collection
04:07
<kalleth>
helllen: i dunno, why would you even want to? DataMapper::Collection.new? Object.all(:id => null) ?
04:08
<helllen>
I have used
04:09
<helllen>
Model.all(:id=>0)
04:10
<kalleth>
ok, take it back a bit
04:10
<kalleth>
_why_ do you want an empty collection?
04:10
<kalleth>
what possible reason could you have for wanting one?
04:11
<kalleth>
unless testing, i guess
04:12
<helllen>
I need it because if the data is not valid I don't want to ask database
04:13
<kalleth>
you'll need to expand a bit.. what data, and how could it be invalid without checking the database to see if its invalid?
04:14
<kalleth>
is it for testing purposes? are you doing a search and want to determine if there are any search results? what's the use case
04:51
<jwkoelewijn>
hi all
04:52
<jwkoelewijn>
someone here who's working on the new dm-validations?
04:52
<jwkoelewijn>
and with some knowledge of solnic's dm-validations-ext?
04:53
<jwkoelewijn>
i was under the impression that the new dm-validations with incorporate some dm-validations-ext stuff, like for instance filling the errors object with all errors on a failed save
04:53
<jwkoelewijn>
but it seems this is not in there...
04:54
<jwkoelewijn>
will it come in, or should i find work-arounds for it?
06:06
antinitro___ joined
07:02
<helllen>
I would like to search all obs from one table with something in a field
07:02
<helllen>
for example
07:02
<helllen>
@rules.all(:msg.like => "%VLC%")
07:03
<helllen>
being @rules a DataMapper::Collection
07:03
<helllen>
I would like no case sensitive
07:03
<helllen>
@rules.all(:msg.like => "%vlc%") return different result
07:03
<helllen>
how could I do this?
07:08
<helllen>
does it wotk :msg.like ? in datamapper ?
12:29
<blargh>
hi all. is there a reason why my join tables could be being ignored? i specify that a user has n projects via permissions and vice versa, but it still looks for the projectuser table, which does not exist.
12:30
<blargh>
this is in datamapper 1.0.2
13:05
<hadronzoo>
blargh: I think you want :through instead of :via
13:08
<blargh>
hadronzoo: sorry yeah, i use through
16:20
<devmod>
Hello, is there something wrong with Model.count with conditions? wht's the proper way of doing it?
16:22
<devmod>
tried Model.count(:key => 'VALUE') but that doenst seem to work
16:23
<diago>
Friend.count(:conditions => [ 'gender = ?', 'female' ])
16:23
<diago>
that's from the docs but I believe you can do Friend.all( :foo => 'bar' ).count
16:24
<devmod>
yeah saw that on the doc but no go either
16:24
<devmod>
right, that would work
16:25
<devmod>
i just thought .count would be more efficient- but it doesnt work for me
16:28
<namelessjon>
devmod: The perf different really should be negliable (if there's any). Friend.all(:foo => 'bar') just creates a query object + collection, doesn't fire a query
16:29
<devmod>
But if the count used count(*) on the query itself the return would just be a number as opposed to a collection right?
16:30
<namelessjon>
devmod: Yeah. It functions just like Model.count(:key => 'VALUE') would.
16:30
<devmod>
namelessjon: right, so it's Model.count broken? bc it doesnt work at all for me
16:31
<devmod>
same conditions work for a Model.all but not for Model.count
16:32
<diago>
what do you mean doesn't work? We use it in our app
16:32
<diago>
I just checked every way and it works
16:32
<diago>
Foo.count :key => 'foo'
16:33
<diago>
well, it has to work for pagination
19:46
<hadronzoo>
devmod: did you require 'dm-aggregates' ?