Sha256: a848db2f2de47e29dfe5df2290fc29f119c691d77e8f6f44b868d8a39cc24f4b

Contents?: true

Size: 818 Bytes

Versions: 67

Compression:

Stored size: 818 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",
      # 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

67 entries across 67 versions & 1 rubygems

Version Path
bullet_train-super_scaffolding-1.10.0 lib/scaffolding.rb
bullet_train-super_scaffolding-1.9.0 lib/scaffolding.rb
bullet_train-super_scaffolding-1.8.5 lib/scaffolding.rb
bullet_train-super_scaffolding-1.8.4 lib/scaffolding.rb
bullet_train-super_scaffolding-1.8.3 lib/scaffolding.rb
bullet_train-super_scaffolding-1.8.2 lib/scaffolding.rb
bullet_train-super_scaffolding-1.8.1 lib/scaffolding.rb
bullet_train-super_scaffolding-1.8.0 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.23 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.22 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.21 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.20 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.19 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.18 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.17 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.16 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.15 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.14 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.13 lib/scaffolding.rb
bullet_train-super_scaffolding-1.7.12 lib/scaffolding.rb