Sha256: ffb44106b8bcfba71bab813f6df413d902d2cbfbbbe473ab672f3cbff5a4a3ef
Contents?: true
Size: 431 Bytes
Versions: 1
Compression:
Stored size: 431 Bytes
Contents
module Papercat class Javascript < Document store_accessor :data, :pathname, :source, :body validates_with UniquenessValidator, key: :pathname validates_presence_of :source before_save :minify def as_json options = {} super(options.update(methods: [:pathname, :source], except: [:data])) end private def minify self.body = Uglifier.compile(self.source) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
papercat-0.0.2 | app/models/papercat/javascript.rb |