Sha256: b5a4ad324aace42756968fc5a00d82fae3ccfa184906b9bead2d1454f1b4e951

Contents?: true

Size: 536 Bytes

Versions: 3

Compression:

Stored size: 536 Bytes

Contents

class NetzkeFormPanelField < ActiveRecord::Base
  belongs_to :layout, :class_name => "NetzkeLayout"
  
  acts_as_list :scope => :layout

  def self.create_layout_for_widget(widget)
    layout = NetzkeLayout.create(:widget_name => widget.id_name, :items_class => self.name, :user_id => NetzkeLayout.user_id)

    columns = Netzke::Column.default_fields_for_widget(widget)

    for c in columns
      config_for_create = c.merge(:layout_id => layout.id).stringify_values!
      create(config_for_create)
    end
    
    layout
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netzke-basepack-0.3.0 lib/app/models/netzke_form_panel_field.rb
netzke-basepack-0.2.2 lib/app/models/netzke_form_panel_field.rb
netzke-basepack-0.3.1 lib/app/models/netzke_form_panel_field.rb