DataMapper is a Object Relational Mapper written in Ruby. It implements an architectural pattern with the same name (with some changes).
-1
votes
0answers
12 views
Datamapper with ParanoidBoolean is breaking navigation
Here I put an example to illustrate the problem. Try running it as is -> will not work, and then try commenting out the property :deleted, ParanoidBoolean
http://pastebin.com/iWamnVj5
When the ...
-1
votes
0answers
25 views
Creating entries in table from another table
Here are some tables in my database. (A template has some number of tasks associated with it):
Templates
=========
id template_name
-----------------
1 Template 1
2 Template 2
Tasks
=====
id ...
0
votes
1answer
40 views
Ruby Datamapper will not insert serial data
I have created a Ruby script that gets serial data and if it starts with certain characters, prints string (SMS), inserts string into a file, parses string, then inserts parsed data into a MySql ...
0
votes
1answer
12 views
LoadError on Windows when trying to generate a model
When trying to generate a model in a new Padrino project, I get the following:
C:\temp\ruby\test>padrino g model client
...
0
votes
1answer
29 views
DataMapper `has n` for different types of a model
I would like to have a model with different types of has n, for example:
class Blog
include DataMapper::Resource
property :id, Serial
has 1, :owner # of type user...
has n, :authors # of ...
0
votes
0answers
76 views
Ruby DataMapper complex parent-child relationship
I'm designing an API and database for somebody's app. I have some models in DataMapper, like User, Job, etc.
I'm trying to structure relationships such that a Job can have 1 owner (User), 1 worker ...
0
votes
0answers
25 views
Modelling comments in a database
I'm planning on modelling Users which can add Comments about other data models.
User has many Comments
Comment has a single author (User)
I'd like to allow commenting on virtually any data model I ...
0
votes
1answer
31 views
ruby datamapper - symmetric self-referential many-to-many relationship
I'm not an expert in databases and relational logic and I'm a bit confused about what I have to do in the following situation.
I have a model Expression where I want to implement a TranslationPair ...
0
votes
0answers
8 views
DataMapper Inheritance with Validation
I have the following defined:
class Event
include DataMapper::Resource
property :id, Serial
# For managing single table inheritance
property :type, Discriminator
end
class DurationEvent ...
0
votes
0answers
30 views
How do I reprogram Rails' polymorphic_url and url_for helpers for namespaced models?
I have extant DataMapper models. I'm using them in a Rails app. They're named something like Org::Model::Foo. I've already set up a
...
0
votes
1answer
78 views
Accessing the resource inside load/dump
consider the following example
module DataMapper
class Property
class CustomType < DataMapper::Property::Text
def load(value)
# do stuff and return formatted value
end
...
1
vote
1answer
39 views
ruby datamapper how to include child associations from has n association in query
Suppose I have an Article with n Comments. How would I go about grabbing all the comments with the article in one query with DataMapper?
Something like the following false code:
...
1
vote
0answers
22 views
ruby datamapper breakdown of Serial vs String property for key
Should every table have a Serial id? When would you need one, when wouldnt you? (associations, performance, etc?)
YouTube identifies videos with a key like "ttpYdIodMWc". I want something similar, ...
1
vote
1answer
79 views
One-to-one DataMapper association
I'm very new to DataMapper, and I'm trying to create models for the following scenario:
I've got a number of users (with a user name, password etc.), who can also be players or referees or both (so ...
0
votes
0answers
14 views
Datamapper - save new record into external database
I use DataMapper to connect to multiple databases. Reads and updates work, but when I try to create new record in my external database, it tries to save the record into the default database.
Here is ...