How to create "custom" fields in Model? like sum, based on quantity and price. I guess it should be something like: def summ price * quantity end Am I right? If so, How to use them in :conditions parameter of the ActiveRecord::Base::find method? Is it possible it all? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Please use the Rails Talk list for questions like this: http://groups.google.com/group/rubyonrails-talk The core list is primarily for discussion of changes to the Rails core and not for questions about Rails itself. Thanks! V/r Anthony Eden On 7/15/07, gneeot <YuraPadlyak@gmail.com> wrote:> > > How to create "custom" fields in Model? like sum, based on quantity > and price. > I guess it should be something like: > > def summ > price * quantity > end > Am I right? > > If so, How to use them in :conditions parameter of the > ActiveRecord::Base::find method? Is it possible it all? > > > > >-- Cell: 808 782-5046 Current Location: Melbourne, FL --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ok, sorry On Jul 15, 5:13 pm, "Anthony Eden" <anthonye...@gmail.com> wrote:> Please use the Rails Talk list for questions like this: > > http://groups.google.com/group/rubyonrails-talk > > The core list is primarily for discussion of changes to the Rails core and > not for questions about Rails itself. Thanks! > > V/r > Anthony Eden > > On 7/15/07, gneeot <YuraPadl...@gmail.com> wrote: > > > > > > > How to create "custom" fields in Model? like sum, based on quantity > > and price. > > I guess it should be something like: > > > def summ > > price * quantity > > end > > Am I right? > > > If so, How to use them in :conditions parameter of the > > ActiveRecord::Base::find method? Is it possible it all? > > -- > Cell: 808 782-5046 > Current Location: Melbourne, FL--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---