tag:blogger.com,1999:blog-11933937.post3716593703045725703..comments2023-12-28T04:10:37.805-06:00Comments on STEPHEN CHU . com: Rails composed_of validationStephen Chuhttp://www.blogger.com/profile/07181510921622947661noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-11933937.post-87826660116332903622010-07-09T12:17:12.010-05:002010-07-09T12:17:12.010-05:00i am using this method with the Money gem, and the...i am using this method with the Money gem, and their example composed_of code (http://money.rubyforge.org/). When i submit my form, i am getting undefined method `cents' for {"cents"=>"0.0", "currency"=>"usd"}:HashWithIndifferentAccess<br /><br />composed_of is not looking in the amount hash for cents & currency, it is using the hash itself. i cant seem to figure out why.Brewsternoreply@blogger.comtag:blogger.com,1999:blog-11933937.post-86152762143565396082008-08-05T21:27:00.000-05:002008-08-05T21:27:00.000-05:00Stephen, you can ignore my comment above. i went t...Stephen, you can ignore my comment above. i went through the previous 2 posts on the composed_of topic and i better understand what you did. ThanksJRhttps://www.blogger.com/profile/15859286284585937480noreply@blogger.comtag:blogger.com,1999:blog-11933937.post-1260598565067447412008-07-30T22:23:00.000-05:002008-07-30T22:23:00.000-05:00Hi Steven, this is nice work! i'm working on s...Hi Steven, this is nice work! i'm working on some statistical processing and looking at doing aggregation, but then persisting that data.<BR/><BR/>In your example, what if you wanted to keep a year-end balance?<BR/><BR/>Would you then create an AR class<BR/><BR/>class YearEndBalance < ActiveRecord::Base<BR/> :belongs_to User<BR/> # fields would be<BR/> # id, year, user_id, balance<BR/>end<BR/><BR/>and have in User.rb:<BR/><BR/> :has_many year_end_balances<BR/><BR/>Obviously, the creation of year-end-balances would be done from an off-line process from a batch-scheduler.<BR/><BR/>This would complete the full circle of data aggregation i'm trying to implement. not a very documented topic.JRhttps://www.blogger.com/profile/15859286284585937480noreply@blogger.comtag:blogger.com,1999:blog-11933937.post-55264609361906033182008-05-21T23:08:00.000-05:002008-05-21T23:08:00.000-05:00Hey Chu,Nice post.What's this ActiveRecord::Bases ...Hey Chu,<BR/>Nice post.<BR/>What's this ActiveRecord::Bases thing did you mean ActiveRecord::Base?<BR/><BR/>Sammy Zsouazelneufhttps://www.blogger.com/profile/17429125011813041283noreply@blogger.com