Compatibility with Rails 2.1 RC1

2 views
Skip to first unread message

Menno van der Sman

unread,
May 20, 2008, 10:21:16 AM5/20/08
to Composite Keys for ActiveRecord
Hi,

I was trying out RC1 of the new Rails release but I'm running into
problems loading the cpk gem through config.gem.

It seems cpk depends on activerecord-2.0.2 but the activerecord
bundled with RC1 (which is activerecord-2.0.991) doesn't seem to
satisfy this condition. I get the following error:

** Starting Rails with development environment...
Exiting
/Library/Ruby/Site/1.8/rubygems.rb:139:in `activate': can't activate
activerecord (>= 2.0.2), already activated activerecord-2.0.991]
(Gem::Exception)

Has anybody found a workaround for this?

Thanks,

Menno

darrin

unread,
May 20, 2008, 2:25:08 PM5/20/08
to Composite Keys for ActiveRecord
I don't have an answer to this particular problem, but Googling around
a few other plugins are having similar problems.

The worse news is that some AR classes have been restructured in edge,
so once you get past this error you still won't be able to load it...

http://groups.google.com/group/compositekeys/browse_thread/thread/e9abf9005a6902c0

So, short answer is that CPK is currently not compatible with 2.1 (aka
2.0.991)

Steve Sims

unread,
May 21, 2008, 5:13:12 AM5/21/08
to compos...@googlegroups.com
You know what?

It'd be really nice if the Rails guys pulled their heads out of their
arses and recognised that supporting composite keys is a good thing,
and integrated compositekeys directly into ActiveRecord.

I for one can see no disadvantage at all in it being integrated.

ActiveRecord *not* supporting composite keys just makes AR (and hence
Rails too) look like a joke when compared to just about every other
ORM and is a major negative mark against Rails. Since I know
something about building databases that have decent data integrity it
was only after I discovered the compositekeys gem that I could
consider using Rails.

Steve

Nic Williams

unread,
May 21, 2008, 5:25:48 AM5/21/08
to compos...@googlegroups.com
Someone could fork rails, integrate composite keys into rails + submit a patch. You never know.
--
Dr Nic Williams
* Learn TextMate for Rails2 - http://peepcode.com/products/textmate-for-rails-2 *
Training in Ruby/Rails/JavaScript - http://drnicacademy.com
Fun with Ruby/Rails/Javascript - http://drnicwilliams.com

Clifford Heath

unread,
May 22, 2008, 5:36:39 AM5/22/08
to compositekeys
Steve (and others),

re CPK support being rolled in to Rails core...

I tackled Koz and Jeremy Kemper on this 12 months ago at RailsConf,
and they were both of the opinion that any changes required to provide
CPK in AR would be perfectly acceptable, as long as the defaults and
normal Rails-ish workflow wasn't changed.

I tried to assemble a group of like-minded folk to help fix this, as I
wasn't
going to tackle it alone, but though there was enthusiasm (see my BOF
on "Enterprise Rails"), those people were mostly of the enterprise
persuasion (surprise!) and not allowed, or interested, or capable or
some
bloody reason, or contributing to such an effort.

Even a test suite that actually runs continuous integration across all
the
major database platforms would be a major achievement. All the
enterprise
database products are available in Express editions, so no licensing is
needed for such a test framework, though distributing a Parallels or
VMWare image that's preconfigured might be objectionable. Choose one
Windows and one *nix platform, create a script that installs and
configures
all known DB products, and runs through a test suite, and Rails database
support will jump about 1000% in credibility overnight. This is what
Python
has for its ADODB ORM, and lack of it is hampering the Ruby+Rails
community immensely.

Personally my motivation to fix AR is somewhat low, as my ActiveFacts
project aims to leapfrog past all other ORMs out there, even Microsoft's
advanced Entity Framework, and provide a completely new way of doing
databases, replacing (but generating) SQL in the process. It's a big
project that's getting close to needing additional contributors - the
basic
framework is getting quite close now.

Clifford Heath, http://dataconstellation.com/ActiveFacts

darrin

unread,
May 27, 2008, 8:31:08 PM5/27/08
to Composite Keys for ActiveRecord
I have a fork at http://github.com/darrinholst/composite_primary_keys
that passes all tests with the latest edge version of Rails. There's a
gem here also - http://compositekeys.googlegroups.com/web/composite_primary_keys-0.9.93.gem.
Let me know if anyone gets a chance to try it out. It's only been
tested with sqlite so far.

The association preloading model has changed for Rails 2.1, read all
about it here - http://dev.rubyonrails.org/ticket/9640. All the
current tests use the new way, we'll need to add tests that also test
the old way.

Now go on and tell everyone at RailsConf, I'm sure it will be the talk
of Portland :)

Nic Williams

unread,
May 27, 2008, 10:56:43 PM5/27/08
to compos...@googlegroups.com
Are you going to push out a new gem to rubyforge if its passing tests? New gems are always good for the soul.

darrin

unread,
May 28, 2008, 7:16:09 AM5/28/08
to Composite Keys for ActiveRecord
I don't know, I was thinking of waiting for the official release of
2.1 before doing that. Since it isn't compatible with 2.0 someone
could get the latest Rails and the latest CPK and not have it work.
What do you think?

On May 27, 9:56 pm, "Nic Williams" <drnicwilli...@gmail.com> wrote:
> Are you going to push out a new gem to rubyforge if its passing tests? New
> gems are always good for the soul.
>
>
>
> On Wed, May 28, 2008 at 10:31 AM, darrin <darrin.ho...@gmail.com> wrote:
>
> > I have a fork athttp://github.com/darrinholst/composite_primary_keys
> > that passes all tests with the latest edge version of Rails. There's a
> > gem here also -
> >http://compositekeys.googlegroups.com/web/composite_primary_keys-0.9....
> > .
> > Let me know if anyone gets a chance to try it out. It's only been
> > tested with sqlite so far.
>
> > The association preloading model has changed for Rails 2.1, read all
> > about it here -http://dev.rubyonrails.org/ticket/9640. All the

Nic Williams

unread,
May 28, 2008, 7:21:01 AM5/28/08
to compos...@googlegroups.com
That's fair. Perhaps release a final 0.9.X version with a fixed rails dependency of 2.0.2, and then release new CPK 1.0 with >= 2.1.0 for active_record.

Nic

Foliosus

unread,
Jun 3, 2008, 12:21:23 PM6/3/08
to Composite Keys for ActiveRecord
Hi Darrin,

I'm having a hard time grabbing cpk 0.9.93 -- I keep getting weird gem
errors (HTTP Response 302 fetching http://compositekeys.googlegroups.com/web/yaml).
If I download the gem through my browser it comes down as a .tar file,
and my system won't let me install from that file. I'm really not
familiar with gem file structures -- do you have any advice? I'm
running MacOS 10.5.2.

Thanks!

On May 27, 5:31 pm, darrin <darrin.ho...@gmail.com> wrote:
> I have a fork athttp://github.com/darrinholst/composite_primary_keys
> that passes all tests with the latest edge version of Rails. There's a
> gem here also -http://compositekeys.googlegroups.com/web/composite_primary_keys-0.9.....
> Let me know if anyone gets a chance to try it out. It's only been
> tested with sqlite so far.
>
> The association preloading model has changed for Rails 2.1, read all
> about it here -http://dev.rubyonrails.org/ticket/9640. All the

darrin

unread,
Jun 3, 2008, 2:46:09 PM6/3/08
to Composite Keys for ActiveRecord
I'll get the rubyforge gems updated as soon as I get access to the
main repo. Until then, you should be able to download the gem from
http://compositekeys.googlegroups.com/web/composite_primary_keys-0.9.93.gem
to your computer. Then in the terminal change to the directory where
you downloaded it and do a sudo gem install composite_primary_keys.
That should pick up the local file in that directory.

Also, the future 1.0.0 version is at http://github.com/darrinholst/composite_primary_keys/tree/master
if you want to grab the source from there and do a rake install_gem.

Darrin

On Jun 3, 11:21 am, Foliosus <folio...@foliosus.com> wrote:
> Hi Darrin,
>
> I'm having a hard time grabbing cpk 0.9.93 -- I keep getting weird gem
> errors (HTTP Response 302 fetchinghttp://compositekeys.googlegroups.com/web/yaml).

Brent Miller

unread,
Jun 3, 2008, 4:33:35 PM6/3/08
to compos...@googlegroups.com
Thanks! I think I got it to work with only minor wrangling. :)

Brent

=======================================================
Brent Miller
http://www.foliosus.com/

"The problem is that once you have done away with the
ability to make judgments as to right and wrong, true
and false, etc., there's no real culture left. All
that remains is clog dancing and macrame."
-- Neal Stephenson
=======================================================

Reply all
Reply to author
Forward
0 new messages