similar to: Migrations: The same class name form migration and model cause problems

Displaying 20 results from an estimated 30000 matches similar to: "Migrations: The same class name form migration and model cause problems"

2006 Aug 08
2
Problem with plurals, migrations?
Hi, Ruby 1.8.4 Rails 1.1.4 Windows XP Pro I''m hitting an issue with migrations that I suspect relates to pluralization. Here''s the migration: class Hardware < ActiveRecord::Migration def self.up create_table :hardware do |h| h.column :vendor, :string, :limit => 32 h.column :model, :string, :limit => 32 end
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed. CHANGES ------- Revision 8649 committed by gbuesing on 2008-01-16 20:07:10 Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002 M /trunk/activesupport/CHANGELOG M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb M /trunk/activesupport/test/core_ext/date_time_ext_test.rb TEST FAILURES AND
2006 Jan 13
1
How to disconnect to a database????
Hi, We have experienced some problems with ActiveRecord::Base class of Ruby-Rails. We are building a web-application based on the Ruby-rails framework and the web-application needs to access to difference databases, so we do not pre-define our database accesses in the database.yml file. In fact, we are using the ActiveRecord::Base.establish_connection() to connect to our database, the function
2006 Apr 25
0
Migrate default now()
I want to set default value to current time of database: class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| # ... t.column :created_at, :timestamp, :null => false, :default => ''now'' end end #... end On postgresql, it is converted to: created_at timestamp NOT NULL DEFAULT ''2006-04-25
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but for now I''ve hacked my own addition on for just PostgreSQL. The following code extends every Column object returned by MyModel.columns to support a new #required? method, which indicates if the column may or may not be null. The following is a huge hack - suggestions on a cleaner way to add this functionality
2010 Jun 30
0
I have problem ....PostgreSQLAdapter::PGconn
I have a problem when i am creating a rails project using postgresql... uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn I have already installed gem postgres-pr. but not start.. I using rails version 2.3.5 Ruby 1.8.7 PostgresSQL 1.10.2. Please help me thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to
2007 Mar 25
1
Can't use models in migrations
Hi there, This always used to work for me... but not now. I want to blame Rails 1.2 but I''m sure its not. I can''t use AR models in my migrations. To make sure its not just my dodgy code I tried to do the same with a well known plugin.. acts_as_versioned. A migration such as the one below (taken from acts_as_versioned) is giving the error undefined method
2006 Jan 18
1
Helps!!!!! Rails database connection guru needed!!!!!!!
Hi, I really need help to understand what is happening while Rails connect to a database, (we area actually using postgresql, so my example will be with postgresql) What I understand is Rails is able to connect to different DB. Actually, this is what we want, and we have made some tests, everything is juste fine. However, all these tests lead us to some important questions that we did find the
2010 Aug 22
1
rails3: t.index in migrations not working anymore
Hello, I''m playing around with Rails3 and trying to upgrade one of my applications to Rails 3.0.0.rc and I get an error which should be still working. Migration: t.index :name When I execute rake: rake aborted! An error has occurred, all later migrations canceled: undefined method `index'' for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x4b2b6b0> Does some one
2006 Oct 15
3
Migrations - add_column :default=>true, :null=>false
This seems pretty brain dead: add_column :types, :notify_on_create, :boolean, {:default=>true, :null=>false} $ rake migrate Error: ERROR: column "notify_on_create" contains null values : ALTER TABLE types ALTER notify_on_create SET NOT NULL Why doesn''t Rails set the new column to true, as it''s supposed to default to? I tried :default=>1 as well (same
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
2005 Aug 21
0
Patch for Element.Class - wrong regexp
Hello, I noticed (due to a recent post by Martin Honnen to clp) that Element.Class uses wrong regexps for its operations. E.g., Element.Class.has() will find "classA" in "classA-foobar" I also changed the interface of .has() to the more general one used in .has_any() --- util.js.old 2005-08-21 19:18:40.000000000 +0200 +++ util.js 2005-08-21 19:31:42.000000000 +0200 @@
2007 May 20
2
Get first class name
I have a situation where I need to get the first class name of an element. Element.ClassNames() returns an object not an array... Object.values() will turn it into an array, but the API Docs say that the order of the resulting array is browser-dependent.. So for my use is no good... So I am using: el.className.split(" ").first(); Can any one see any problems that I might
2010 Oct 04
1
S4 class help pages [Sec=Unclassified]
Hi, I am working on producing an R package containing mostly S4 classes and methods. I have generated and filled out all the necessary .Rd files but find that once installed I am unable to access help pages for the classes using the ?package::classname-class syntax that is suggested when using the ?? apropos search. This lists my package classes and the class help pages. Instead, the
2006 Jan 09
3
rails ignoring the migration file
I have a mysql database that I am trying to use migrations on. The problem that I am having is that when I create a blob field in my migration file like so: t.column "data", :binary, :limit => 15.megabytes, :null => false rails changes it to this in the schema: t.column "data", :binary, :default => "", :null => false not only is this not what I wanted
2006 Aug 16
3
Validate your forms with a table-less model
Ive followed this example of how to validate a form with a tableless model: http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a_table_less_model Ive got this example working but when validation fails the failed boxes are not highlighted in red. At the moment i have a contact details form and want to validate the information entered by the user but this will just result
2006 Jun 28
2
Assign CSS class to Link to Remote
I''m trying to get link_to_remote to assign a CSS class to the link it generates. My code is as follows: <%= link_to_remote "Show Full Info", :update => "fullcontact" + reparray.last.to_s, :url => "/cm/full_contact/" + reparray.last.to_s, :classname => "contactlink" %> Which produces this HTML: <a href="#"
2006 Feb 13
2
Do I need separate file for each model
Hi, I have some models in a file named genel. When I try to use one of the classes in my controller rails raises an error telling classname.rb is not forund even the file is required already. require "genel" require "hesaplar" class HesaplarController < ApplicationController def yeni_firma @emlak_firmasi = EmlakFirmasi.new @sehirler = Sehir.find_all end
2010 Aug 08
0
registerable method undefined in Devise migration (was Re: Re: No route matches)
On 8 August 2010 23:39, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > I tried to make the application from scratch again, and > notices that I get the following when I run: $ rake db:migrate > > (in /Users/abder/Desktop/Rails/auth) > ==  DeviseCreateUsers: migrating > ============================================== > -- create_table(:users)
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