Class: Drupal::CCK::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/drupal/cck/builder.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.codeObject



4
5
6
7
8
9
# File 'lib/drupal/cck/builder.rb', line 4

def self.code
  types.
    map{|t| table = Table.new t}.
    select{|t| t.valid?}.
    join("\n")
end

.fieldsObject



15
16
17
# File 'lib/drupal/cck/builder.rb', line 15

def self.fields
  @fields ||= Drupal::Repository.adapter.query('show tables').select{|t| t.match(/^content_field/)}
end

.typesObject



11
12
13
# File 'lib/drupal/cck/builder.rb', line 11

def self.types
  @types ||= ContentType.all.map{|t| t.content_type }
end