Sha256: dad92e786cab4bd3c04be192d13425bb0939dd9cbe72667243978e3135441127

Contents?: true

Size: 580 Bytes

Versions: 9

Compression:

Stored size: 580 Bytes

Contents

class CreateNoteeImages < ActiveRecord::Migration
  class NoteeImage < ActiveRecord::Base; end

  def change
    create_table :notee_images do |t|

      t.string :content, null: false, uniqueness: true
      t.boolean :is_deleted, null: false, default: false

      # if you have user_id
      # t.integer :user_id

      t.timestamps null: false
    end

    # create default image
    Notee::Image.skip_callback(:create, :before, :create_authority)
    Notee::Image.create :content => 'default.png'
    Notee::Image.set_callback(:create, :before, :create_authority)
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
notee-1.0.8 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.7 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.6 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.5 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.4 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.3 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.2 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.1 db/migrate/20160605141547_create_notee_images.rb
notee-1.0.0 db/migrate/20160605141547_create_notee_images.rb