Displaying 20 results from an estimated 100 matches similar to: "Find_all_by and find(:all) to only select certain values for a selection box"
2008 Mar 04
6
find_all_by deprecated?
Is find_all_by deprecated and/or find_first_by for 2.0.2? If not,
what is actually deprecated? just find_all(..) and find_first()?
Thanks for clearing this up.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2003 Sep 17
2
Very long console input lines
Hallo all,
I got a problem executing R in batch-mode via a perl-script (under Win2000) :
system ("Rterm.exe --slave --no-save --no-restore \<Rfile.r \>NUL");
The R execution is aborting with syntax error due to very-long lines.
My solution is converting
a <- c("very long string")
to
a <- paste("short string 1",\n
"short string
2006 Jun 06
3
Invoice and invoice_lines
Hello People,
I have a possibly very lame question.
I am fairly new to RoR, and I want to make sure I do it "right".
I have a model called Invoice, and one called InvoiceLines. Usual story:
the table "invoice" has a 1:n relationship with "invoice_lines", which
includes invoice_id.
Now... the application will have a "new order" button, which will allow
2005 Apr 20
7
find_all_by and :order
I think I must be missing something obvious...
I have...
class OrderController < ApplicationController
model :order
scaffold :order
def list
@orders = Order.find_all_by_status(@params[:status], :order => "date" )
end
end
class Order < ActiveRecord::Base
belongs_to :customer
end
and i''m getting...
/Unknown column ''orderdate'' in
2005 Dec 16
4
Adding extra value to an object
Hello friends ,
I have a clear method here ::
def create
@invoiceitems = Invoiceitems.new(params[:invoiceitems])
@invoiceitems["invoice_id"] = params[:id]
if @invoiceitems.save
flash[:notice] = ''Invoiceitems was successfully created.''
redirect_to :action => ''new'',:id => params[:id]
else
render :action =>
2006 May 31
1
find by sql
Hi
I have the following code, which makes use of an sql statment to get the
results required.
However this just doesnt seem right for rails, as ive managed to develop
the whole project without using any other pure sql.
Is there a cleaner way of doing this, but gaining the same results.
thanks
scott
#sql to find all invoices
pSql = "SELECT DISTINCT invoices.id,
2005 Dec 16
3
Not able to put into a object variable
hello friends ,
I was trying to select all the invoice items from the table invoiceitems
with a condition.But I am getting a NULL array .Please help me in fixing
this ::
@oldinvoiceitems = Invoiceitems.find(:all, :conditions =>
[''invoice_id = :invoiceid'', { :invoiceid => ''params[:id]'' } ] )
Thanx and regards,
Naroor Rathish,
2017 Oct 21
2
[X86] How to query for Opcode type?
Hi,
I would like to query the X86InstrInfo tables to determine if a given
opcode is a load or store from stack. I see functions
isFrameLoadOpcode and isFrameStoreOpcode
in lib/Target/X86/X86InstrInfo.cpp that would provide the functionality I
am looking for.
However, these functions are static.
What is the recommended way to perform such queries for a MachineInstr -
short of replicating the
2008 May 25
2
record will absolutely not save! so weird, please help.
I have a weird problem going on. All of sudden, records for a certain
model will not save with #save Please take a look at this:
>> p = Payment.new(:payment_reason_id => 1, :payment_method_id => 1, :date => Date.today, :amount => ''5.00'', :payable => Student.find(608))
=> #<Payment id: nil, school_id: nil, payment_reason_id: 1,
payment_method_id: 1,
2006 Jul 05
2
get value from array.
hi,
Im running the following sql statment which returns 1 result.
pSql = "SELECT sum(amount)
FROM payments
WHERE expected_pay_date LIKE ''"+pWholeDate+"%''
AND invoice_id IS null "
aResult = Payment.find_by_sql(pSql)
how can I get the result of this?
(when doing @aResult.inspect it
2005 Dec 16
2
Is this possible?
Hello Friends,
def new
@invoiceitems = Invoiceitems.new
@oldinvoiceitems = Invoiceitems.find(:all, :conditions
=>[''invoice_id = :invoiceid'', { :invoiceid => params[:id] } ]
end
Error is being shown in the line number with ''end''.
This is for initialising a new invoiceItems object and also finding and
storing all the invoice items for a
2016 Jul 20
8
?barracuda? listing in logwatch session 123 of user root.
My nightly logwatch report had a never before seen
section last night, "barracuda spam firewall".
I have not problem with the emails it noted as
being rejected. But I've always thought of "barracuda"
as a commercial product.
I have neither configured nor enabled any barracuda
software and "yum list '*barrac*'" comes up empty.
What is this?
Jon
--
Jon
2023 Apr 03
0
sftp and utmp
On 30.03.23 22:43, Fran?ois Ouellet wrote:
> We need to limit concurrent sftp logins to one per user (because of bad
> client behaviour). Is there any way to achieve this I have overlooked?
What authentication method(s) do your users use?
On our Internet-facing SFTP server, by default (few exceptions), we
accept only pubkey auth and require users to (un)install pubkeys through
us. In
2004 Aug 23
0
incorrect behavior: hide unreadable option in conjunction with user ACLs
Hi guys,
we are using samba 3.0.4 as domain member server (security=ADS) in our
Active Directory Domain. In order not to compromise social peace, we use
POSIX ACLs in conjunction with the hide unreadable option to hide
folders/files from users.
I'll show you an example to explain the problem:
I'm the user "SCHARRNET+M006U122" (SCHARRNET=domain suffix). I'm
connecting to
2008 Jun 14
0
does BackgrounDRB not "know" the rails environment it is running within/in parallel with?]
Hi,
it probably is a noob question but I''m confused by this error message:
active_support/dependencies.rb:478:in `const_missing'': uninitialized
constant Invoice::ApplicationController
Situation:
I have an InvoicesController with a create method that in turn calls
upon a MiddleMan.worker(:billing_worker), which in turn finds an Invoice
and calls upon @invoice.print_invoice
2015 Oct 22
0
Using postscreen_dnsbl_reply_map
Hai Alex,
I use the same as in the link you posted.
http://rob0.nodns4.us/postscreen.html
This is used for my bases setup also.
Just put all your servers (rbls) in here and copy the response lines, Like :
/^zen\.spamhaus\.org$/ blocked by rbl, see http://multirbl.valli.org
/^bl\.spameatingmonkey\.net$/ blocked by rbl, see http://multirbl.valli.org
/^b\.barracudacentral\.org$/ blocked by
2012 Oct 18
1
mean value calculation
Dear all,
I want to calculate mean values for multiple rows:
structure(list(Name = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L), .Label = c("AKT", "CKT"), class = "factor"), val1 = c(2,
3, 2, 2, 2, 5, 3, 8, 2), val2. = c(4, 5, 4, 8, 4, 8, 4, 7, 4),
val3 = c(5, 6, 5, 9, 5, 9, 5, 9, 5)), .Names = c("Name",
"val1", "val2.",
2006 Feb 18
14
Composite primary key support in ActiveRecord?
Hi,
As I understand, composite primary keys aren''t supported in
ActiveRecord yet. May I ask if there are plans for this feature?
Better yet, if this feature is under development, how''s the progress
going?
I''m not trying to use legacy databases. I tend to think that using
multiple integer column id''s (composite primary key) are often
natural way to
2006 Dec 08
19
HABTM join table quirk
I''ve been bringing up a good basica framework for applications at work.
To give decent security I''ve been implementing the Rails Recipie for
Authorization of function calls modeled on the book''s implementation.
(Changes for our environment were added..but are minor.)
Since I initially let Rails create the join table between two data
tables with a HABTM relationship....I
2007 Oct 07
22
Differences in execution between console and app
class AppointmentBook < ActiveRecord::Base
has_many :appointments
def lookup(date, look_ahead = 27)
return nil unless block_given?
(date..date + look_ahead).each do |date|
yield(date, appointments.find_all_by_date(date))
end
end
end
The line with yield is throwing the error:
undefined method ''each'' for #<Date: 4908761/2,0,2299161>
A YAML