Sha256: 588194cfca0720adb1c7792a0e48d15a98929def197e815f90d206b238dd20e8
Contents?: true
Size: 844 Bytes
Versions: 3
Compression:
Stored size: 844 Bytes
Contents
module ActiveScaffold::Actions module Subform def edit_associated @parent_record = params[:id].nil? ? active_scaffold_config.model.new : find_if_allowed(params[:id], :update) @column = active_scaffold_config.columns[params[:association]] # NOTE: we don't check whether the user is allowed to update # this record, because if not, we'll still let them associate # the record. we'll just refuse to do more than associate, is # all. @record = @column.association.klass.find(params[:associated_id]) if params[:associated_id] @record ||= @column.association.klass.new @scope = "[#{@column.name}]" @scope += (@record.new_record?) ? "[#{(Time.now.to_f*1000).to_i.to_s}]" : "[#{@record.id}]" if @column.plural_association? render :action => 'edit_associated' end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
active_scaffold-3.0.12 | lib/active_scaffold/actions/subform.rb |
active_scaffold-3.0.11 | lib/active_scaffold/actions/subform.rb |
active_scaffold-3.0.5 | lib/active_scaffold/actions/subform.rb |