Sha256: 75742e0582acac29192d0f9fbc176b385e825890c38c2149fa05d830e68dfdae

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

module ActiveScaffold::Config
  class Duplicate < Base
    self.crud_type = :create
    
    def initialize(core_config)
      @core = core_config
      self.method = self.class.method
      self.link = self.class.link.clone
      self.action_after_clone = self.class.action_after_clone
      self.refresh_list = self.class.refresh_list
    end

    # the method to clone records
    cattr_accessor :method
    @@method = :dup
    
    # which action render after clone
    cattr_accessor :action_after_clone
    @@action_after_clone = nil

    # whether we should refresh list after clone or not
    cattr_accessor :refresh_list
    @@refresh_list = false

    # the ActionLink for this action
    cattr_accessor :link
    @@link = ActiveScaffold::DataStructures::ActionLink.new(:duplicate, :label => :clone, :type => :member, :method => :post, :position => false, :security_method => :duplicate_authorized?, :ignore_method => :duplicate_ignore?)

    # instance-level configuration
    # ----------------------------

    # the ActionLink for this action
    attr_accessor :link
    
    # the method to clone records
    attr_accessor :method

    # which action render after clone
    attr_accessor :action_after_clone

    # whether we should refresh list after clone or not
    attr_accessor :refresh_list
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_scaffold_duplicate-1.1.0 lib/active_scaffold/config/duplicate.rb~
active_scaffold_duplicate-1.0.3 lib/active_scaffold/config/duplicate.rb~
active_scaffold_duplicate-1.0.2 lib/active_scaffold/config/duplicate.rb~
active_scaffold_duplicate-1.0.1 lib/active_scaffold/config/duplicate.rb~
active_scaffold_duplicate-1.0.0 lib/active_scaffold/config/duplicate.rb~