Model using STI new function only working partially

Hi,
I have an application using STI on a model named Publisher. Publisher
uses STI via a column named “service”. When I call

p = Publisher.new(…, :service => “TwitterPublisher”)

the service does not get assigned, yet all other columns do. However,
if I later call

p[:service] = “TwitterPublisher”

all is well. Any ideas about what is going on? My environment is
Ruby 1.9/1.8.6 with Rails 2.3.5 running on MinGW(1.9) and Linux (1.8.6

  • on Heroku). Any idea as to what is going wrong?

Best Regards,
Solly

On Feb 7, 7:00 pm, Solly [email protected] wrote:


all is well. Any ideas about what is going on?

inheritance_column (service in this case) is automatically protected
against mass-assignment. If you examine your logs carefully, you
should see some messages about that.

–Matt J.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs