Sha256: 3bd0ae3ed27df84c9b2335fe6c4aaae23a0270906d1d4a5d5d568f6e73e54c56

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

module DataType
  class Symbol < Base
    def column
      # Just construct whatever the user wants
      {:type => @value || :string }.merge(@options)
    end  
    
    def mock
      case @value || :string
        when :text then self.class.long_text_mock
        when :string then self.class.short_text_mock
        when :integer then Fixnum.default_mock
        when :decimal, :float then Float.default_mock
        when :datetime, :date then Date.default_mock
      end
    end
  end
end
  

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
migrant-1.1.1 lib/datatype/symbol.rb
migrant-1.1.0 lib/datatype/symbol.rb