class Theme < Stylesheet belongs_to :css, polymorphic: true protected def set_name self.name = File.basename(self.file_identifier, ".css") end end