Displaying 20 results from an estimated 200 matches similar to: "DRY? Converting Boolean to Yes/No"
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 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 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
2010 Sep 02
1
ActiveRecord::ConnectionAdapters::Column value_to_boolean(value) does not return a boolean value.
value_to_boolean(value), does not always return a boolean value, only
when true.
150: def value_to_boolean(value)
151: if value.is_a?(String) && value.blank?
152: nil
153: else
154: TRUE_VALUES.include?(value)
155: end
156: end
If value is contained in TRUE_VALUES then it returns true(TrueClass).
But if value is
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 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
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
2009 Apr 10
4
rails2.3/ruby1.9: invalid byte sequence in utf-8 with blank?
hi all,
anyone seen this controller argument error:
invalid byte sequence in utf-8
ror/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb:
50:in `=~''
ror/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb:
50:in `!~''
ror/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb:
50:in `blank?''
2013 Oct 25
2
[PATCH] support SO_REUSEPORT on new listeners (:reuseport)
This allows users to start an independent instance of unicorn on
a the same port as a running unicorn (as long as both instances
use :reuseport).
ref: https://lwn.net/Articles/542629/
---
lib/unicorn/configurator.rb | 19 +++++++++++++++++++
lib/unicorn/socket_helper.rb | 30 ++++++++++++++++++++++--------
test/unit/test_socket_helper.rb | 8 ++++++++
3 files changed, 49 insertions(+), 8
2012 Oct 03
5
is_virtual selector
I too have been pushed into Puppet 3.0. Clients and PuppetMaster are now
at 3.0.0. Not sure if this is a version change or syntax error that I am
experiencing. We''ll use ''ntp'' as the example and the "build" host is a VM.
The old way:
class baseline::ntpd {
package { "ntp":
ensure => $virtual ? {
physical => present,
2007 Apr 10
15
Wxruby doesn''t work on my Debian sid ( glibc error )
Hi everyone !
i can''t make wxruby work on my debian box, i installed wxruby2preview with
the gem command line tool
but when i try to run one of the samples, i get this error message :
dialogs.rb:1:in `require'': no such file to load -- wxruby (LoadError)
from dialogs.rb:1
i searched this mailing list a bit, i tried with the -rubygem argument, i
get this error :
2006 Sep 15
8
file: target generates error
file { "/var/log/syslog":
target => "/var/log/messages"
}
generates the following error:
err: //henson/stanford/syslog/file=/var/log/syslog: Failed to retrieve
current state: undefined method `should'' for false:FalseClass
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,
2007 Mar 16
2
General segfaulting
I''m having issues with WxRuby segfaulting when it''s dealing with
external data in one form or another.
I can reliably force WxRuby to crash by
a) Parsing a file with Hpricot into an internal array of
objects and assigning that to an instance variable on a Wx::Frame
b) Running my script in Eclipse in "debug" mode and merely
mousing over the
2007 Mar 21
4
Bug in TextCtrl constructor
Howdy,
I''ve uncovered a bug in the constructor for TextCtrl (originally
uncovered while using WxSugar but it appears to apply to WxRuby itself
as well). Here''s the output from irb:
# ------
irb(main):001:0> require ''wx'';
irb(main):002:0* ctl =
2011 Sep 25
2
Noob Rails patcher - problems running the sqlite3 tests...
Hi,
I am following the guide here:
http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html
I have an ubuntu 11.04 VM setup, installed rvm, and ruby (ruby 1.8.7
(2011-06-30 patchlevel 352) [x86_64-linux]).
Pulled down the rails from github and created a 3.0 branch:
$ git branch --track 3-0-stable origin/3-0-stable
$ git checkout 3-0-stable
I can run the non-db tests ok, all pass
2007 Mar 19
3
certificate trouble
Hi Puppet-Team,
first thanks for this great configuration management tool !
My name is Matt and i am on creating a puppet plugin for openQRM.
The basic framework is already existing and working well so far.
Now, after having it working ok once i now ran into a problem that
my puppet-clients do not get their configuration any more from the
puppetmasterd. What i saw on the puppetmasterd logs is :
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
2013 Oct 28
1
inline_template private method `gets' called for false:FalseClass
Hi,
I am new to Ruby ERB and inline_template. Can anyone spot what''s wrong
with this inline_template?
$moddedContent = inline_template("<%= puts gets(nil).gsub(/one
two three/,\"\") /tmp/blah %>")
exec {
"/bin/echo ''${moddedContent}'' > /tmp/blah" :
}
When I try to apply it, I
2008 Jun 24
2
upgrade issues
I tried upgrading my older 1.8.6 Ruby install to the latest stable
1.8.6 release, version 1.8.6-p230 specifically, to benefit from the
latest security updates.
I used this configuration:
./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr
I''m using mod_rails, so after the Ruby install I restarted Apache. I
then found every Rails app on the box was non-functional,