Relax Rails dependency to allow 5.1

This commit is contained in:
Grzesiek Kolodziejczyk
2017-05-18 11:39:18 +02:00
parent 25d8adaf8b
commit 8aeb9a6c70
8 changed files with 127 additions and 100 deletions

View File

@@ -1,4 +1,10 @@
class CreateBlogs < ActiveRecord::Migration
migration_class = if Gem::Version.new(Rails.version) >= Gem::Version.new("5.0")
ActiveRecord::Migration[4.2]
else
ActiveRecord::Migration
end
class CreateBlogs < migration_class
def change
create_table :blogs do |t|
t.string :title

View File

@@ -1,4 +1,3 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@@ -9,15 +8,15 @@
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160218212104) do
ActiveRecord::Schema.define(version: 20160218212104) do
create_table "blogs", :force => true do |t|
t.string "title"
t.text "content"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
create_table "blogs", force: :cascade do |t|
t.string "title"
t.text "content"
t.datetime "created_at"
t.datetime "updated_at"
end
end