Single table inheritance: declare non-shared attributes

I have a Model Foo and two subclasses Bar1 and Bar2. Bar1 have some
attributes which shouldn’t be accessible in Bar2 (because they aren’t
needed), what is the best practice to declare such attributes as

declare them only in Bar1?

On Tue, Apr 29, 2008 at 7:27 AM, Kai S.

These attributes have columns in the underlying table, and ActiveRecord
make them accessible by default…

maybe redefine the ‘hidden’ fields in the model they’re not supposed
to be used in. A la
class Foo < Item
def attribut_used_by_bar
raise ‘you cant read that!’

On Wed, Apr 30, 2008 at 5:31 AM, Kai S.

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