search for: delete_at

Displaying 7 results from an estimated 7 matches for "delete_at".

Did you mean: deleted_at
2007 May 28
2
Rails, respond_to? over anonymous module (extend has_many).
...lt;< (*assets) assets.flatten.each do |asset| item = proxy_owner.playlist_items.build(:asset => asset) item.save unless proxy_owner.new_record? proxy_owner.duration += asset.duration end proxy_owner.save unless proxy_owner.new_record? end def delete_at (position) pli = proxy_owner.playlist_items.find_by_position(position) rescue nil unless pli.nil? duration = pli.asset.duration proxy_owner.playlist_items.delete(pli) proxy_owner.update_attributes( :duration => (proxy_owner.duration - duration) ) end...
2006 May 26
4
shouldn''t this work? - session[:array_of_objects].delete_if {|x| x.id == params[:id]}
...e courses) in the session as session[:course_list]. This is the cart for a registration controller. If a student chooses to delete the course from the list I get the :id as params[:id]. However if I do session[:course_list].delete_if {|x| x.id ==params[:id]} does not work. session[:course_list].delete_at(idx) works. Ocourse to do this I have to index the list in the view and insert the value into each link_to. When I try this in irb the second statement works but the first does not and does not give any error messages. What am I missing here? I have stared at this long enough and can''t f...
2006 Nov 04
0
arrayfields-3.6.0
...a hash for for each tuple when # we already have Arrays? fields = %w(ssn name position) table.each{|tuple| tuple.fields = fields} tuples[34578][''ssn''] #=> 574865032 LIST OF OVERRIDDEN METHODS: - Array#[] - Array#[]= - Array#at - Array#delete_at - Array#fill - Array#values_at - Array#indices - Array#indexes - Array#slice - Array#slice! LIST OF NEW Array METHODS: - Array#fields= - Array#each_with_field DOCS/USAGE/SAMPLE: - lib/arrayfields.rb - test/arrayfields.rb AUTHOR: ara.t.howard@noaa.gov HISTORY:...
2006 Jan 08
3
Family Connection 1.1.2
== What is Family Connection? == Family Connection is an easy-to-setup online hub for your family that includes a Family News section with Photos, and an Address Book. For more information, visit http://familyconnect.rubyforge.org/ == Downloads == Latest: svn checkout svn://rubyforge.org/var/svn/familyconnect/trunk Version 1.1.2: svn checkout
2008 Oct 29
0
RJS problem after upgrading to Rails 2.0.2
...t leaving page.alert "test". Nothing happens and I have no idea why. Can someone point me in the right direction? sale_controller.rb def auto_remove_contract @contract_lines = [] @contract_lines = session[:contract_lines] unless session[:contract_lines].nil? @contract_lines.delete_at(params[:contract_index].to_i) session[:contract_lines] = @contract_lines calculate_totals respond_to do |format| format.js end end def price_override if request.post? @type = params[:type] @price = params[:price] @index = params[:index] unless...
2007 Jan 08
2
Two problems with Acts_as_paranoid
Hi, I''ve run into two small problems with acts_as_paranoid and wondered if anyone else has experienced them as well (and if yes, if they have any solutions). 1. When using has_many :through, AAP doesn''t seem to take into account the fact that your join model might also be paranoid. My solution to this at the moment is to add an explicit conditions clause to the has_many
2008 May 20
7
Problems sending large results with backgroundrb
I''m working on an application that does extensive database searching. These searches can take a long time, so we have been working on moving the searches to a backgroundrb worker task so we can provide a sexy AJAX progress bar, and populate the search results as they are available. All of this seems to work fine until the size of the search results gets sufficiently large, when we start