Displaying 20 results from an estimated 5000 matches similar to: "Default Date storage 0000-00-00?"
2006 Nov 17
4
set empty values as null in the database
Le''s say that I have a table called people and the column middle_name is
nullable. If the user enters say blank or empty space then in the database
it is recorded as empty space. I would like in all my models all empty
spaces to be recorded as null.
I guess I can write a plugin which will do so for all the models but I''m
sure something like that should already be existing.I
2006 Jan 30
9
Something as after_successful_validation?
I need to call callback only if the validation was successful, but it
seems it is called also when validation fails.
--
Posted via http://www.ruby-forum.com/.
2007 Apr 04
4
Order a find using a has_many association
I''m trying to order a find through a has_many association. I have a
model called SalesOrder. Each sales order has things like amount,
description, etc. I use the following to get the Sales Orders:
@sales_orders = SalesOrder.find(:all)
And I display them with:
<td><%= link_to sales_order.id.to_s, :action => ''show'', :id =>
sales_order.id
2008 May 24
8
[LLVMdev] Advice on CFG pre-analysis
In the language I am working on, there are cases where the call flow
graph can affect the type of a variable. A simple example is a
"nullable" type (a pointer which is allowed to be NULL), which can be
converted into a non-nullable type via an if-test. So for example if x
is nullable, and I test x != NULL, then inside the conditional block the
type of x is no longer nullable.
2008 May 28
0
[LLVMdev] Advice on CFG pre-analysis
On May 23, 2008, at 11:53 PM, Talin wrote:
> In the language I am working on, there are cases where the call flow
> graph can affect the type of a variable.
Ok.
> A simple example is a
> "nullable" type (a pointer which is allowed to be NULL), which can be
> converted into a non-nullable type via an if-test. So for example if x
> is nullable, and I test x != NULL,
2006 Sep 27
5
Question about has_one
I have a question about regarding the use of ''has_one'' in this scenario:
Schema:
User
----
id
first_name
last_name
UserMessage
----
user_id
message_id
Message
----
id
Assuming business rules dictate that a Message can have at most ONE User
(let''s assume a message can be created without a user associated to it),
these are my questions:
1) How would I use has_one
2006 Feb 07
5
OCI adapter slowdown on dictionary access
Hi,
after some experience with Rails on MySQL databases I gave it a try on one
of our larger Oracle database.
I was facing a problem when Rails tried to detect the columns for a
model/table. The appropriate statement ran about 1 min which led to a
timeout.
Our Oracle guru told me to analyze the SYSTEM schema. After that hadn''t
helped, he said the only remaining chance is to use a
2006 Jan 11
8
Oracle and Rails seems really slow.... In development
I''m just looking into how to connect to Oracle using Rails. I''ve got
everything connecting and working as it should.
I have a Users table in Oracle:
create_table "users", :force => true do |t|
t.column "username", :string
t.column "created_on", :datetime
t.column "email", :string
t.column "note", :text
2006 Jan 30
9
error when adding a new table to the existing application
Deniz wrote:
> Hi Everybody,
> I am a newbie in this list so please forgive me if this is a lengthy
> message.
> Currently I am working on a project at my work place that includes
> viewing some oracle tables(I do not have control over to rewrite the
> tables) and searching the tables based on a given criteria with Rails.
> Up untill now everything was working great. The
2007 Mar 22
2
Inconsistent Invalid Argument Error
I have a view with a table that contains sortable links as headings.
Here is the code used to create these sortable links in the
application_helper:
module ApplicationHelper
def sort_link_helper(text, param)
key = param
key += "_reverse" if @params[:sort] == param
link_to(text, :controller => ''sales_orders'', :action => ''list'',
2008 May 24
0
[LLVMdev] Advice on CFG pre-analysis
On May 24, 2008, at 02:53, Talin wrote:
> In the language I am working on, there are cases where the call flow
> graph can affect the type of a variable. A simple example is a
> "nullable" type (a pointer which is allowed to be NULL), which can
> be converted into a non-nullable type via an if-test. So for example
> if x is nullable, and I test x != NULL, then
2012 Nov 10
6
Suggestion: `before_save on: :create` should either work or raise an exception
There''s a small inconsistency in ActiveRecord''s callback syntax that has
tripped me up before. It wouldn''t be a big deal, but it can lead to a
silent failure. I''d like to suggest that it either be made consistent or be
made to fail loudly.
The issue is that to do something before validating, but only when
creating, you use `before_validation on: :create`,
2003 Feb 11
1
Samba & Delphi & Paradox
Hello,
I have a server samba/linux executing a software Delphi with access to
database Paradox. The configurations are OK, but when more than an user is
accessing the system, he is very slow.
How can I solve this problem?
Regard?s
F?bio Ferreira
fabio@datafusion.com.br
2006 Mar 05
6
Which postgresql adapter to use for rails core? How about production?
I wanted to fix some things up in the trunk, so I set up the databases
and ran the unit tests. A bunch fail for postgres, and even more
error out. I know of two postgresql adapters: postgres-pr and
ruby-postgres. Strangely, they each fail different tests. So if I
want to fix things up, which one should I be using? For that matter,
which adapter should I be using for production? Finding out
2006 Mar 31
2
Model inheritance is borken in Rails1.1
following is model code in file order_payment.rb
class OrderPayment < ActiveRecord::Base
belongs_to :order
validates_presence_of :amount, :no
end
class LC < OrderPayment
end
class LC30 < LC
end
class LC60 < LC
end
class LC90 < LC
end
class LC120 < LC
end
class TT < OrderPayment
end
class CAD < OrderPayment
end
and following is error i''m getting with
2006 Jul 28
4
ajax scaffold
someone using ajax scaffold ??
I''m using
@scaffold_columns = [
AjaxScaffold::ScaffoldColumn.new(self, { :name => "name" })
]
in my model...
I have a column named "name", but it''s not working, When I click in
"Create New" ajax indicator starts but not occurs . . .
someone can help me? tks
1997 Jul 23
1
Paradox
Anyone on the list using a Paradox database on a Samba server?
I'm after any performance tweaks which might speed up
accessing data in a particular application (Q-Pulse, just in case
anyone's heard of it).
Any smb.conf tweaks in general which have made a proven speed
improvement would be welcomed.
TIA
Jon.
2009 Feb 07
5
before_save :strip_whitespace => saves with spaces
i used this private function for removing leading and trailing white
spaces from the values.that below function would be called before_save.
when i print the value after it strips.it prints string without any
spaces.but in the table fields it saves with spaces .
waht would be the problem.pls help me
class CompanyInfo < ActiveRecord::Base
before_save :strip_whitespace
def strip_whitespace
2009 Jun 05
3
Boot problem: gave up waiting for root device or kernel panic
Hi
I have a problem booting dom0 on Xen 3.1 under 2.6.18 kernel. At system
start I obtain the next message:
gave up waiting for root device. common problems:
boot args (cat /proc/cmdline)
check rootdelay= (did the system wait long enough?)
check root= (did the system wait for the righ device?)
missing modules (cat /proc/modules: ls /dev)
/dev/sd* are not present in /dev dir and
2008 Jun 29
3
Working around/with Restful Authentication
I''m using Restful Authentication, and the code to create a user is
pretty straight forward - there is a before_save action and a
before_create action:
before_save :encrypt_password
before_create :make_activation_code
But for some reason when I try to create a user programmatically in
the controller like this:
User.new(:email =>