Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/aslon_scaffold/aslon_scaffold.rb

Overview

module InstanceMethods

  def before_destroy
    !self.undeletable
  end
end

class ActiveRecord::Base

def self.acts_as_undeletable(options = {})
    cattr_accessor :undeletable
    self.undeletable = (options[:actif] || true)

  def self.delete_all
    puts "delete all"
  end
include InstanceMethods

end

end

Constant Summary collapse

@@per_page =
30

Instance Method Summary collapse

Instance Method Details

#to_labelObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/aslon_scaffold/aslon_scaffold.rb', line 54

def to_label
  begin
    lib
  rescue
    begin
     nom
    rescue
      begin
        name
      rescue
       begin
          label
        rescue
          self.id.to_s+'(id)'
        end
      end
    end
  end

end