Displaying 20 results from an estimated 200 matches similar to: "ActiveRecord::ConnectionAdapters::Column value_to_boolean(value) does not return a boolean value."
2010 May 28
2
Suggestion for improving value_to_boolean column conversion
Hi fantastic rails core developers.
Speaking of version 2.3.5:
I find it rather error_prone that values such that "some text" is
silently converted to false when stored in a boolean DB field.
Among other things it means that assign "some text" to boolean fields
on a model will not generate any validation messages (it will silently
be converted to false).
I think it is like
2006 Feb 05
0
Enum patch for Rails
Hello!
I''ve modified ActiveRecord a bit to support enum columns. This is tested
only with MySQL, and maybe needs some changes for other adapters (if
they use another syntax or quoting style).
I believe this patch should be tested well, so I haven''t (yet) tried to
post it to the official Trac. It is also not solid-as-a-rock when it
comes to quoting ENUM values.
After
2006 Jul 17
6
DRY? Converting Boolean to Yes/No
I have a database column given as:
t.column :change_address, :boolean
The user interacts with this using a checkbox, but wants confirmations to
read:
Change address: Yes
In an isolated case something like:
@obj.change_address ? ''Yes'' : ''No''
Would work fine but this is peppered throughout scads of forms and boolean
fields. The first step I took at DRYing
2007 Nov 28
0
Where to override ActiveRecord::ConnectionAdapters::SQLServerAdapter?
I''m working on an existing global database running on MS SQL Server.
The appropriate primary key is uniqueidentifier, so I want to set
ActiveRecord::ConnectionAdapters::SQLServerAdapter#native_database_types[:primary_key]
= "uniqueidentifier NOT NULL newid() PRIMARY KEY".
Obviously, I need to override the native_database_types definition,
but I really don''t know where
2006 Jun 24
6
convert 0, "0", "true", etc. to boolean
Hi,
is there a ruby / rails builtin function that converts
- 0 / 1
- "0" / "1"
- "yes" / "no"
- "true" / "false"
to a boolean?
cheers
peter
2008 Dec 20
9
Upgrade to Rails 2 - problem with "save" (MySQL boolean issue?)
I have been working through an upgrade of my 1.2.6 application to
2.2.2.
I am almost there but I have hit a problem with ActiveRecord.
Before the upgrade, the following code was working fine.
def create_root(administrator)
root = create_root_collection(self.pingee_name,
administrator,
2008 Mar 19
2
ActiveRecord bug? ActiveRecord::ConnectionAdapters::Column.type_cast for float columns
Hi all,
I just noticed that in ActiveRecord::ConnectionAdapters::Column.type_cast[1]
(and type_cast_code[2]) the type casting for float columns simply does
value.to_f, whereas all the others have a rescue or call out to a method,
the default implementations of which have rescues or enough logic in that I
don''t think they''d fail.
Imagine the following:
create_table :vehicle do
2005 Mar 04
3
Boolean values
Hi,
I''m using SQL Server. I have a BIT field. I have a fix and a question.
This is a patch for a bug in the SQL Server adapter that causes any insert or
update to fail:
lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -239,2 +239,2 @@
- when TrueClass then (column && column.type == :boolean ?
"''t''" : "1")
2006 Jan 06
6
AWS and array of Model
Hi!
I try to use a layered webservice and I want to get back an array of users;
In the API I use:
api_method :listUsers,:returns=>[[User]]
in the service:
def listUsers
User.find(:all)
end
Result in soap mode:
Don''t know how to cast TrueClass to Object
Result in XML-RPC mode:
You have a nil object when you didn''t expect it!
You might have expected
2008 Mar 14
1
Rails App freezes when accessed
Hi All,
I just had this problem come up today and so far I''m stumped. This
morning, my mongrels were all completely unresponsive. I had to kill
-9 them to get them to go away. I restarted them, but the first time
that they were accessed they froze again. Nothing gets printed to the
logs. I tried starting a single mongrel and accessing it directly.
If I hit CTRL-C before accessing
2008 Jun 06
1
Need help with Decryption using blowfish CBC
Hello all,
Hoping someone can help me out here. I''ve burned almost a week trying
to figure out how to decrypt
an image file that has been encrypted using Blowfish CBC.
I found some code on the net and have modified as follows:
require ''openssl''
require ''digest/sha1''
ivArr = [0x0D,
0x0E,
0x0A,
0x0D,
0x0F,
0x0A,
0x0C,
0x0E
]
2006 Feb 27
8
Change Bit Value To Text When Viewed
Hey All, very simple question for you folks ;)
I have a @commutes object that for each record there is a bit value set
(0/1) to denote if an accident occurred. What I want to do is have it
display "Yes" or "No" when I view the listing of commutes. I can get it to
display the bit value just fine with <%= commute.accident %> but how can I
get it so that when a record with
2006 May 12
11
Stupid? question about if else logic
this seems so stupid, I keep thinking I''ve dealt with this before but I
have this code
<h1>Portraits</h1>
<% if @image.portrait == 1 %>
<%= image_tag(url_for_file_column ''image'', ''file'', ''thumb'') %>
<% else %>
<h1>Landscapes</h1>
<%= image_tag(url_for_file_column
2009 Dec 18
2
Undefined Method error - help request
Good morning All -
I am working on a time tracking application as a learning excercise
and have run into an error neither I nor Google can remedy.
When loading my view, I get an error: ''undefined method
''true_class_path'' for #<ActionView::Base:.........
Context:
I have controllers for Project, Worktrack and ''Workbench'', among
others. Workbench is
2006 Jan 07
0
Bug in rails?
Hi!
The last 2 day''s I tried create WebService which get back ActiveRecord
object, but it''s always get back error. Today I found why.
In Mysql the boolean type is a int(1) alias, but in postgresql the
boolean type is boolean(!).
When in the database table contain boolean type the AWS going to crazy
because it''s can''t recognize it. (It''s say:
2008 Apr 07
0
Haml and View tests
Does Rspec work nicely with Haml for controller integrated view tests?
I am getting the following error:
===================
ActionView::TemplateError in ''Admin::ListingsController index should get
a 200 OK''
undefined method `photo'' for true:TrueClass
On line #2 of admin/listings/_listing.html.haml
1: %tr
2: %td.photo= image_tag(listing.photo.url(:thumb),
2008 Jul 04
1
datatype problem when using ActiveRecord with Oracle
Hey,
I have connected to the oracle db using ActiveRecord and am
trying to retrieve tuples. I have one attribute that has datatype
''number(1)''. I found that ActiveRecord maps this attribute to boolean.
So it gets a class of either FalseClass or TrueClass. I tried to find
the source of the problem and I found oracle_adapter.rb (http://
2008 Feb 20
0
Unicode Support for MS SQL Server
In order to coerce Rails 1.2.x into supporting Unicode values for an
attribute in a model, I found I had to do the following:
1) Change the underlying column type from varchar to nvarchar.
2) Prepend any quoted values going into nvarchar columns with a
capital-letter-N, e. g. ''unicode'' becomes N''unicode'' In order to
accomplish this, I modified
2006 Jul 29
1
Problem starting push server in Jugganaut
Hi All,
Im playing around with Jugganaut but stuck at the first step.
Seems the jugganaut push server requires json (which I have installed)
but it cant find it.
Following the docs, I have installed json and then try to run the push
server.
jonathan $ ruby script/push_server
script/push_server:37:in `require'': no such file to load -- json
(LoadError)
from
2006 Oct 19
3
Selecting datetime values from SQL Server (year < 1970)
All,
Rails 1.1.6.
Any AR find() call that generates a SELECT * type query against a table
with a DATETIME column in SQL Server whose value occurs before 1970 will
fail, because of the coercion of SQL Server datetime types to Time
values in Ruby.
See sqlserver_adapter.rb line 490
(record[col] = record[col].to_time if record[col].is_a? DBI::Timestamp)
If I remove the coercion (just commenting