I just updated the beta gems. Execute the following and you''ll be running them: gem update -s http://gems.rubyonrails.org ...they include a bunch of additional fixes and features. Most prominently perhaps are the new rich has_and_belongs_to_many associations that allow you to have additional attributes in the join tables: Added HasAndBelongsToManyAssociation#push_with_attributes(object, join_attributes) that can create associations in the join table with additional attributes. This is really useful when you have information that''s only relevant to the join itself, such as a "added_on" column for an association between post and category. The added attributes will automatically be injected into objects retrieved through the association similar to the piggy-back approach: post.categories.push_with_attributes(category, :added_on => Date.today) post.categories.first.added_on # => Date.today NOTE: The categories table doesn''t have a added_on column, it''s the categories_post join table that does! -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://macromates.com/ -- TextMate: Code and markup editor (OS X) http://www.loudthinking.com/ -- Broadcasting Brain
On Monday, November 15, 2004, 3:06:05 AM, David wrote:> gem update -s http://gems.rubyonrails.org> ...they include a bunch of additional fixes and features. Most > prominently perhaps are the new rich has_and_belongs_to_many > associations that allow you to have additional attributes in the join > tables:Hmmm... interesting. My past foray into ActiveRecord faltered on has_and_belongs_to_many. I guess I didn''t know what I was doing and didn''t have enough incentive to learn. Now I''m creating a Rails app that has a many-many relationship with additional attributes. If I''m not using the beta gem, how do I manage the attributes in a relationship table? Any good idioms? Gavin
> If I''m not using the beta gem, how do I manage the attributes in a > relationship table? Any good idioms?Then you do it by hand. Like I was doing with Basecamp. Have a service layer of some kind that''s just calling vanilla SQL. You _really_ don''t want to do that, though. Not when an Active Recordish approach is now available. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://macromates.com/ -- TextMate: Code and markup editor (OS X) http://www.loudthinking.com/ -- Broadcasting Brain
On 15/11/2004, at 3:06 AM, David Heinemeier Hansson wrote:> I just updated the beta gems. Execute the following and you''ll be > running them: > > gem update -s http://gems.rubyonrails.orgWhen updating my Rails 0.8 (gems version) I get the following messages: [ ... ] lib/action_controller/scaffolding.rb:87:37: Skipping require of dynamic string: "#{model_id.id2name}" Attempting remote upgrade of activerecord [ ... ] lib/dispatcher.rb:34:67: Skipping require of dynamic string: "#{Inflector.underscore(controller_name)}_controller" All gems up to date $ Can I safely ignore those messages? Cheers /B -- Bruno Mattarollo <bmatt-ee4meeAH724@public.gmane.org> Currently in: Sydney, Australia [ http://pokies.typepad.com/virtual_possum/ ] _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Mon, 15 Nov 2004 11:26:06 +1100, Bruno Mattarollo <bmatt-ee4meeAH724@public.gmane.org> wrote:> When updating my Rails 0.8 (gems version) I get the following messages: > > [ ... ] > lib/action_controller/scaffolding.rb:87:37: Skipping require of dynamic > string: "#{model_id.id2name}" > Attempting remote upgrade of activerecord > [ ... ] > lib/dispatcher.rb:34:67: Skipping require of dynamic string: > "#{Inflector.underscore(controller_name)}_controller" > All gems up to date > $ > > Can I safely ignore those messages?AFAIK, you can. I believe those messages are simply output from the automatic RDoc''ing of the source code that happens when you''re installing gems. -- Regards, John Wilger ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don''t know," Alice answered. "Then," said the cat, "it doesn''t matter." - Lewis Carrol, Alice in Wonderland
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruno Mattarollo wrote: | When updating my Rails 0.8 (gems version) I get the following messages: | [ ... ] | Can I safely ignore those messages? Yes! They''re harmless rdoc warnings. Here''s a little hack for beta gem users so you don''t have to use the - --source directive with each gem update. Edit $GEM_PATH/gems/sources-0.0.1/lib/sources.rb - - @sources = ["http://gems.rubyforge.org"] + @sources = %w(http://gems.rubyforge.org http://gems.rubyonrails.org) Now gem update will check both servers. Enjoy, jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBmCLdAQHALep9HFYRAsTVAJ9eR6YvznwaooWElq9t7uhJ+DrNKQCgy7Dd r+GPG5YS/+IHeWZESsNW864=Dy9S -----END PGP SIGNATURE-----
3kru-hpyd-5+VhGm8TZF7QT0dZR+AlfA@public.gmane.org
2004-Nov-15 04:09 UTC
Re: New beta gems available
Hi all, Is the SQL Server database provider included in the beta yet? --John On Sun, 14 Nov 2004 19:30:38 -0800, Jeremy Kemper <jeremy-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> * Replies will be sent through Spamex to rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > * For additional info click -> http://www.spamex.com/i/?v=4990968 > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bruno Mattarollo wrote: > | When updating my Rails 0.8 (gems version) I get the following messages: > | [ ... ] > | Can I safely ignore those messages? > > Yes! They''re harmless rdoc warnings. > > Here''s a little hack for beta gem users so you don''t have to use the > - --source directive with each gem update. Edit > $GEM_PATH/gems/sources-0.0.1/lib/sources.rb > - - @sources = ["http://gems.rubyforge.org"] > + @sources = %w(http://gems.rubyforge.org http://gems.rubyonrails.org) > > Now gem update will check both servers. > > Enjoy, > jeremy > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.6 (Darwin) > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > > iD8DBQFBmCLdAQHALep9HFYRAsTVAJ9eR6YvznwaooWElq9t7uhJ+DrNKQCgy7Dd > r+GPG5YS/+IHeWZESsNW864> =Dy9S > -----END PGP SIGNATURE----- > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hm, I''m just getting this error message: # gem update -s http://gems.rubyonrails.org activerecord Upgrading installed gems... Attempting remote upgrade of actionmailer Attempting remote installation of ''actionmailer'' ERROR: While executing gem ... (NoMethodError) undefined method `serialize'' for CGI::Session::ActiveRecordStore::Session:Class ...any ideas what i''ve done wrong? //samuel 2004-11-14 kl. 17.06 skrev David Heinemeier Hansson:> I just updated the beta gems. Execute the following and you''ll be > running them: > > gem update -s http://gems.rubyonrails.org > > ...they include a bunch of additional fixes and features. Most > prominently perhaps are the new rich has_and_belongs_to_many > associations that allow you to have additional attributes in the join > tables: > > Added HasAndBelongsToManyAssociation#push_with_attributes(object, > join_attributes) that can create associations in the join table with > additional attributes. This is really useful when you have information > that''s only relevant to the join itself, such as a "added_on" column > for an association between post and category. The added attributes > will automatically be injected into objects retrieved through the > association similar to the piggy-back approach: > > post.categories.push_with_attributes(category, :added_on => > Date.today) > post.categories.first.added_on # => Date.today > > NOTE: The categories table doesn''t have a added_on column, it''s the > categories_post join table that does! > -- > David Heinemeier Hansson, > http://www.basecamphq.com/ -- Web-based Project Management > http://www.rubyonrails.org/ -- Web-application framework for Ruby > http://macromates.com/ -- TextMate: Code and markup editor (OS X) > http://www.loudthinking.com/ -- Broadcasting Brain > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >________________________ Samuel Kvarnbrink samuel.kvarnbrink-SiIintg/mUyhy6ZWzZ/+Cw@public.gmane.org http://blog.humlab.umu.se/samuel/ "On two occasions I have been asked [by members of Parliament!], Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?'' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." -- Charles Babbage