search for: find_optional

Displaying 20 results from an estimated 29 matches for "find_optional".

2007 Feb 28
5
How to use find_options in multi_search
Hello everyone, I''m using multi-search to search in some attributes of two classes. One of the attributes is the id of the customer. For each multi_search I want to do a give the id of the current customer as a parameter. This should only return results for the given customer. My current code looks like this: Folder.multi_search(@search_query, [Myfile]) I noticed in the API you can
2006 Oct 02
6
Strange Sorting Issues
Hi there, I''m having some strange sorting stuff goign on. Here''s my search method: sort_fields = [] sort_fields << Ferret::Search::SortField.new("name", :reverse => :false) @results = Listing.find_by_contents @search_criteria, :limit => :all, :sort => sort_fields page = (params[:page] ||= 1).to_i items_per_page = 9 offset = (page - 1) *
2007 Jan 15
3
Wrong total_hits when using conditions in find_by_contents
I don''t know if this is a bug, or wanted behavior, but for me it was a pain in... So here''s the problem + a bugfix. Lets say you have a model "Article" with the following fields: title, visible - and these records [code]title, visible ferret talk, 1 ruby talk, 0 ruby on rails, 1 lets talk about ruby, 1[/code] If I let Article act as a ferret, and do: result =
2009 Jul 06
0
[PATCH server] UI for accumulated uptime for VMs. (revised2)
This revised version of the patch incorporates jguiditta's sorting fix as well as some other changes required to make this work fully on the cloud UI side. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 4 +++- src/app/controllers/smart_pools_controller.rb | 7 +++---- src/app/helpers/application_helper.rb | 14
2009 Jul 02
1
[PATCH server] UI for accumulated uptime for VMs. (revised)
This revised version of the patch incorporates jguidditta's sorting fix as well as some other changes required to make this work fully on the cloud UI side. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 4 +++- src/app/controllers/smart_pools_controller.rb | 5 ++--- src/app/helpers/application_helper.rb | 14
2006 Aug 17
1
find_by_contents fails with :include option
find_by_contents will fail if you specify :include in the find_options parameter. The problem is on line 313: 313: conditions = [ "id in (?)", id_array ] 314: # combine our conditions with those given by user, if any 315: if find_options[:conditions] 316: cust_opts = find_options[:conditions].dup 317: conditions.first << " and " << cust_opts.shift 318:
2009 Jul 06
2
[PATCH server] UI for accumulated uptime for VMs. (revised3)
This revised version of the patch incorporates jguiditta's sorting fix as well as some other changes required to make this work fully on the cloud UI side. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 4 +++- src/app/controllers/smart_pools_controller.rb | 7 +++---- src/app/helpers/application_helper.rb | 14
2009 Jun 29
3
[PATCH server] UI for accumulated uptime for VMs.
There's still a problem with this working on the cloud side, but that can be resolved in a subsequent commit. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 7 ++++++- src/app/controllers/smart_pools_controller.rb | 5 ++--- src/app/helpers/application_helper.rb | 14 ++++++++++++++ src/app/models/vm.rb
2006 Aug 25
7
acts_as_ferret with conditions
Hello guys, Having a slight problem with acts_as_ferret, specifically using a condition. I have the following code @results = SupplierProduct.find_by_contents(params [:search], :conditions => [''area_id = ?'', @area]) and it seems the condition isn''t being applied. Does anyone have any pointers? Cheers, Alastair ------ Alastair Moore Standards compliant web
2006 Oct 21
2
find_by_content result set
Hi Guys I''m experiencing with AAF and Ferret with the intention of deploying into the site that I am working on now. So I setup AAF to index 3 fields that I have in this model and i tried doing a find_by_contents and it returned the #<FerretMixin::Acts::ARFerret::SearchResults:0xb74b5bec @total_hits=1157, @results=[#<Payprofile:0xb74cc39c @attributes={"add...... but it
2007 May 02
4
Wrong total_hits when using conditions in find_by_contents
In my model Topic: acts_as_ferret({ :fields => {:username => {:store => :yes, :boost => 30}, :subject => {:store => :yes, :boost => 20}, :body => {:store => :yes, :boost => 10}}, :remote => true }, { :analyzer => Ferret::Analysis::RegExpAnalyzer.new(/./, false) }) def self.full_text_search(q, options = {}, find_options = {}) return nil if q.nil? or
2007 Jul 18
5
Strange search result with conditions in find_by_contents
Hi, guys: Strange search result with conditions in find_by_contents! first of all, i''ve installed the acts_as_ferret to my project vender folder by ''ruby script/plugin install svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret'' in my SearchController def searchforum if !params[:doSearch].nil? if params[:searchTerms].nil? || params[:searchTerms] ==
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around filter. I have defined expectations on the model classes, and ideally, I would add a further expectation for the scope. Is this already possible in some way? How would I go about adding support a scope expectation? Michael -- Michael Schuerig mailto:michael at schuerig.de http://www.schuerig.de/michael/
2006 Jun 02
2
pass extra value through text_field_with_auto_complete?
Hi, I''m wondering if it is possible to pass an extra value (which I will use to further restrict my query) using text_field_with_auto_complete? Any suggestions would be appreciated! -Mike
2006 Aug 01
0
Custom Autocomplete Field - Making a field lowercase
I''m trying to humanize() the results that appear in the autocomplet drop down list. First i customised the controller. In the render line on the controller it is saying "i want to use locality on each of the @items". So locality is what i want to humanize". My ideas so far is to: Customise the PostCode object so that when auto_complete_result trys to call
2007 Dec 13
4
please explain find_with_ferret, retrieve_records, :include and :conditions
Hello, I''m using find_with_ferret to search multiple models and it works great. The trouble is I need to filter the results using :include and :conditions. I get two errors depending on the syntax I use in the search. Reading the source, I see the retrieve_records method seems to filter the :include and :conditions so that they only apply to the relevant model when searching
2007 Sep 28
4
undefined method error
Hi, I''m running the trunk version with drb server. In my ferret_server.log I get a lot of messages like this: #method_missing(:add, ["User", {:first_name=>"blah", :comments=>nil, :company=>"blah", :phone_day=>""}]) Over and over again. But more importantly, since yesterday doing a search has caused an exception: A NoMethodError
2006 Dec 28
13
Sorting/Ordering Search Results
Hello All, I am having an issue with AAF and sorting results of a search. Right now, I have results being split onto pages of 10. The results are being sorted alphabetically, but not across multiple pages - it''s just sorting the 10 it pulls down on each page. I noticed another post from April regarding this same issue (http://www.ruby-forum.com/topic/62993#66934) where the issue was
2018 Nov 30
1
[PATCH] Replace -nodefconfig with -no-user-config.
...lysis/boot-analysis-timeline.c b/utils/boot-analysis/boot-analysis-timeline.c index 3ff031487..4b7da31fa 100644 --- a/utils/boot-analysis/boot-analysis-timeline.c +++ b/utils/boot-analysis/boot-analysis-timeline.c @@ -195,7 +195,7 @@ construct_timeline (void) /* Find where we run qemu. */ FIND_OPTIONAL ("qemu", LONG_ACTIVITY, data->events[j].source == GUESTFS_EVENT_APPLIANCE && - strstr (data->events[j].message, "-nodefconfig"), + strstr (data->events[j].message, "-no-user-config"),...
2009 May 22
1
[PATCH server] fixed smart pool 'save' regression.
The recent refactoring didn't work properly for new smart pools, so I've cleaned jup the parameter handling for the various pool 'create' actions. Signed-off-by: Scott Seago <sseago at redhat.com> --- src/app/controllers/hardware_controller.rb | 5 +---- src/app/controllers/pool_controller.rb | 6 ++++-- src/app/controllers/resources_controller.rb | 6