[opensuse-ruby] ActiveModel
Hi, 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? thanks Josef -- Josef Reidinger YaST team maintainer of perl-Bootloader, YaST2-Repair, webyast (language,time,basesystem,ntp) -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
On 2009-12-07 16:11:44 +0100, Josef Reidinger wrote:
isnt that stuff from rails 3? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
Marcus Rueckert write:
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@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
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:
-- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
On 2009-12-07 16:11:44 +0100, Josef Reidinger wrote:
isnt that stuff from rails 3? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
Marcus Rueckert write:
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@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
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:
-- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-ruby+help@opensuse.org
participants (3)
-
Josef Reidinger
-
Karel Minařík
-
Marcus Rueckert