Mailinglist Archive: opensuse-ruby (15 mails)

< Previous Next >
Re: [opensuse-ruby] ActiveModel
  • From: Karel Minařík <karel.minarik@xxxxxxxxx>
  • Date: Tue, 8 Dec 2009 10:23:22 +0100
  • Message-id: <866133C3-6B38-4452-9314-FBAFDD401843@xxxxxxxxx>
Hi,

yes, it is marked as "experimental", (in fact "totally" experimental, [1] :), but there's nothing preventing you using ActiveRecord-like or - compatible models in Rails right now. The interface of ActiveModel/ ActiveORM is pretty minimal and easy to implement.

As Yehuda Katz has stated [1], " If an object complies with the ActiveModel API, it will work seamlessly with the rest of Rails, just as well as ActiveRecord works in Rails 2.3.". That'll be great to have in Rails, of course. I recently needed to research CouchDB suitability for a biggish project, and as one part of that research I had to create as minimal as possible "Rails-compatible", CouchDB-based, simplified model (no validations, callbacks, etc). It's only some 90 LOC, with HTTParty/Crack gems to facilitate HTTP communication and JSON parsing -- see the gist at [3] and [4].

So, in the case of WebYaST, I wouldn't be too scared to take ActiveModel just as a starting point and to implement the AR- compatible interface by yourself.

Best,

Karel Minarik

[1] http://github.com/rails/rails/blob/master/activemodel/README
[2] http://www.engineyard.com/blog/2009/my-five-favorite-things-about-rails-3/
[3] http://gist.github.com/251533
[4] http://gist.github.com/232171


On 7.Dec, 2009, at 17:06 , Josef Reidinger wrote:

Marcus Rueckert write:
On 2009-12-07 16:11:44 +0100, Josef Reidinger wrote:
It will be nice if we have some active-record(-resource) like models in
rest- service (same methods etc. to easy understand usage by other rails
developers). We use as backend DBus.
After some investigating I found that there is ActiveModel for rails
(also in 2.3.4 and 2.3.5), but marked as experimental.

Do you have any experience with it? Also how it should be packaged? As
separated gem?

isnt that stuff from rails 3?

darix


Yes, it should be officially introduced in rails 3, but we need a lot of its
functionality (callbacks, validation and some well-known methods like create,
load (and blacklisting variables) etc.) So I think it is better to add it
(maybe backport it) then write it from scratch?

Josef

--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, webyast
(language,time,basesystem,ntp)
--
To unsubscribe, e-mail: opensuse-ruby+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-ruby+help@xxxxxxxxxxxx


--
To unsubscribe, e-mail: opensuse-ruby+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-ruby+help@xxxxxxxxxxxx

< Previous Next >
List Navigation