This project is archived and is in readonly mode.

#4956 ✓stale
Phillip

model with boolean column "notify" raises ArgumentError on save

Reported by Phillip | June 24th, 2010 @ 04:18 PM

Here's the model:

 CREATE TABLE  `webapp`.`posts` (
   `id` int(8) NOT NULL AUTO_INCREMENT,
   `user_id` int(8) DEFAULT '0',
   `position` int(4) DEFAULT '0',
   `dthread_id` int(8) DEFAULT NULL,
   `parent_id` int(8) DEFAULT NULL,
   `notify` tinyint(1) DEFAULT '0',
   `post` text,
   `lock` tinyint(1) DEFAULT '0',
   `created_at` datetime DEFAULT '0000-00-00 00:00:00',
   `updated_at` datetime DEFAULT '0000-00-00 00:00:00',
   PRIMARY KEY (`id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=utf8

The model post.rb is empty:

 class Post < ActiveRecord::Base
 end

A new post cannot be saved:

ArgumentError (wrong number of arguments (1 for 0)):
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:321:in `notify'
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:321:in `callback'
     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:282:in `valid?' .....

Changing the name of the column "notify" to "notifyme" allows the post to be saved.

Comments and changes to this ticket

  • Neeraj Singh

    Neeraj Singh June 24th, 2010 @ 05:04 PM

    What version of rails you are using?

  • Santiago Pastorino

    Santiago Pastorino June 24th, 2010 @ 09:56 PM

    Looking at the failing path i guess is 2.2.2 :P.
    Can you try with a newer Rails version? surely this is fixed on later versions.
    Thanks.

  • Kane

    Kane June 25th, 2010 @ 04:32 PM

    in commit http://github.com/rails/rails/commit/7c84bbf1607bf4059de04cc4c8ec84... the method was changed to notify_observers

    git tag --contains 7c84bbf1607bf4059de04cc4c8ec84df2334574b 2010-06-25 8:31:05
    v3.0.0.beta.2
    v3.0.0.beta.3
    v3.0.0.beta1
    v3.0.0.beta2
    v3.0.0.beta3
    v3.0.0.beta4

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 05:01 PM

    • State changed from “new” to “open”
    • Importance changed from “” to “Low”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 05:01 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages