Sha256: d488a13bbab5651f87daba94f1a2a17bc0a1dd50a7cfa8818ead8840c8b9f983
Contents?: true
Size: 941 Bytes
Versions: 3
Compression:
Stored size: 941 Bytes
Contents
module Spontaneous::Rack module Back class Base < ServerBase helpers Helpers set :views, Proc.new { Spontaneous.application_dir + '/views' } def content_model Spontaneous::Content end def update_fields(model, field_data) return unless field_data Spontaneous::Field.update_asynchronously(model, field_data, user) json(model) end def content_for_request(lock = false) content_model.db.transaction do dataset = lock ? content_model.for_update : content_model content = dataset.get(params[:id]) halt 404 if content.nil? content.current_editor = user if box_id = content_model.schema.uids[params[:box_id]] box = content.boxes.detect { |b| b.schema_id == box_id } yield(content, box) else yield(content) end end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spontaneous-0.2.0.beta4 | lib/spontaneous/rack/back/base.rb |
spontaneous-0.2.0.beta3 | lib/spontaneous/rack/back/base.rb |
spontaneous-0.2.0.beta2 | lib/spontaneous/rack/back/base.rb |