Can't dump anonymous class Class

Witajcie,
nie wiem czy to jakieś typo, błąd logiczny czy jak, ale dostaje takowy błąd:

can't dump anonymous class Class

w momencie zapisu obiektu.
Miałem taki kod:
@notification = Notification.new(:text => self.name, :user_id => self.author_user_id, :url => url_address, :notification_type => self.type)
wszystko działało poprawnie.
Dodałem nową kolumnę i próbuje zapisać i dostaje właśnie taki błąd.
@notification = Notification.new(:text => self.name, :user_id => self.author_user_id, :url => url_address, :notification_type => self.type, :not_g => 12)

co więcej, w przypadku stworzenia nowego obiektu w konsoli i zapisaniu go, wszystko działa poprawnie. Ktoś może jest w stanie mnie oświecić?

pozdrawiam

ps. google zwraca kilka wyników na ten błąd lecz nijak mają się one do mojego problemu.

Pokaż kod migracji i klasy.

[code=ruby]class AddNotGToNotification < ActiveRecord::Migration
def self.up
add_column “notifications”, :not_g, :integer
end

def self.down
remove_column “notifications”, :not_g
end
end[/code]
W kontrolerze dodającym dokument mam:

def create @blurb = Blurb.new(params[:blurb]) @blurb.author_user_id = @user_logged_in.id if @blurb.save ua = doc_url_address(@blurb) @blurb.add_to_notifications(ua) flash[:notice] = 'Blurb was successfully created.' redirect_to :action => 'list' else render :action => 'new' end end
W modelu ( przy okazji, czy dobrze że wrzuciłem ten kod do modelu?, moim zdaniem jest związany z modelem) dokumentu

def add_to_notifications url_address @notification = Notification.new(:text => self.name, :user_id => self.author_user_id, :url => url_address, :notification_type => self.type, :not_g => 12) if @notification.save else logger.warn "\e[#{message_color}mCan't add notification from Doc.add_to_notification" end end
Jak widać ustawiam na sztywno liczbę (12), bo już nawet tu podejrzewałem błąd. Wszystko działało do czasu dodania nowego parametru not_g (na początku miałem group_id, ale zmieniłem bo myślałem, że i tą nazwę ma zastrzeżoną jak np. type).
Myślę, że to nie problem z db, bo z ./script/console mi ładnie zapisuje do bazy.
Wyczytałem, że może to mieć coś wspólnego z http://api.rubyonrails.org/classes/HashWithIndifferentAccess.html ale jak to się odnosi do mojego przypadku to niestety nie wiem.

z góry dzięki za pomoc

Zapodaj jeszcze stack trace.

Zdebuguj jeszcze w Netbeans.

[quote=radarek]Zapodaj jeszcze stack trace.

Zdebuguj jeszcze w Netbeans.[/quote]

/usr/lib/ruby/1.8/yaml/rubytypes.rb:6:in `to_yaml' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/quoting.rb:29:in `quote' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/postgresql_adapter.rb:120:in `quote' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2042:in `quote_value' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2034:in `attributes_with_quotes' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1943:in `inject' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2032:in `each' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2032:in `inject' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2032:in `attributes_with_quotes' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2131:in `quoted_column_names' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1816:in `create_without_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/callbacks.rb:254:in `create_without_timestamps' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/timestamp.rb:30:in `create' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1792:in `create_or_update_without_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/callbacks.rb:242:in `create_or_update' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:1548:in `save_without_validation' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/validations.rb:752:in `save_without_transactions' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/transactions.rb:129:in `save' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in `transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/transactions.rb:95:in `transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/transactions.rb:121:in `transaction' /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/transactions.rb:129:in `save' /home/punkracy/dev/domki/app/models/doc.rb:73:in `add_to_notifications' /home/punkracy/dev/domki/app/controllers/blurb_controller.rb:40:in `create' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/base.rb:1101:in `send' ....
ok, spróbuje jeszcze z debugiem

Tak wstępnie wnioskuję, że któryś z atrybutów jest obiektem, który AR nie potrafi poprawnie przypasować do typu w bazie więc próbuje go zserializować do yamla. Sprawdź wszystkie atrybuty przed zapisem czy na pewno posiadają poprawne wartości. Zrób sobie <%= debug %> lub podglądnij w debugerze.

EDIT:
Wygląda na to, że jeden z atrybutów ma przypisaną wartość, która jest anonimową klasa. Prawdopodobnie gdzieś masz błąd w przypisaniu.

/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/quoting.rb:29:in quote

[code=ruby] def quote(value, column = nil)
# records are quoted as their primary key
return value.quoted_id if value.respond_to?(:quoted_id)

    case value
      when String, ActiveSupport::Multibyte::Chars
        value = value.to_s
        if column && column.type == :binary && column.class.respond_to?(:string_to_binary)
          "'#{quote_string(column.class.string_to_binary(value))}'" # ' (for ruby-mode)
        elsif column && [:integer, :float].include?(column.type)
          value = column.type == :integer ? value.to_i : value.to_f
          value.to_s
        else
          "'#{quote_string(value)}'" # ' (for ruby-mode)
        end
      when NilClass                 then "NULL"
      when TrueClass                then (column && column.type == :integer ? '1' : quoted_true)
      when FalseClass               then (column && column.type == :integer ? '0' : quoted_false)
      when Float, Fixnum, Bignum    then value.to_s
      # BigDecimals need to be output in a non-normalized form and quoted.
      when BigDecimal               then value.to_s('F')
      when Date                     then "'#{value.to_s(:db)}'"
      when Time, DateTime           then "'#{quoted_date(value)}'"
      else                          "'#{quote_string(value.to_yaml)}'"  # ta linia u Ciebie się wykonuje
    end
  end[/code]

/usr/lib/ruby/1.8/yaml/rubytypes.rb:6:in `to_yaml’

class Class def to_yaml( opts = {} ) raise TypeError, "can't dump anonymous class %s" % self.class end end

Dzięki Panowie za pomoc. Pomogło debuggowanie Netbeansami. Problem był w :notification_type => self.type
. Nie wiem czemu mi to wcześniej działało, nie chce teraz w to wnikać. Powinno być oczywiście :notification_type => self.type.to_s
w

@notification = Notification.new(:text => self.name, :user_id => self.author_user_id, :url => url_address, :notification_type => self.type, :not_g => 12)
Pozdrawiam i dzięki raz jeszcze za pomoc.