[DataMapper] Adding support for a legacy database to DataMapper? (DataObjects)

2011-08-06 Thread Abe Voelker
Greetings, I am really hoping to get support for a legacy database (called OpenEdge, formerly Progress) working with DataMapper. I have a proprietary JDBC driver that I am planning on using; so far I have it working fine executing raw SQL from JRuby. To figure out how to do this, I've looked a

[DataMapper] Implementing model inheritance - multiple table inheritance possible?

2012-03-19 Thread Abe Voelker
I have some questions on how to handle some inheritance I will need to do in a Rails app. I am implementing a process where users will be filling out multi-step forms - a.k.a. wizards - and need to handle several different types of wizard processes, with new ones cropping up each year and the old

[DataMapper] Some help getting started with a new dm-database-adapter (w/ DataObjects adapter already completed)?

2012-06-13 Thread Abe Voelker
Hello everyone, I am trying to write a dm-database-adapter for a new database called OpenEdge. I've already written an adapter for DataObjects that is essentially finished herehttps://github.com/abevoelker/do/tree/add-openedge-adapter/do_openedge (barring any need for fresh downstream hacks

[DataMapper] Re: Datamapper not loading lazy property on first call to accessor method.

2012-07-18 Thread Abe Voelker
You could also forgo the ! by writing it with unless: return :error unless article.body On Wednesday, July 18, 2012 11:44:39 AM UTC-5, jbrennan wrote: Scratch that. I had an extra ! somewhere it didn't belong. How terribly embarrassing. On Wednesday, July 18, 2012 12:41:30 PM UTC-4,

[DataMapper] Re: Like Query with a URL Type

2012-08-22 Thread Abe Voelker
Is this too SQL-ish? person.photos.all(:conditions = ['url ilike ?', %amazon%]) On Wednesday, August 22, 2012 11:48:23 AM UTC-5, Neil C wrote: Besides, obviously, a SQL solution. Thanks. On Wednesday, August 22, 2012 12:45:52 PM UTC-4, Neil C wrote: I am trying to do the following:

[DataMapper] Re: Like Query with a URL Type

2012-08-22 Thread Abe Voelker
be any additional performance overhead from what you originally had to just doing person.photos.all.select{|photo| photo.url.host.downcase == 'amazon.com'} On Wednesday, August 22, 2012 12:01:05 PM UTC-5, Abe Voelker wrote: Is this too SQL-ish? person.photos.all(:conditions = ['url ilike

Re: [DataMapper] postgres adapter and UTF8 encoding

2012-09-06 Thread Abe Voelker
Do you have an encoding set in config/database.yml? Try setting it to UTF-8 or utf8 (I don't remember which is correct), e.g. development: adapter: postgresql encoding: UTF-8 development: adapter: postgresql encoding: utf8 Also you might want to use the same database in development

[DataMapper] Error inserting data into Postgres bytea column (using JDBC/JRuby version of do_postgres)

2012-09-11 Thread Abe Voelker
I am unable to insert binary values into a Postgres bytea column using the JDBC version of do_postgres (I'm using JRuby 1.6.7.2 in 1.9 mode). I have an InterviewForm model that I am trying to create records for, which has a formImage column that is a bytea (it's actually a custom Postgres type

[DataMapper] Re: Error inserting data into Postgres bytea column (using JDBC/JRuby version of do_postgres)

2012-09-11 Thread Abe Voelker
? On Tuesday, September 11, 2012 9:13:51 AM UTC-5, Abe Voelker wrote: I am unable to insert binary values into a Postgres bytea column using the JDBC version of do_postgres (I'm using JRuby 1.6.7.2 in 1.9 mode). I have an InterviewForm model that I am trying to create records for, which has

[DataMapper] Re: Error inserting data into Postgres bytea column (using JDBC/JRuby version of do_postgres)

2012-09-11 Thread Abe Voelker
as I explicitly created my test database as UTF-8 with createdb do_test -E UTF8 Any ideas, anyone? On Tuesday, September 11, 2012 12:01:07 PM UTC-5, Abe Voelker wrote: I ran the do_postgres specs on my local Postgres 9.1 database, but didn't get any errors (as expected). I'm not testing against

[DataMapper] Re: Error inserting data into Postgres bytea column (using JDBC/JRuby version of do_postgres)

2012-09-11 Thread Abe Voelker
That's good enough to get me past this hump, for now. On Tuesday, September 11, 2012 2:22:56 PM UTC-5, Abe Voelker wrote: Still in the process of tearing my hair out... I added some extra specs to DataObjects to try and isolate this. The first commithttps://github.com/abevoelker/do/commit

[DataMapper] Re: cannot get property value from User class

2013-01-18 Thread Abe Voelker
Give this a try: get '/:nickname/feed' do user = User.first(:nickname = params[:nickname]) if user @user_name = user.name else not_found 'unknown user' end end On Friday, January 18, 2013 12:55:25 PM UTC-6, Alex wrote: Hi, I have a problem getting the user’s name property.

[DataMapper] Re: Error installing dm-sqlite-adapter: sqlite3.h missing | OS X 10.8.2 (Mountain Lion)

2013-01-31 Thread Abe Voelker
The gem needs the SQLite development headers in order to compile native code. Having the sqlite3 binary installed (which sqlite3) is irrelevant to the problem. I'm not overly familiar with Mac but I think you need to install homebrewhttp://mxcl.github.com/homebrew/and then execute brew

[DataMapper] Re: Datamapper and setex from redis

2013-02-27 Thread Abe Voelker
Are you using DataMapper to store your models in a redis keystore (e.g. using dm-redis-adapter), or are you using a relational database and just wondering how you can get a similar feature? If it's the latter, I don't know of any relational databases that has such a feature built-in, so

Re: [DataMapper] DM 1.2 and various integration issues?

2013-04-05 Thread Abe Voelker
If it's for a greenfield project with no existing database(s), I'd suggest using ActiveRecord for the reasons that Chris mentioned. However, I still think that DataMapper shines when you have an existing (legacy) database schema that you can't change that you want to write models for.

Re: [DataMapper] Re: Where is DataMapper 2?

2013-09-01 Thread Abe Voelker
I agree Avdi. As someone who does follow the DataMapper projects, let me just say I'm really thankful for the original DataMapper, and am really looking forward to ROM - I like what I see so far! Heck I'm already benefiting from the modularization of the project as I often reach for virtus when

Re: [DataMapper] datamapper limit

2014-01-16 Thread Abe Voelker
Perhaps naming the properties something else will fix it? property :cleverly_renamed, Integer, field: 'offset' On Thu, Jan 16, 2014 at 9:05 AM, JCharles Deville jcdevi...@gmail.comwrote: Hello, We’re using datamapper for a while now and it works pretty good for what we need.