Class: ActiveRecord::ConnectionAdapters::TableDefinition

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

Instance Method Summary collapse

Instance Method Details

#count(name) ⇒ Object

erstellt ein feld vom typ integer mit name+_count und default 0



17
18
19
# File 'lib/active_record_extensions.rb', line 17

def count(name)
  column("#{name.to_s}_count", :integer, :default => 0)
end

#default_textObject



12
13
14
# File 'lib/active_record_extensions.rb', line 12

def default_text
  column(:text, :text)
end

#nameObject

erstellt ein friendly_name und name feld



7
8
9
10
# File 'lib/active_record_extensions.rb', line 7

def name
  column(:name, :string)
  column(:friendly_name, :string)
end