Displaying 20 results from an estimated 20000 matches similar to: "find(:all, :conditions => ['loja_id in (?)', Arrau]"
2003 Jun 05
0
deleting of files in samba ???
Dear Sirs,
we're having some inconviniences on files used in a private system,
developed to "suit" the company.
this system's files are located in /var/wsystems and permissions are
granted 4777 acordingly to all files.
When we start up and work in this system with ONE user alone, we have no
problems whatsoever... however when we start up the whole intranet in
this system, most
2003 Jun 05
0
deleting of files by samba ???
Dear Sirs,
we're having some inconviniences on files used in a private system,
developed to "suit" the company.
this system's files are located in /var/wsystems and permissions are
granted 4777 acordingly to all files.
When we start up and work in this system with ONE user alone, we have no
problems whatsoever... however when we start up the whole intranet in
this system, most
2006 Feb 08
2
compound conditions in find
can''t seem to find the right syntax for this...
/script/../config/../app/controllers/placements_controller.rb:155:
syntax error
:conditions => [["placements.client_id = ?",
params[:client_id] ] and "placements.discharge_date IS NOT NULL" ],
this part works...
:conditions => ["placements.client_id = ?", params[:client_id] ]
this is what I
2005 Nov 22
11
Building a conditions clause (for find) of multiple optional params?
I want to be able to find items according to various params - category_id, member_id, type_id,
rating, etc. What I have now is something like:
if(@params[''category_id''])
@items=Item.find(:all, :conditions=>["category_id=?", @params[''category_id''])
elsif(@params[''category_id''] and @params[''member_id''])
2006 Feb 19
8
building multiple find conditions
I am trying to allow for AND type ''find'' but to allow for simply a
single set of find criteria.
controller code...
@vw_string = @vw_string1 = @vw_string2 = @vw_string3 = []
if params[:beg_intake_date] != "" then
@vw_string1 = ["intake_date between ? and ?",
params[:beg_intake_date], params[:end_intake_date] ]
end
if
2006 Feb 10
4
How to do a find with conditions that contain an OR
Hi, I''m trying to do a find with a condition that has an OR on the same
column. Say I only want to use find() but not find_by_sql(). I reduced
my problems into the following:
values = []
... # filling up values from params
Order.find(:all,
:conditions => ["(action = ? OR action = ?) AND price = ?",
values]
For example I
2009 Oct 26
1
model.find(:id) and model.find(:all) giving different result
I have the following code that works very well
@manufacturer = Manufacturer.find_manufacturer(params[:id])
which produces the following SQL:
SELECT * FROM `manufacturers` WHERE (`manufacturers`.`id` = 4) #Here
params[:id] =4
ON my view I can access the fields using
@manufacturer.field_name
However when I do the following
@manufacturer = Manufacturer.find(:all, :conditions => {:id =>
2003 Dec 20
0
Fw: Re: CAMPANHA NATAL SEM BAIXARIA - PARTICIPE!
----- Mensagem Original -----=20
Eu boicotaria estas empresas s=F3 pelo fato de financiarem os enjoativos e =
rancentos Cassetas, mas me surpreendi ao descobrir que tantos produtos que =
eu costumo comprar s=E3o transg=EAnicos. Fui conferir no site do greenpeace=
e =E9 verdade!!!!!!!!!!!!!
Boicote neles!
----- Original Message -----=20
C A M P A N H A=20
N A T A L S E M B A I X A R I A
2007 Feb 16
1
find conditions in more_like_this
Hello.
I''m trying to use acts_as_ferret to index with set conditions.
Ideally I could do something like:
acts_as_ferret :fields => [ :title, :body ],
:conditions => ["enabled = 1"]
But would settle for being able to do:
@similiar_blogs = @blog.more_like_this :field_names => [ :title, :body
], :conditions => "enabled=1"
What is the
2005 Dec 26
0
Extend the find-method: more conditions
Hi,
I want to share some helpful code snippet. Can it further be optimized?
Or is this even good to do?
Put this in your model to write a customized find method having more
conditions:
def self.find_active(*args)
options = extract_options_from_args!(args)
conditions = "AND (#{sanitize_sql(options[:conditions])})" if
options[:conditions]
options[:conditions] =
2006 Dec 06
0
.find conditions when multiple objects returned
OK, still learning here... here''s a rough sketch of my model...
User
has_and_belongs_to_many :customers
Customer
has_and_belongs_to_many :users
has_many :widgets
Widgets
belongs_to customer
Each user can be associated with one or more customers
Each customer has multiple users
Each widget is associated with a customer
I’ve seen tons of examples like this:
If I want to do something like
2008 Nov 05
1
ambiguous nested conditions on find
Hi, i''m trying to figure out how to do a query with an ambiguous
condition
Lets say Comment belongs_to :article and :user,
and Article :belongs_to :user
How can I find the comments by one user on articles by another user
in one query?
This doesnt work, but is kind of the idea:
Comment.find :all, :conditions => {''users.name'' =>
2006 Dec 18
2
Find, paginate, conditions and associations
Hi, I''m trying to figure out how to use paginate when one of the
conditions depends on the association between one model and another.
For example: I have a model Authors which has_many Posts. I would like
to find all the authors and order them by the number of posts that they
have published and then paginate those results.
What if I wanted to base the paginate condition on all the
2005 Jun 30
2
Find by ID plus conditions -> ActiveRecord::RecordNotFound
Hi
I''m trying to understand the AR find facilities, described here:
http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M000650
I have a list of ids that I want to retrieve, but have a condition that
should restrict the list returned:
return self.find(
noteids,
:conditions => [ "(private = 0 OR (private = 1 AND user_id = ?))", userid]
)
According to the
2006 Feb 14
6
[newb] Find vs Find :all question
I''m playing out with writing an online store.
So far it has accounts, addressbooks, and orders, and those 3 are tied
together with an customer ID. I also have orderDetails, which are
associated to the order via an order number. See models below...
When I do the following I can access the orderDetails information just
fine:
@order = Order.find(params[:id]) # i pass it a customer
2008 Feb 12
0
will_paginate with conditions
Hi, I''ve just switched to will_paginate, which is impressive and easy to
use!
I have a question regarding conditions:
I build a query using values from the params that were entered onto a
web form using something like
:conditions => [" foo like x and bar like y", params[:x]+"%",
params[:y]+"%"]
It would appear that the conditions need to be respecified
2006 Aug 19
3
Special ruby language for describing sql conditions
I was brainstorming today about a smooth way to define conditions in an
sql query, when the numbers of attributes increase, so does the uglyness.
So instead of passing a hash, I thought you could specify the conditions
directly in code.
I hacked together some example code which actually turned out to work.
The result is concise and pretty beutiful.
def search(params)
Ad.find(:all) do
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] ==
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone,
I have this code:
@person_pages, @people = paginate :person, :per_page => 20,
:conditions => [ "username LIKE ? OR first_name LIKE ? OR
last_name LIKE ? OR preferred_name LIKE ?",
"%" + params[:q].downcase + "%",
"%" + params[:q].downcase + "%",
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