search for: find_opts

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

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)
...urces_controller.rb index 9d1074a..87f07f5 100644 --- a/src/app/controllers/resources_controller.rb +++ b/src/app/controllers/resources_controller.rb @@ -63,7 +63,9 @@ class ResourcesController < PoolController def vms_json svc_show(params[:id]) - super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) + super(:full_items => @pool.vms, + :find_opts => {:select => Vm.calc_uptime}, + :include_pool => :true) end def delete diff --git a/src/app/controllers/smart_pools_controller.rb b/src/app/controllers/smart_pools_controll...
2009 Jul 02
1
[PATCH server] UI for accumulated uptime for VMs. (revised)
...urces_controller.rb index 9d1074a..87f07f5 100644 --- a/src/app/controllers/resources_controller.rb +++ b/src/app/controllers/resources_controller.rb @@ -63,7 +63,9 @@ class ResourcesController < PoolController def vms_json svc_show(params[:id]) - super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) + super(:full_items => @pool.vms, + :find_opts => {:select => Vm.calc_uptime}, + :include_pool => :true) end def delete diff --git a/src/app/controllers/smart_pools_controller.rb b/src/app/controllers/smart_pools_controll...
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)
...urces_controller.rb index 9d1074a..87f07f5 100644 --- a/src/app/controllers/resources_controller.rb +++ b/src/app/controllers/resources_controller.rb @@ -63,7 +63,9 @@ class ResourcesController < PoolController def vms_json svc_show(params[:id]) - super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) + super(:full_items => @pool.vms, + :find_opts => {:select => Vm.calc_uptime}, + :include_pool => :true) end def delete diff --git a/src/app/controllers/smart_pools_controller.rb b/src/app/controllers/smart_pools_controll...
2009 Jun 29
3
[PATCH server] UI for accumulated uptime for VMs.
...rces_controller.rb index 9d1074a..7188db8 100644 --- a/src/app/controllers/resources_controller.rb +++ b/src/app/controllers/resources_controller.rb @@ -63,7 +63,12 @@ class ResourcesController < PoolController def vms_json svc_show(params[:id]) - super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) + super(:full_items => @pool.vms, :find_opts => {:select => "*, case + when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(tot...
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.
This option was removed from qemu for no apparent reason except to break existing consumers. It does the same as -no-user-config, added in May 2012, so use that instead. --- builder/test-console.sh | 2 +- common/qemuopts/qemuopts-tests.c | 6 +++--- common/qemuopts/qemuopts.c | 2 +- contrib/p2v/build-p2v-iso.sh | 2 +-
2009 May 22
1
[PATCH server] fixed smart pool 'save' regression.
...ces_controller.rb b/src/app/controllers/resources_controller.rb index efd3cb6..9d1074a 100644 --- a/src/app/controllers/resources_controller.rb +++ b/src/app/controllers/resources_controller.rb @@ -66,12 +66,6 @@ class ResourcesController < PoolController super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) end - def additional_create_params - {:parent_id => (params[:hardware_pool] ? - params[:hardware_pool][:parent_id] : - params[:parent_id])} - end - def delete vm_pool_ids = params[:vm_pool_ids].split(&qu...