search for: masterkain

Displaying 5 results from an estimated 5 matches for "masterkain".

2008 Aug 31
9
assigning collection values and exceptions
hi everyone, I''ve this code in my Report model: has_many :report_reasons, :validate => true has_many :reasons, :through => :report_reasons #, :uniq => true # :accessible => true def reason_attributes=(reason_attributes) reasons.clear reason_attributes.uniq.each do |reason| reasons << Reason.find_or_create_by_content(reason) end end
2012 Jan 27
2
to_json performance
Originally posted on github, reported to the right place. I would like to open a discussion about how `to_json` and `as_json` operates in Rails from a performance standpoint. I''m using Rails 3.2 but this issue applies to almost all versions of Rails. Our use case presents the challenge in sending out potentially large JSON (or XML, but we''ll focus on JSON rendering here)
2007 Mar 04
0
multiple has_many :through
hi, simplifying I''ve this: user -> membership -> group -> grant -> right user has_many group through membership and group has_many right through grant. I can fetch the groups'' rights well, doing some console stuff like @user.groups.each do |group| ;; group.rights.each do |right| ;; puts right.name ;; end ;; end etc. it would be very powerful to be able to do
2007 Mar 09
1
capistrano and rails edge
hi, I''m trying to capitranize my app (cap --apply-to app iEngine) but all I got is a strange error: /i386/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'': no such file to load -- app/config/environment (LoadError) what capistrano is talking about? thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2007 May 02
3
acts_as_tree related question
hi, I''ve a normal Category model implemented with acts_as_tree (name, parent_id) that has_many :products (name, category_id). What I''m asking for is a method to fetch every product that belongs fall into a particular category and its children, eg: if I''m asking for a root node (/category/show/1) I need to display every product that have category_id = 1 AND every product