<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper">
    <title>gmane.comp.lang.ruby.datamapper</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3515"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3514"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3513"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3512"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3511"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3510"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3509"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3508"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3507"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3506"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3505"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3504"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3503"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3502"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3501"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3500"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3499"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3498"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3497"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3496"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3515">
    <title>Re: valid? raises error:  wrong number of arguments (1 for 0)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3515</link>
    <description>&lt;pre&gt;

… having a property named valid creates some getter and setters. Which in 
turn stab dm-validation’s valid. :-(

I rename my property. :-)

&lt;/pre&gt;</description>
    <dc:creator>Johannes Held</dc:creator>
    <dc:date>2012-05-16T14:19:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3514">
    <title>Re: valid? raises error:  wrong number of arguments (1 for 0)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3514</link>
    <description>&lt;pre&gt;If I remove dm-validations it works like a charm. Bug?

require "dm-core"
require "dm-validations"
require "dm-migrations"


class C
  include DataMapper::Resource

  property :id, Serial
  property :name, String, :required =&amp;gt; true
  validates_uniqueness_of :name
  property :valid, Integer, :default =&amp;gt; true
end


def setup
  DataMapper::Logger.new($stdout, :debug)
  DataMapper.setup(:default, 'sqlite::memory:')
  DataMapper.finalize
  DataMapper.auto_migrate!

  C.first_or_create(:name =&amp;gt; "test", :valid =&amp;gt; true)
end

if __FILE__ == $0
  setup
  puts C.all.map(&amp;amp;:name)
end

&lt;/pre&gt;</description>
    <dc:creator>Johannes Held</dc:creator>
    <dc:date>2012-05-15T16:39:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3513">
    <title>Re: valid? raises error:  wrong number of arguments (1 for 0)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3513</link>
    <description>&lt;pre&gt;I can save the fact if I remove all other properties. Removing soley the 
:required or :default won’t help.
But that‘s no real solution …

class Fact
  include DataMapper::Resource

  belongs_to :patientposition, :key =&amp;gt; true
  belongs_to :controlpointcount, :key =&amp;gt; true
  belongs_to :radiationtype, :key =&amp;gt; true
  belongs_to :collimatormovement, :key =&amp;gt; true
  belongs_to :beamcount, :key =&amp;gt; true
  belongs_to :marctype, :key =&amp;gt; true

  timestamps :at
end

&lt;/pre&gt;</description>
    <dc:creator>Johannes Held</dc:creator>
    <dc:date>2012-05-15T15:55:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3512">
    <title>valid? raises error:  wrong number of arguments (1 for 0)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3512</link>
    <description>&lt;pre&gt;I have a model named Fact. A fact belongs to many other models and holds 
some attributes. Think of it as a data-warehouse fact table.

class Fact
  include DataMapper::Resource

  belongs_to :patientposition, :key =&amp;gt; true
  belongs_to :controlpointcount, :key =&amp;gt; true
  belongs_to :radiationtype, :key =&amp;gt; true
  belongs_to :collimatormovement, :key =&amp;gt; true
  belongs_to :beamcount, :key =&amp;gt; true
  belongs_to :marctype, :key =&amp;gt; true

  property :valid, Boolean, :required =&amp;gt; true, :default =&amp;gt; true
  property :marctestdate_count, Integer, :required =&amp;gt; true, :default =&amp;gt; 0
  property :realvortest1_count, Integer, :required =&amp;gt; true, :default =&amp;gt; 0

  timestamps :at
end

All of the other models are described in the same way:
class *Name*
  include DataMapper::Resource
  property :id,  Serial
  property :value, String, :required =&amp;gt; true
  validates_uniqueness_of :value
end

