app/models/table.rb
# runs before each validation phase on create and update
runs before each validation phase on create and update
runs before each validation phase on create and update
def before_validation
    self.privacy ||= owner.private_tables_enabled ? PRIVATE : PUBLIC
    super
  end
def before_validation self . privacy ||= owner . private_tables_enabled ? PRIVATE : PUBLIC super end
runs before each validation phase on create and update
runs before each validation phase on create and update
# ensure privacy variable is set to one of the constants. this is bad.