[Radiant] Radiant 0.6.6 / Rails 2.0 Model Inheritance Question
Sean Cribbs
seancribbs at gmail.com
Tue Apr 29 09:52:19 CDT 2008
>
> 2. This still didn't work, though. And it was only by poking around
> the Archive extension that I figured out that the create_record
> call in the scenario had to explicitly call out the value for this
> class_name field like (shown here in my create_stylesheet helper):
> def create_stylesheet(name, attributes={})
> create_record :stylesheet_asset,
> name.symbolize,
>
> stylesheet_params(attributes.reverse_merge(:name => name,
>
> :class_name => 'StylesheetAsset') )
> end
>
> I'm still not sure why #2 was required (possible bug with Scenario
> plugin)? I would have thought that creating the record would have
> automatically used Rails STI and populated the class name for me.
>
Ah, that makes sense. Next time you can probably use create_model
instead, which creates the actual AR object instead of just writing the
record to the DB.
Sean
More information about the Radiant
mailing list