Module: Scaffolding

Defined in:
lib/scaffolding.rb,
app/models/scaffolding.rb,
lib/scaffolding/block_manipulator.rb

Defined Under Namespace

Modules: AbsolutelyAbstract, CompletelyConcrete, FileManipulator Classes: Attribute, BlockManipulator, ClassNamesTransformer, RoutesFileManipulator, Transformer

Class Method Summary collapse

Class Method Details

.mysql?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/scaffolding.rb', line 4

def self.mysql?
  database == :mysql
end

.table_name_prefixObject



2
3
4
# File 'app/models/scaffolding.rb', line 2

def self.table_name_prefix
  "scaffolding_"
end

.valid_attribute_type?(type) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/scaffolding.rb', line 8

def self.valid_attribute_type?(type)
  [
    "address_field",
    "boolean",
    "buttons",
    # TODO: We're leaving cloudinary_image here for now for backwards compatibility.
    # We should remove it in a future major update.
    "cloudinary_image",
    "color_picker",
    "date_and_time_field",
    "date_field",
    "email_field",
    "emoji_field",
    "file_field",
    "image",
    "number_field",
    "options",
    "password_field",
    "phone_field",
    "super_select",
    "text_area",
    "text_field",
    "trix_editor"
  ].include?(type.gsub(/{.*}/, "")) # Pop off curly brackets such as `super_select{class_name=Membership}`
end