If I want to first_or_create a fact issuing e.g.
Fact.first_or_create("patientposition_id"=&amp;gt;2, "controlpointcount_id"=&amp;gt;3, 
"radiationtype_id"=&amp;gt;1, "c&lt;/pre&gt;</description>
    <dc:creator>Johannes Held</dc:creator>
    <dc:date>2012-05-15T12:19:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3511">
    <title>Re: dynamic tables</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3511</link>
    <description>&lt;pre&gt;Hi

I would like to find a means of ORM that would allow me to declare a 


You could look at using dm-reflection to get a list of models based on the 
current structure of your database. You could mix in a single module into 
each model if you wanted to share some common behaviour between them. It 
should be possible to handle this completely dynamically without hard 
coding any model names or table/column names into the system anywhere.

&lt;/pre&gt;</description>
    <dc:creator>Dan Kubb (dkubb</dc:creator>
    <dc:date>2012-05-11T04:02:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3510">
    <title>dynamic tables</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3510</link>
    <description>&lt;pre&gt;Hello all,

I've dabbled in datamapper in the past, but don't have much experience
in it.  I'm trying to evaluate its usefulness for solving a problem I
have.

I have a number of tables (probably ~50) that I need to get data
from.  Each table has 5 columns in common.  Beyond those 5 columns
each table has various numbers of various other columns; none of them
in common with other tables.

I would like to find a means of ORM that would allow me to declare a
single model that could handle the basic 5 pieces of common data, but
then also access the extra columns dynamically depending on what table
was specified.  I would really prefer NOT to have to write 50 or so
models (especially since this number is being added to and subtracted
from in an ongoing fashion).  I was wondering if perhaps Datamapper
might be able to solve this in a clean dynamic way.

Thoughts anyone?

Thanks,
Snowdall

&lt;/pre&gt;</description>
    <dc:creator>Clark Snowdall</dc:creator>
    <dc:date>2012-05-11T00:59:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3509">
    <title>What is the proper way to execute a SQL statement via DataMapper?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3509</link>
    <description>&lt;pre&gt;Hello list,

I’m wondering what's the proper way to execute a SQL statement via 
DataMapper.

Assume I these models are created at runtime:

class Bar
  include DataMapper::Resource
  property :id, :Serial
end

class Foo
  include DataMapper::Resource
  property :a, :Serial
  property :b, :Serial
  belongs_to Bar, :key =&amp;gt; true
end

Now I want to create a view (and a model to mirror that view):
create view foo_count as 
select a, b, count(bar) as count 
from foo 
group by a, b

How can I use DataMapper to execute this statement?
Is there a way to use the name system of DataMapper?

--
Cheers, Johannes

&lt;/pre&gt;</description>
    <dc:creator>Johannes Held</dc:creator>
    <dc:date>2012-05-03T06:19:43</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3508">
    <title>Re: Listing all models in a repository (reflection)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3508</link>
    <description>&lt;pre&gt;DescendantSet includes Enumerable so you just do

DataMapper::Model.descendants.each do |model|
  model.repository ...
end

On Wed, May 02, 2012 at 12:19:06PM -0400, Jason Brennan wrote:

&lt;/pre&gt;</description>
    <dc:creator>Markus Schirp</dc:creator>
    <dc:date>2012-05-02T16:36:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3507">
    <title>Re: Listing all models in a repository (reflection)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3507</link>
    <description>&lt;pre&gt;Aha! This seems to work for me, thanks.

I checked the docs for the DescendantSet class, and it appears all its methods are private. Is there a proper way to iterate over all its elements?

I see the -each method, but since that's private I'm wondering if this is the best way to go (in case, for example, it changes in the future).

Thanks so much for your help!
Jason.

On 2012-05-02, at 10:24 AM, Rhett Sutphin wrote:


&lt;/pre&gt;</description>
    <dc:creator>Jason Brennan</dc:creator>
    <dc:date>2012-05-02T16:19:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3506">
    <title>Re: Listing all models in a repository (reflection)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3506</link>
    <description>&lt;pre&gt;Hi,

On May 2, 2012, at 8:25 AM, jbrennan wrote:


You can use `DataMapper::Model.descendants` to get all the registered model classes. 

Rhett


&lt;/pre&gt;</description>
    <dc:creator>Rhett Sutphin</dc:creator>
    <dc:date>2012-05-02T14:24:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3505">
    <title>Listing all models in a repository (reflection)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3505</link>
    <description>&lt;pre&gt;I'm trying to whip up some debug pages based around all the models in my 
repository and I'm wondering if I can do this dynamically. Is there a way 
to list all the models in a given repository?

I'm not looking to list all the *objects* in the repo (not yet at least), 
but all the different kinds of models and their properties. I poked around 
the docs a little bit but was unable to find what I was looking for.

Any way to do this?

Thanks.

&lt;/pre&gt;</description>
    <dc:creator>jbrennan</dc:creator>
    <dc:date>2012-05-02T13:25:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3504">
    <title>Mutex already locked error in pooling.rb (jruby/torquebox)</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3504</link>
    <description>&lt;pre&gt;Hi,

I'm getting the following error at "random" times in an app I have deployed 
using jruby (1.6.7) on torquebox (2.0.1), using latest datamapper gems: 
https://gist.github.com/2507835

It's not something I can reproduce at will, seems to happen every few days 
under low load.

Anyone has an idea what's going on here? Bug in the pooling code?

Guessing jruby+TB may unearth some bugs under truly parallel threads not 
often encountered by most setups.

Thanks,
Patrik

&lt;/pre&gt;</description>
    <dc:creator>Patrik Sundberg</dc:creator>
    <dc:date>2012-04-27T15:44:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3503">
    <title>Re: DataObjects::Postgres::Result</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3503</link>
    <description>&lt;pre&gt;I had missed the note in the documentation of using select rather than 
execute. Thanks.

On Sunday, April 22, 2012 7:26:57 PM UTC-4, Neil C wrote:

&lt;/pre&gt;</description>
    <dc:creator>Neil C</dc:creator>
    <dc:date>2012-04-22T23:45:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3502">
    <title>DataObjects::Postgres::Result</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3502</link>
    <description>&lt;pre&gt;I executed a pure SQL query against Postgres using DataMapper and got an 
object of class DataObjects::Postgres::Result. However, I can't find any 
kind of documentation indicating how to manipulate this instance to get the 
data. Can you point me to that documentation?

Thanks.

&lt;/pre&gt;</description>
    <dc:creator>Neil C</dc:creator>
    <dc:date>2012-04-22T23:26:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3501">
    <title>Re: Attributes on an Association</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3501</link>
    <description>&lt;pre&gt;I tried a different and actually a lot more sensible approach as follows:

my_hash.each do |id, some_string_that_is_irrelevant|
      album_photo = album.album_photos.first(:photo_id=&amp;gt;id)  #Didn't want 
to reach to the database for an actual Photo instance
      album_photo.position = position
      position += 1
end

However, I still get DataMapper::UpdateConflictError: Book#update cannot be 
called on a dirty resource

This really boggles my mind because all I am doing is updating a single 
non-PK attribute through the API.

If anyone sees something I am missing, I would appreciate the help.

Thanks.


On Saturday, April 21, 2012 1:30:57 AM UTC-4, Neil Chaudhuri wrote:

&lt;/pre&gt;</description>
    <dc:creator>Neil Chaudhuri</dc:creator>
    <dc:date>2012-04-21T17:07:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3500">
    <title>Re: Modeling Multiple Many-to-Many Relationships With One Model In Common</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3500</link>
    <description>&lt;pre&gt;I was able to figure that out eventually. Thanks for listing all the
options!


On Apr 12, 9:10 am, mltsy &amp;lt;j...-2AgMCq7NQExWk0Htik3J/w&amp;lt; at &amp;gt;public.gmane.org&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Neil Chaudhuri</dc:creator>
    <dc:date>2012-04-21T17:00:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3499">
    <title>Attributes on an Association</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3499</link>
    <description>&lt;pre&gt;I need to store people, albums, photos, and the order that photos
appear in an album, so I decided to try adding a "position" attribute
to the association between Photo and Album. Consider the following
models:

class Person
  include DataMapper::Resource
...
end

class Album
  include DataMapper::Resource
...
  has n, :photos, "Photo", :through =&amp;gt; :album_photos, :via =&amp;gt; :photo
end

class Photo
  include DataMapper::Resource
...

  belongs_to :person, :required =&amp;gt; true
  has n, :albums, "Album", :through =&amp;gt; :album_photos, :via =&amp;gt; :album
end

class AlbumPhoto
  include DataMapper::Resource

  property :position, Integer, :default =&amp;gt; 1

  belongs_to :album, :key =&amp;gt; true
  belongs_to :photo, :key =&amp;gt; true

end

First, is such the right way to achieve this sort of thing? I didn't
see anything like this in the documentation.

To add a wrinkle, I have a model called Book which has a 1:M
relationship with Album. When I execute the following code

    album.album_photos.destroy
    album.album_photos &amp;lt;&amp;lt; AlbumPhoto.ne&lt;/pre&gt;</description>
    <dc:creator>Neil Chaudhuri</dc:creator>
    <dc:date>2012-04-21T05:30:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3498">
    <title>Query Order</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3498</link>
    <description>&lt;pre&gt;Guys,
how can I set the query (all, first, etc) order to something like
"ifnull(column1, column2) asc", I just can "order =&amp;gt;
[:column1.asc, :column2.asc]", but it does't work for null columns.
Thanks

&lt;/pre&gt;</description>
    <dc:creator>Fred</dc:creator>
    <dc:date>2012-04-18T21:18:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3497">
    <title>Re: Re: decimal field using sqlite</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3497</link>
    <description>&lt;pre&gt;Hi Dan,

According to
http://dev.mysql.com/doc/refman/5.0/en/precision-math-numbers.html,
scientific notation is considered a approximate value numeric literal by
MySQL (and possibly SQLite). As you mentioned, DO should convert the
BigDecimal to a String using #to_s("F") so that a exact value numeric
literal is used.

Regards,
Arthur

2012/4/15 Dan Kubb (dkubb) &amp;lt;dan.kubb-Re5JQEeQqe8AvxtiuMwx3w&amp;lt; at &amp;gt;public.gmane.org&amp;gt;




&lt;/pre&gt;</description>
    <dc:creator>Arthur M. Meskelis</dc:creator>
    <dc:date>2012-04-18T20:03:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3496">
    <title>Re: Re: decimal field using sqlite</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3496</link>
    <description>&lt;pre&gt;Hi Arthur,

So, is possible a new property, that inherit of Decimal, but, on save it 

Sure, check out some of the types in dm-types to see how you make custom 
types.

I haven't tested it, but I'm guessing you'll be able to implement this type 
in probably no more than 5-10 lines of code.

&lt;/pre&gt;</description>
    <dc:creator>Dan Kubb (dkubb</dc:creator>
    <dc:date>2012-04-15T06:00:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3495">
    <title>Many to one association question</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.ruby.datamapper/3495</link>
    <description>&lt;pre&gt;Howdy!

I have a very simple Many to One relationship

class InterviewGroup
  include DataMapper::Resource

  property :id, Serial
  has n, :interviews
end

class Interview
  include DataMapper::Resource

  property :id, Serial
  belongs_to :interview_group
  belongs_to :person
end

The problem is when I destroy an Interview, it deletes the parent 
InterviewGroup. Originally we had a :constraint =&amp;gt; :destroy on 
InterviewGroup#interviews, removing the constraint still results in the 
InterviewGroup being destroyed. The odd thing is the related Person is not 
destroyed.

How would I go about fixing this so deleting an Interview will not destroy 
the Group?

Thanks!

&lt;/pre&gt;</description>
    <dc:creator>Jacob Basham</dc:creator>
    <dc:date>2012-04-13T17:18:10</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.ruby.datamapper">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.ruby.datamapper</link>
  </textinput>
</rdf:RDF>

