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
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
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
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
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
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
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
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
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
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
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
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
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
13 matches
Mail list logo