Greetings, At RailsConf Europe 2008, I spent some time playing with my own implementation of ActiveModel. Most of the validations stuff has been implemented now, so I think it''s ready to be shared with the community. http://github.com/leethal/activemodel/tree/master I have not yet tried to integrate this into ActiveRecord (yet). Doing so is probably quite a lot of work (deprecations etc.), and if it''s done now, it probably has to be re-done by the time of deciding to actually implement it in the master branch (be it my implementation or someone elses). Some notes: * After talking to DHH on the mentioned RailsConf and showing him my ActiveModel implementation at the state it was in at that time, he suggested having a system to hook your own validation methods in a way that made sure they were available to all libraries using ActiveModel::Validations. I have implemented this with the ActiveModel::Validations.add method. * It does not use the L18n library for validation messages, for no particular reason. It doesn''t really matter at this point, I guess, and as far as I know, all it takes is adding a .t to the strings. * The validations sort of implement it''s own callback system as of now. It should probably rely on ActiveModel::Callbacks instead. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Regarding the callback library in ActiveModel. I just started working on that as a stand-alone implementation of callback functionality. But I guess using ActiveSupport::Callbacks makes sense here? On Sep 10, 7:53 am, August Lilleaas <augustlille...@gmail.com> wrote:> Greetings, > > At RailsConf Europe 2008, I spent some time playing with my own > implementation of ActiveModel. Most of the validations stuff has been > implemented now, so I think it''s ready to be shared with the > community. > > http://github.com/leethal/activemodel/tree/master > > I have not yet tried to integrate this into ActiveRecord (yet). Doing > so is probably quite a lot of work (deprecations etc.), and if it''s > done now, it probably has to be re-done by the time of deciding to > actually implement it in the master branch (be it my implementation or > someone elses). > > Some notes: > > * After talking to DHH on the mentioned RailsConf and showing him my > ActiveModel implementation at the state it was in at that time, he > suggested having a system to hook your own validation methods in a way > that made sure they were available to all libraries using > ActiveModel::Validations. I have implemented this with the > ActiveModel::Validations.add method. > * It does not use the L18n library for validation messages, for no > particular reason. It doesn''t really matter at this point, I guess, > and as far as I know, all it takes is adding a .t to the strings. > * The validations sort of implement it''s own callback system as of > now. It should probably rely on ActiveModel::Callbacks instead.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Decided to remove ActiveModel::Callbacks alltogether. What exactly should it do, anyway? For the purpose of making validations work, I''d say it''s overkill. Perhaps there''s something I haven''t though of. On Sep 10, 9:58 am, August Lilleaas <augustlille...@gmail.com> wrote:> Regarding the callback library in ActiveModel. I just started working > on that as a stand-alone implementation of callback functionality. But > I guess using ActiveSupport::Callbacks makes sense here? > > On Sep 10, 7:53 am, August Lilleaas <augustlille...@gmail.com> wrote: > > > Greetings, > > > At RailsConf Europe 2008, I spent some time playing with my own > > implementation of ActiveModel. Most of the validations stuff has been > > implemented now, so I think it''s ready to be shared with the > > community. > > >http://github.com/leethal/activemodel/tree/master > > > I have not yet tried to integrate this into ActiveRecord (yet). Doing > > so is probably quite a lot of work (deprecations etc.), and if it''s > > done now, it probably has to be re-done by the time of deciding to > > actually implement it in the master branch (be it my implementation or > > someone elses). > > > Some notes: > > > * After talking to DHH on the mentioned RailsConf and showing him my > > ActiveModel implementation at the state it was in at that time, he > > suggested having a system to hook your own validation methods in a way > > that made sure they were available to all libraries using > > ActiveModel::Validations. I have implemented this with the > > ActiveModel::Validations.add method. > > * It does not use the L18n library for validation messages, for no > > particular reason. It doesn''t really matter at this point, I guess, > > and as far as I know, all it takes is adding a .t to the strings. > > * The validations sort of implement it''s own callback system as of > > now. It should probably rely on ActiveModel::Callbacks instead.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 10, 1:53 am, August Lilleaas <augustlille...@gmail.com> wrote:> Greetings, > > At RailsConf Europe 2008, I spent some time playing with my own > implementation of ActiveModel. Most of the validations stuff has been > implemented now, so I think it''s ready to be shared with the > community. > > http://github.com/leethal/activemodel/tree/masterThis is kind of interesting to me b/c way back I suggested to DHH that the underlying DB adapter code would also be a good thing to extract into a separate project (I dubbed it ActiveDBA, I think DHH suggested calling it ActionAdapter). I never ended up doing it, but still think it would be a good project --and actually rather trivial by comparison to what you are working on, I imagine. Perhaps there is interest enough now that someone would like to pursue it? Although I wonder, what is left of ActiveRecord once ActionAdapter and ActiveModel are separated out of it? In any case, bringing it all together I think these smaller project units are a good idea and make an excellent stack of technologies in its own right. T. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Personally, I can''t recall ever having needed a stand-alone DB adapter library, so I can''t be of much help there. On Sep 10, 7:28 pm, 7rans <transf...@gmail.com> wrote:> On Sep 10, 1:53 am, August Lilleaas <augustlille...@gmail.com> wrote: > > > Greetings, > > > At RailsConf Europe 2008, I spent some time playing with my own > > implementation of ActiveModel. Most of the validations stuff has been > > implemented now, so I think it''s ready to be shared with the > > community. > > >http://github.com/leethal/activemodel/tree/master > > This is kind of interesting to me b/c way back I suggested to DHH that > the underlying DB adapter code would also be a good thing to extract > into a separate project (I dubbed it ActiveDBA, I think DHH suggested > calling it ActionAdapter). I never ended up doing it, but still think > it would be a good project --and actually rather trivial by comparison > to what you are working on, I imagine. Perhaps there is interest > enough now that someone would like to pursue it? Although I wonder, > what is left of ActiveRecord once ActionAdapter and ActiveModel are > separated out of it? > > In any case, bringing it all together I think these smaller project > units are a good idea and make an excellent stack of technologies in > its own right. > > T.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 10, 7:28 pm, 7rans <transf...@gmail.com> wrote:> This is kind of interesting to me b/c way back I suggested to DHH that > the underlying DB adapter code would also be a good thing to extract > into a separate project (I dubbed it ActiveDBA, I think DHH suggested > calling it ActionAdapter). I never ended up doing it, but still think > it would be a good project --and actually rather trivial by comparison > to what you are working on, I imagine. Perhaps there is interest > enough now that someone would like to pursue it? Although I wonder, > what is left of ActiveRecord once ActionAdapter and ActiveModel are > separated out of it?An excellent idea. This would make ActiveRecord a lot easier to read. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Sep 11, 8:19 am, August Lilleaas <augustlille...@gmail.com> wrote:> Personally, I can''t recall ever having needed a stand-alone DB adapter > library, so I can''t be of much help there.In places where performance is critical, or when dealing with legacy databases, it might be necessary to drop to raw SQL. An "ActionAdapter" might make that a bit easier. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Anyone in the core team interested in this? On Sep 10, 7:53 am, August Lilleaas <augustlille...@gmail.com> wrote:> Greetings, > > At RailsConf Europe 2008, I spent some time playing with my own > implementation of ActiveModel. Most of the validations stuff has been > implemented now, so I think it''s ready to be shared with the > community. > > http://github.com/leethal/activemodel/tree/master > > I have not yet tried to integrate this into ActiveRecord (yet). Doing > so is probably quite a lot of work (deprecations etc.), and if it''s > done now, it probably has to be re-done by the time of deciding to > actually implement it in the master branch (be it my implementation or > someone elses). > > Some notes: > > * After talking to DHH on the mentioned RailsConf and showing him my > ActiveModel implementation at the state it was in at that time, he > suggested having a system to hook your own validation methods in a way > that made sure they were available to all libraries using > ActiveModel::Validations. I have implemented this with the > ActiveModel::Validations.add method. > * It does not use the L18n library for validation messages, for no > particular reason. It doesn''t really matter at this point, I guess, > and as far as I know, all it takes is adding a .t to the strings. > * The validations sort of implement it''s own callback system as of > now. It should probably rely on ActiveModel::Callbacks instead.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Sep 12, 2008 at 10:32 AM, August Lilleaas <augustlilleaas@gmail.com> wrote:> > Anyone in the core team interested in this?I''ve pinged david again to get his feedback. From my own perspective, we''re so close to shipping 2.2 that I''m tryiing not to get distracted by shiny new things :) I like the fact that you''re cleaning up validations, we''ve had a few other threads on this recently, and in the 2.3 lifecycle it''d be really nice integrate a nice, modular validations module. So yeah, I like the approach you''ve taken, but would prefer to hold off doing anything with it for a few weeks while we try and get a 2.2 beta out the door.> On Sep 10, 7:53 am, August Lilleaas <augustlille...@gmail.com> wrote: >> Greetings, >> >> At RailsConf Europe 2008, I spent some time playing with my own >> implementation of ActiveModel. Most of the validations stuff has been >> implemented now, so I think it''s ready to be shared with the >> community. >> >> http://github.com/leethal/activemodel/tree/master >> >> I have not yet tried to integrate this into ActiveRecord (yet). Doing >> so is probably quite a lot of work (deprecations etc.), and if it''s >> done now, it probably has to be re-done by the time of deciding to >> actually implement it in the master branch (be it my implementation or >> someone elses). >> >> Some notes: >> >> * After talking to DHH on the mentioned RailsConf and showing him my >> ActiveModel implementation at the state it was in at that time, he >> suggested having a system to hook your own validation methods in a way >> that made sure they were available to all libraries using >> ActiveModel::Validations. I have implemented this with the >> ActiveModel::Validations.add method. >> * It does not use the L18n library for validation messages, for no >> particular reason. It doesn''t really matter at this point, I guess, >> and as far as I know, all it takes is adding a .t to the strings. >> * The validations sort of implement it''s own callback system as of >> now. It should probably rely on ActiveModel::Callbacks instead. > > >-- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Sure, I''m thinking of this as a 2.3 (with deprecations) and 3.0 (with the deprecations removed) kind of thing anyways. Thanks! On Sep 12, 5:05 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> On Fri, Sep 12, 2008 at 10:32 AM, August Lilleaas > > <augustlille...@gmail.com> wrote: > > > Anyone in the core team interested in this? > > I''ve pinged david again to get his feedback. From my own perspective, > we''re so close to shipping 2.2 that I''m tryiing not to get distracted > by shiny new things :) > > I like the fact that you''re cleaning up validations, we''ve had a few > other threads on this recently, and in the 2.3 lifecycle it''d be > really nice integrate a nice, modular validations module. > > So yeah, I like the approach you''ve taken, but would prefer to hold > off doing anything with it for a few weeks while we try and get a 2.2 > beta out the door. > > > > > On Sep 10, 7:53 am, August Lilleaas <augustlille...@gmail.com> wrote: > >> Greetings, > > >> At RailsConf Europe 2008, I spent some time playing with my own > >> implementation of ActiveModel. Most of the validations stuff has been > >> implemented now, so I think it''s ready to be shared with the > >> community. > > >>http://github.com/leethal/activemodel/tree/master > > >> I have not yet tried to integrate this into ActiveRecord (yet). Doing > >> so is probably quite a lot of work (deprecations etc.), and if it''s > >> done now, it probably has to be re-done by the time of deciding to > >> actually implement it in the master branch (be it my implementation or > >> someone elses). > > >> Some notes: > > >> * After talking to DHH on the mentioned RailsConf and showing him my > >> ActiveModel implementation at the state it was in at that time, he > >> suggested having a system to hook your own validation methods in a way > >> that made sure they were available to all libraries using > >> ActiveModel::Validations. I have implemented this with the > >> ActiveModel::Validations.add method. > >> * It does not use the L18n library for validation messages, for no > >> particular reason. It doesn''t really matter at this point, I guess, > >> and as far as I know, all it takes is adding a .t to the strings. > >> * The validations sort of implement it''s own callback system as of > >> now. It should probably rely on ActiveModel::Callbacks instead. > > -- > Cheers > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 9/12/08, August Lilleaas <augustlilleaas@gmail.com> wrote:> > Sure, I''m thinking of this as a 2.3 (with deprecations) and 3.0 (with > the deprecations removed) kind of thing anyways. Thanks!Didn''t we talk about tweaking some of the state machine event guarding and state transitioning stuff to use more validations and callbacks too? Being able to add validations to anything would be interesting. The toy yak shave project I thought I was going to be working on over the summer didn''t pan out (no couchdb for me). Therefore, I didn''t get anything done on AMo liked I probably said I would :) Another thought I had was moving the association proxy and scoping stuff from AR to AMo. See: http://www.ideaforge.org/blog/?p=8#comment-67 -- Rick Olson http://entp.com http://lighthouseapp.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hey all> Didn''t we talk about tweaking some of the state machine event guarding > and state transitioning stuff to use more validations and callbacks > too? Being able to add validations to anything would be interesting.I recently experimented with state machines that use callbacks/ observers. I also detect transitions that occur through direct state manipulation (as opposed to invoking an event! method... e.g. update_attributes(:state => ''closed'')) and fire the appropriate enter/ exit callbacks. Source is at http://github.com/sbfaulkner/has_states It''s working nicely for me in my current project. (FYI... had I noticed ActiveModel rather than the other plugins that are out there I''d have tried this there instead). Cheers. --Brent --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I''m going to put this on hold until 2.2 is out. Then I''ll start working with the AR tests. On Sep 13, 3:40 pm, "S. Brent Faulkner" <bre...@unwwwired.net> wrote:> Hey all > > > Didn''t we talk about tweaking some of the state machine event guarding > > and state transitioning stuff to use more validations and callbacks > > too? Being able to add validations to anything would be interesting. > > I recently experimented with state machines that use callbacks/ > observers. I also detect transitions that occur through direct state > manipulation (as opposed to invoking an event! method... e.g. > update_attributes(:state => ''closed'')) and fire the appropriate enter/ > exit callbacks. > > Source is athttp://github.com/sbfaulkner/has_states > > It''s working nicely for me in my current project. > > (FYI... had I noticed ActiveModel rather than the other plugins that > are out there I''d have tried this there instead). > > Cheers. > > --Brent--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---