[Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
All, Can anyone see what's happening here? == migration === class CreateGreetings ActiveRecord::Migration def self.up create_table :greetings do |t| t.string :greet t.string :language t.integer :count t.timestamps end end

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread Colin Law
On 11 June 2011 09:45, ddoherty03 ddohert...@gmail.com wrote: All, Can anyone see what's happening here? == migration === class CreateGreetings ActiveRecord::Migration   def self.up     create_table :greetings do |t|       t.string :greet       t.string

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
Colin, Yes. I have run the migration. Here is the schema: schema.rb === ActiveRecord::Schema.define(:version = 20110609145209) do create_table greetings, :force = true do |t| t.string greet t.string language t.integer count

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
Oh, and this might be relevant: $ rails -v Rails 3.0.3 $ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] Thanks. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread Colin Law
On 11 June 2011 09:45, ddoherty03 ddohert...@gmail.com wrote: All, Can anyone see what's happening here? == migration === class CreateGreetings ActiveRecord::Migration   def self.up     create_table :greetings do |t|       t.string :greet       t.string

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread Michael Pavling
Sorry for the top post, but I thought it would be worth raising the point that overloading after_initialize on AR::Base was a bad idea (or at least used to be). Have a quick Google of that to see what comes up. Top-posted from Android On Jun 11, 2011 9:45 AM, ddoherty03 ddohert...@gmail.com

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
Colin, Good catch. When I correct the typo, though, I still get the same error. I get this in another app too, so this seems to be something else going on here. Regards, -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread Colin Law
On 11 June 2011 11:40, ddoherty03 ddohert...@gmail.com wrote: Colin, Good catch.  When I correct the typo, though, I still get the same error. I get this in another app too, so this seems to be something else going on here. You should not have to restart the server, but try that (if you have

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
Here is the method that is blowing up: = greeting.rb == class Greeting ActiveRecord::Base after_initialize :check_greet validates_uniqueness_of :count def check_greet self.language = language.capitalize end end

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
Pavling, Thanks for the comment. If I understand it, though, I don't believe that's what's going on here. I am not redefining the after_initialize method, just using it to add a callback into the object creation stream. This is pretty standard. But when the validation test is run, it seems

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread Colin Law
On 11 June 2011 14:25, ddoherty03 ddohert...@gmail.com wrote: Here is the method that is blowing up: = greeting.rb == class Greeting ActiveRecord::Base   after_initialize :check_greet   validates_uniqueness_of :count   def check_greet    

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread ddoherty03
Colin, Many thanks again. That looks like it's the problem. Also looks like it's been around about 3 years. Regards, Dan -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

Re: [Rails] after initialize blowing up---help

2011-06-11 Thread Michael Pavling
Sorry. Yes, it's just plain old 'initialize' that shouldn't be overloaded, which you're not doing ... Ignore me :-) Top-posted from Android On Jun 11, 2011 2:37 PM, ddoherty03 ddohert...@gmail.com wrote: Pavling, Thanks for the comment. If I understand it, though, I don't believe that's