Rails 2.0.2 and Can't mass-assign these protected attributes

Hi there:

I'm playing around with a form that saves name, type and date for a kind of travels. At the controller I have this:     @promotion = Promotion.new(params[:promotion])     @promotion.save     redirect_to promotions_path So yes, I mass-assign all the form data, but my model definition is empty actually (no "attr_protected", no "attr_accessible" anywhere), but the message "WARNING: Can't mass-assign these protected attributes: type" shows up every time and the value for "type" gets saved as empty (NULL) on development environment.

I've found this thread at the group but it doesn't solve my problem: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/fe5263558f73a514/ecee69cdf4676123?lnk=gst&q=Can't+mass-assign+these+protected+attributes#ecee69cdf4676123

Any ideas about what is protecting this attribute from myself?.

Cheers, Ibon.

Hi there:

I'm playing around with a form that saves name, type and date for a kind of travels. At the controller I have this:    @promotion = Promotion.new(params[:promotion])    @promotion.save    redirect_to promotions_path So yes, I mass-assign all the form data, but my model definition is empty actually (no "attr_protected", no "attr_accessible" anywhere), but the message "WARNING: Can't mass-assign these protected attributes: type" shows up every time and the value for "type" gets saved as empty (NULL) on development environment.

type is a magic column name (used for STI). You can change the magic
STI column to something else with inheritance_column

Fred

Hi Fred:

Appreciate the clarifying comment. I think that I have prefer to change my column name rather than the magic one. By the way, what does STI means?.

Cheers, Ibon.

Hi Fred:

Appreciate the clarifying comment. I think that I have prefer to change my column name rather than the magic one. By the way, what does STI means?.

Depending on the context, Single Table Inheritance or Sexually
Transmitted Infection.

Fred

XD

Thanks.