Displaying 20 results from an estimated 8000 matches similar to: "How specify size of string column in a migration"
2008 Aug 28
2
1 or true in TINYINT(1) column?
Hello, there is a table that has a column TINYINT(1) called status.
Through mysql console I see its value as 1 (when is true) but if I do
this in Rails console:
Mytable.status
=> true
give me "true" rather "1".
How could I change 1 to true using some method?
Or true to 1?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2008 Feb 26
5
Rails 2.0.2 MySQL 'year' datatype missing from ActiveRecord?
Hi all,
This is my first post to the forum, and I''ll point out right away that
I''m a noob to everything, Ruby, Rails, MySQL, etc., so I expect that I''m
wrong here, but is the ''year'' datatype missing from ActiveRecord in
2.0.2? According to my MySQL 5.0 reference manual, ''year'' is a datatype,
but when I try to run a migration that has
2008 Nov 17
7
super global dummy method for gettext + rails 2.2
Hi,
since rails 2.2 doesn''t work with gettext anymore I decided to use a
gettext dummy method until the gettext team relases a working version
for rails 2.2. My application doesn''t need any i18n support right now
and this way i figured it would be very easy to integrate gettext
later. Just setup the plugin and go.
So I need a method called _ which is available in alle models,
2006 Apr 30
4
Migration, BigInts, and string lengths
Howdy Y''all,
I was thrilled to recently discover migrations, as that framework
addresses a common problem in an elegant way. I have, however, gotten
tripped up a bit as I''ve worked with them.
The first problem I encountered was that, though I was using a BigInt
data type in a field in my dev database, my unit tests were failing
because when I copied the schema from the dev
2009 Jan 09
2
Confused about to_xml() in ActiveRecord::Base subclass
Since all my efforts to control how to_xml() is formatting dates has
failed, I''m now considering writing my own to_xml(). However, from
the limited examples I''ve found, I just don''t understand how to
actually reference the columns for the records in my record set.
Here''s a simplified view of my ActiveRecord object:
class Errors < ActiveRecord::Base
2009 Nov 11
4
Schema dump does not reflect column size limit
Hi,
Everything is in the title.
With Rails 2.3.4 and MySQL 5.0.41:
If have a table like this:
+----------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL |
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails!
How do I change the behaviour of one method in
ActiveRecord::ConnectionAdapters::SchemaStatements ?
Full story:
I''d like to mangle
ActiveRecord::ConnectionAdapters::SchemaStatements
so when it creates a new sql table, it also (optionally) creates my
created_at, deleted, key_id, session_id etc columns that I use on basically
all tables.
It would not be DRY to repeat
2007 Oct 19
14
Agile Web Development Book, need a bit of help
I''m working my way through the book Agile Web Development with Rails,
and I am in the section where the book has me creating a display_cart
method and the associated view. When I copied the code from the book
into the view, it threw this error. If anyone could give me some hints
where I should be looking I''d appreciate it.
NoMethodError in Store#display_cart
Showing
2009 Oct 13
3
Site map
Hi All...
I am using generate_sitemap plugin to generate sitemap. It goes very
well and creates sitemap as well. My problem is I want some links that
are coming from vender/plugins. Can any one tell me how to get those
links???
Thanks all...
--
Posted via http://www.ruby-forum.com/.
2010 Jan 31
6
Action path - syntax error, unexpected tIDENTIFIER, expecting ')'
I have a user controller with login as action.
When I access the index.html.erb file via application.layout file. I get a
error on the login link on the index.html.erb page. I think I am having
dfifficulty in setting up path to an action or even understanding how to set
REST path properly. Can someone please help me.
Here is the error on the home page:
2009 Sep 28
5
Multi-databases support
Hi,
While I was hacking ovirt-server, I have found that it's currently
restricted to Postgres DB. Even if I like postgres for serious work on a
server, I really prefer to hack/dev locally on a Sqlite or MySQL DB.
I have googled on rails in order to find a good answer for the "foreign
key problem" which forces OVirt to stay on pg. I have found a plugin on
this particular
2008 Mar 06
4
Active Record Question
Hi-
Say I am returning some collection of DateTime items and I only want
to compare the month. Is there a way to do this directly in the find?
Something like this...
@coll = Collection.find(:all, :conditions => ["date.month
= ?",Time.now.lat_month])
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
2008 Aug 26
5
undefined method
I''m trying to pass a method to another object/method as a variable.
Example one, login 1 works just fine.
def login1
@driver.Login(username, password)
end
However, if I try to pass "Login" to the driver as an argument
(example two Login 2), I get "undefined method `command_string'' for
#<SOAP::RPC::Driver:0x316dc28>"
"Login" is a legit
2009 Jun 07
6
Missing Template when testing with the Brain Buster Captcha partial
When I run my functional tests, they throw an error with the following
message:
ActionView::TemplateError: Missing template /_captcha.erb in view path
app/views:test/vendor/plugins/brain_buster/views/brain_busters
On line #23 of app/views/contacts/_form.html.erb
20: <%= f.label :message %><br />
21: <%= f.text_area :message %>
22:
2007 Feb 27
14
Stop browser from "form filling" fields.
Hi all,
I have a user login form which the browser keeps populating because of
its form fill feature. So when anyone goes to log in it shows the
previous login''s username and password. How can I stop the browser
from populating a text field?
Thanks in advance.
Cheers,
Diego
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to
2007 Apr 19
2
invalid geometry string in change_geometry
I get the following error at the browser:
ArgumentError in ImagesController#upload
invalid geometry string `110×''
... for the call to change_geometry with an explicit size (''110x'') as
the geometry string:
def make_thumb (the_img)
require ''RMagick''
size = "110x"
debugger if ENV[''RAILS_ENV''] ==
2007 Nov 12
7
schema_info always wants to be 3, even when set to 7
Hi all,
I''m having a very odd problem with db:migrate. I''m using Rails 1.2.5
on Windows XP SP2 and Ruby 1.8.6
I have seven migrations. If I run them with an empty database, it
runs the first three, then halts. When I look in schema_info, the
version is 3.
If I run db:migrate VERSION=7, then it runs through the remaining 4
migrations, and the version is 7 in the DB.
2009 Jan 28
2
open_uri failure on good uri.
I am trying to open a URI using doc = Nokogiri::HTML(open(url)). I get
the following error:
URI::InvalidURIError: bad URI(is not URI?):
http://www.mauipropertytax.com/Datalets.asp?mnu=PSearch&submnu=Profile&pin=390350950000&tp=2&cp=1&State=1|1|*&item=1
from /usr/local/ruby/lib/ruby/1.8/uri/common.rb:436:in `split''
from
2006 Feb 26
1
Migrations: column option "offset"?
Hi,
On the wiki
http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations it says:
Valid column options are:
- limit
- offset
- null (i.e. ? :null => false? implies NOT NULL)
- default (to specify default values)
I was wondering what the purpose of the "offset" option is. And after
looking at the API at
2008 Mar 07
3
timestamp help
I am trying to figure out if a time stamp in my database is older then
a month so that way my controller will only collect the one''s that are
newer. So far I have
@notes = @customer.notes.find(:all, :conditions => {:level =>
[''notice'', ''warning'', ''error'']}, :order => ''created_at DESC'')
But I do not want it