Sha256: b80add737acb57a369ee6122f8521a3406d946bcefd8c005a7089e89f9f6f259

Contents?: true

Size: 483 Bytes

Versions: 10

Compression:

Stored size: 483 Bytes

Contents

module Milksteak
  class Page < YmlContent
    attr_accessor :route

    def self.folder; "pages"; end
    
    # override write to include validation for :route.  If validation
    # becomes something that is needed on a bigger scale, we'll need
    # to put this into another method activerecord-style
    
    def self.write(name, params = {}, content)
      raise NoRouteException unless params["route"]
      super
    end
  end
  
  class NoRouteException < Exception; end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
milksteak-0.0.15 lib/models/page.rb
milksteak-0.0.13 lib/models/page.rb
milksteak-0.0.12 lib/models/page.rb
milksteak-0.0.11 lib/models/page.rb
milksteak-0.0.10 lib/models/page.rb
milksteak-0.0.9 lib/models/page.rb
milksteak-0.0.8 lib/models/page.rb
milksteak-0.0.7 lib/models/page.rb
milksteak-0.0.6 lib/models/page.rb
milksteak-0.0.4 lib/models/page.rb