Dan Tenenbaum | 18 Apr 23:09 2014
Picon

Where to find documentation for the finder methods for DataMapper objects?

Hello,

The page at 

http://datamapper.org/docs/find.html

says:

"The finder methods for DataMapper objects are defined in DataMapper::Repository. They include #get, #all, #first, #last"

with a link to 

http://rubydoc.info/github/datamapper/dm-core/master/DataMapper/Repository

However, on that page, there is no documentation for anything with the specified names.

And using the search box to search for methods called 'find' returns no exact matches.

Where's the documentation I'm looking for?

Thanks,
DAn

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/d/optout.
Tony Pitale | 16 Mar 23:34 2014
Picon

Ruby 2.0 breaks Model.get with string, which works in 1.9

class User
  include DataMapper::Resource

  property :id, Serial
end

User.create

User.first #=> works
User.get(1) #=> works
User.get("1") #=> works

# Switch to Ruby 2.0.0+

User.get("1") #=> does NOT work

# Why?

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/d/optout.
Nicholas Wieland | 19 Feb 17:10 2014

property uniqueness with scope

Hi, I'm having a very strange issue I'm not quite able to understand:

https://gist.github.com/ngw/9954447e04b0f60b1f86

The problem I have is that the spec fails, the subquery I create is valid (and it shouldn't, text is not unique) and I don't understand why.
Using unique: true doesn't help.

What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Alain Dazzi | 21 Feb 20:05 2014

numerous SELECT CHARACTER_SET_NAME queries

My production slow log indicates a high volume of 

SELECT CHARACTER_SET_NAME FROM INFORMATION_SCHEMA.COLLATIONS WHERE COLLATION_NAME = 'utf8_general_ci'\G

apparently generated by the datamapper. Any idea if the database encoding could be patched or configured
at the level.

Thank you.

# Profile
# Rank Query ID           Response time Calls R/Call Apdx V/M   Item
# ==== ================== ============= ===== ====== ==== ===== ==========
#    1 0x7AE23C54E4F857B8  0.7765 90.9%  1926 0.0004 1.00  0.00 SELECT INFORMATION_SCHEMA.COLLATIONS



--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
JCharles Deville | 16 Jan 16:05 2014
Picon

datamapper limit

Hello,

 

We’re using datamapper for a while now and it works pretty good for what we need.

 

Nevertheless, one of our projects requires to connect to a legacy database. This database has a few tables with column named ‘limit’ or ‘offset’.

I understand that these names are not properly supported. Is there a workaround ?

 

Thanks for your help,

 

Regards

JCDeville

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Torsten Rüger | 16 Jan 12:40 2014
Picon

Validations

Moi,

so as a newbie who was just going to move to datamapper, i am confused about the rails-4 and validations.

My app used paperclip and devise (though that is not written in stone) and so i found dm versions. But especially dm-devise says not to mix with dm-validations.
dm-validations are said to be superfluous and even dangerous as the dm-rails provides ActiveModel validations (indirectly)
Everything pointing towards not to use dm-validations, except dm-paperclip depends on it. 
Now i'm having troubles imagining that i would be the only one to use paperclip in a rails app, so what gives, where is my mistake ?

Any help (also link to paperclip alternatives) appreciated.

Torsten

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Piyush Ranjan | 3 Jan 14:43 2014
Picon

Is datamapper offically dead ?

Hi
Is datamapper officially dead now ? I don't see any activity around it. Has the ambitious rewrite project taken its toll or the core devs got busy in other projects ?

If yes, rest in peace datamapper. You were what Active record wanted to be. 
If no, any timelines on datamapper 2.0 :)

Piyush

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Christoph Blank | 9 Dec 13:57 2013
Picon

Duplicate entry 'S000018' for key 'PRIMARY'

Hi there,

I've got a weird error, I want to insert an object with the following code:

p = Property.first_or_create(:id => params[:propertyID])

It doesn't exist before this. The code is S000018. 
And I get exceptions like Duplicate entry 'S000018' for key 'PRIMARY'

Can anyone tell me why this happens and how to prevent it?

Thanks a lot,
Christoph

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Christoph Blank | 21 Nov 09:50 2013
Picon

Field Count mismatch exception?

Hi there,

Does anyone know what this Datamapper/mysql exception means?
ArgumentError (Field-count mismatch. Expected 1 fields, but the query yielded 8):

It happens not regularly, so I have no idea what it means
Shortly after it I get
DataObjects::SQLError (Lost connection to MySQL server during query)

Thanks a lot,
Christoph

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Harisankar P S | 25 Oct 14:14 2013
Picon

Error when trying to connect with another table, not in models

I am working on a rails project that uses DataMapper, my aim is to insert the details of a user into the table of prosody server. I haven't created a model file for the table in my model directory as its not related to my rails project. So I tried to execute it as a plan SQL query. 

Code available here: http://csnipp.com/s/26

This code worked before when I tried, but today on a fresh table it seems to break. Can you have a look and kindly let me know what i did wrong. 


regard, 

Hari

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
Alper Akgün | 3 Oct 12:26 2013
Picon

Query Path Join with 1.2

Hello all,
I am having problems with a query by an association(collection) using the two alternatives described in documentation ( http://datamapper.org/docs/find.html).
Does anyone have any suggestions without writing a custom SQL query? (mysql 5.*, dm-* 1.2)

1. Order.all(:limit=>20, Order.order_lines.color=>'blue')
# by query path; this makes an inner join and returns *multiple orders* if more than one blue order_line exist in each order. But i need unique list of orders.


2. Order.all(:limit=>20, :order_lines=>{:color=>'blue'})
#  by association hash; this makes 2 queries to the mysql; it first selects all orders.id from order_lines (10 millions) with
# SELECT `order_id` FROM `order_lines` WHERE `order_id` = 'blue'
# and then queries orders table with "FROM orders where id in (12 1232 2323....)" with around a million blue item ids!!


Notes
a) When attempting a where clause with IN subquery,I saw this; #http://datamapper.lighthouseapp.com/projects/20609/tickets/1330-dm-doesnt-handle-sub-selects-properly
b) DISTINCT(expenses.id) type of construct seems to be unsupported.



--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to datamapper-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.

Gmane