ActiveRecord patchset (introducing features such as postgres schema support)

10 views
Skip to first unread message

Adam Šindelář

unread,
Aug 21, 2008, 10:23:38 AM8/21/08
to Ruby on Rails: Core
Hi.

Our company is currently working on a large government contract to
develop an elearning system using Ruby on Rails. To support our needs,
we have added numerous useful features to ActiveRecord over the past
year or so; they include things such as proper support for PostgreSQL
schemas, saving binary data in PostgreSQL (currently broken as of
Rails 2.1), SQL reflection for stored procedures, calling stored
procedures using ActiveRecord, support for serializing (to_xml or
to_json) objects of multiple classes into the same array... Now, my
employer is seriously considering allocating person-hours for us to
work with the Rails core team to get our patches included in trunk.

We believe our changes to be quite useful, and consider it only fair
that we should give back to the community around this great project.
The question is, whether you would be interested in helping us with
this process, and including this functionality.

Thanks, I'll look forward to your replies,
Adam

Jeremy Kemper

unread,
Aug 21, 2008, 3:08:12 PM8/21/08
to rubyonra...@googlegroups.com

Hi Adam,

We'd love to work with you guys to merge your patches. Do you have a
github fork where we can peruse the changes?

Best,
jeremy

Adam Šindelář

unread,
Aug 21, 2008, 5:24:10 PM8/21/08
to rubyonra...@googlegroups.com
Hi again,

We don't have a public fork right now, and it will take some time for things to get moving in the company. I'm sorry about this process, I need to show my superiors that there's interest on your side for them to green-light the budget for this. I'll make sure to post back here as soon the person-hours budget is approved and we can work out what would work best.

Thanks for your interest, I look forward to working with you guys.

Adam

2008/8/21 Jeremy Kemper <jer...@bitsweat.net>

Adam Šindelář

unread,
Aug 23, 2008, 10:42:20 AM8/23/08
to Ruby on Rails: Core
Hello yet again,

I'm permitted by my superiors to go ahead, but I am going to have to
do work on this alone, so things may not go as fast as I'd intended.
Nevertheless, I have prepared the first patch that I would like to
show to you, and find out what you would have me fix, add, or change.
Due to the fact that I am only one person, and cannot possibly hope to
prepare the entirety of our repository (nor am I allowed to) for your
review in reasonable time, I'm going to have to submit individual
patches. Unless you want me to do otherwise, I'm going to stick with
the normal patch review process, and have, for now, submitted the
first version of this patch here:
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/888-add-sql-methods-to-models.

I would appreciate it, if you could review it and let me know what to
change.

Cheers,
Adam

On Aug 21, 9:08 pm, "Jeremy Kemper" <jer...@bitsweat.net> wrote:

frogstarr78

unread,
Aug 25, 2008, 12:37:34 PM8/25/08
to Ruby on Rails: Core
We have also done some work extending the rails postgresql adapter for
a legacy database. Specifically, to support postgresql DDL commands in
ruby code. Currently it supports dumping and creating database
functions, database trigger functions, user defined database types,
and creating (not dumping by default) database views.

We created it as a monkey patch plugin for the rails schema_dumper and
postgresql_adapter and it has worked nicely for us from Rails 1.2.6 to
Rails 2.1. The rubyforge site is http://rubyforge.org/projects/railspgprocs/.

frogstarr78

unread,
Aug 25, 2008, 12:56:16 PM8/25/08
to Ruby on Rails: Core
I should mention we'd be interested in getting these additions added
to the core postgresql adapter if there is a possibility of that.
Although I wouldn't want to step on any toes either. We'd be happy to
collaborate with Adam and Co. on this also, seeing as he brought it
up.

On Aug 25, 9:37 am, frogstarr78 <frogstar...@gmail.com> wrote:
> We have also done some work extending the rails postgresql adapter for
> a legacy database. Specifically, to support postgresql DDL commands in
> ruby code. Currently it supports dumping and creating database
> functions, database trigger functions, user defined database types,
> and creating (not dumping by default) database views.
>
> We created it as a monkey patch plugin for the rails schema_dumper and
> postgresql_adapter and it has worked nicely for us from Rails 1.2.6 to
> Rails 2.1. The rubyforge site ishttp://rubyforge.org/projects/railspgprocs/.

Jeremy Kemper

unread,
Aug 25, 2008, 3:50:49 PM8/25/08
to rubyonra...@googlegroups.com
2008/8/25 frogstarr78 <frogs...@gmail.com>:

> I should mention we'd be interested in getting these additions added
> to the core postgresql adapter if there is a possibility of that.
> Although I wouldn't want to step on any toes either. We'd be happy to
> collaborate with Adam and Co. on this also, seeing as he brought it
> up.

Nice code :) What versions of pg does it work with?

jeremy

Hongli Lai

unread,
Aug 25, 2008, 5:00:49 PM8/25/08
to Ruby on Rails: Core
I just want to say, good work. :) I've tried to use Rails with
PostgreSQL some time ago and I ran into all sorts of issues. Hopefully
these changes will get included in time.

Tarmo Tänav

unread,
Aug 25, 2008, 5:44:59 PM8/25/08
to rubyonra...@googlegroups.com
On E, 2008-08-25 at 14:00 -0700, Hongli Lai wrote:
> I just want to say, good work. :) I've tried to use Rails with
> PostgreSQL some time ago and I ran into all sorts of issues. Hopefully
> these changes will get included in time.

Care to elaborate on the issues?

I'm not aware of any issues with using Postgresql with Rails like one
would use Mysql, but ofcourse the more advanced Postgresql features
aren't supported by Rails. This sometimes means that for schema one
needs to use the :sql format and one also needs to write custom SQL to
access certain features, but I wouldn't call those issues, just
lack of niceties.

Certain features, as you're probably aware of, like foreign key
migrations/dumping, are provided by the Redhill on Rails plugins:
http://www.redhillonrails.org/index.html

frogstarr78

unread,
Aug 25, 2008, 9:00:46 PM8/25/08
to Ruby on Rails: Core
This works on PostgreSQL versions 8.0-8.2

On Aug 25, 12:50 pm, "Jeremy Kemper" <jer...@bitsweat.net> wrote:
> 2008/8/25 frogstarr78 <frogstar...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages