Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

model with boolean column "notify" raises ArgumentError on save

#4956

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.

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

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh

    What version of rails you are using?

    June 24th, 2010 @ 05:04 PM

  2. Santiago Pastorino
    Santiago Pastorino

    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.

    June 24th, 2010 @ 09:56 PM

  3. Kane
    Kane

    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

    June 25th, 2010 @ 04:32 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • 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.

    February 2nd, 2011 @ 05:01 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 05:01 PM