Sha256: ee504425a4e08861d1768f47e9e4a7d8d1411ec72f334b2c094c947be871a683

Contents?: true

Size: 836 Bytes

Versions: 4

Compression:

Stored size: 836 Bytes

Contents

module Scaffolding
  mattr_accessor :database, default: :postgresql

  def self.mysql?
    database == :mysql
  end

  def self.valid_attribute_type?(type)
    [
      "address_field",
      "boolean",
      "buttons",
      "checkbox",
      # 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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bullet_train-super_scaffolding-1.14.0 lib/scaffolding.rb
bullet_train-super_scaffolding-1.13.0 lib/scaffolding.rb
bullet_train-super_scaffolding-1.12.3 lib/scaffolding.rb
bullet_train-super_scaffolding-1.12.2 lib/scaffolding.rb