search for: find_item

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

Did you mean: find_items
2007 Oct 26
3
Specing with Subdomains as Account Keys
...Everything is done within the context of the @current_company. After reading about Demeter''s Revenge (http://www.lukeredpath.co.uk/ 2007/10/18/demeters-revenge), and reading Sinclair''s advice (link above), I refactored @current_company.items.find(:all) to @current_company.find_items. Still no luck. The spec fails with: -- Mock ''Company'' expected :find_items with (:all) once, but received it 0 times The other thing that bugs me is the size of the setup method. It''s getting too long and starting to smell. Obviously I must be making this harder...
2007 Apr 03
0
[942] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Implement find_string method cognate with ControlWithItems
...;> insert_item(get_item_count, str) </span><span class="cx"> end </span><ins>+ + # Emulate the ControlWithItems find_string method. + def find_string(str, case_sensitive = false) + if case_sensitive + find_string_sensitively(str) + else + find_item(-1, str) + end + end + + private + # Implement a case-sensitive search for ListCtrl (default find_item + # with string is always case-insensitive) + def find_string_sensitively(str) + start = -1 + until found = find_item(start, str) and get_item_text(found) == str + start = found...
2006 Aug 05
5
RESTful Nesting issue
I?m having a strange issue with nested routes though, and was wondering if anyone could shed some light on this? If I have: map.resources :users do |users| users.resources :items end When I try to call <%= link_to_remote ''Delete'', :url => item_url(@item), :with => "''_method=delete''", :confirm => ''Are you sure?''
2007 Apr 03
0
[944] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Fix bug with endless recursion on not-found items in find_string
...string_sensitively(str) </span><span class="lines">@@ -29,6 +30,7 @@ </span><span class="cx"> def find_string_sensitively(str) </span><span class="cx"> start = -1 </span><span class="cx"> until found = find_item(start, str) and get_item_text(found) == str </span><ins>+ break if found == -1 # Not found at all </ins><span class="cx"> start = found + 1 </span><span class="cx"> end </span><span class="cx"> return f...
2006 Mar 03
7
Meta Programming Help
I have the following two methods: def ProductFile::find_images(mode, prod_id) # convert to symbol in case it is not (most commonly it may be a String) mode = mode.to_sym case mode when :all, :first ProductFile::find(mode, :conditions => ["product_id = ? AND file_type LIKE ?", prod_id, "image%"]) end end def ProductFile::find_documents(mode,
2009 Jan 05
8
How to use evt_update_ui wrt RichTextCtrl ?
Hi, I''m trying to create a very simple RichTextCtrl sample based on the C++ version. This works pretty well now with the fixes for missing RichTextCtrl.selection_bold? ... methods. See the attached script. Given the formatting buttons (bold, italics, underlined), I can type text with the proper formatting, select some text and apply a formatting later ... The problem I have is I
2009 Jan 05
8
How to use evt_update_ui wrt RichTextCtrl ?
Hi, I''m trying to create a very simple RichTextCtrl sample based on the C++ version. This works pretty well now with the fixes for missing RichTextCtrl.selection_bold? ... methods. See the attached script. Given the formatting buttons (bold, italics, underlined), I can type text with the proper formatting, select some text and apply a formatting later ... The problem I have is I