enum_extensions 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9038d6d82b6812457fd6166aa71a776958484f61
4
- data.tar.gz: 18f7df09d6c1f16ae26a43aa7238a2edd9217b73
3
+ metadata.gz: 7d6dcc940c68eada8719ff5ea66d810dcf4c6f9c
4
+ data.tar.gz: 2423ed2ef930e54404b371154fc03ab5e0f634c8
5
5
  SHA512:
6
- metadata.gz: 4cf62919a04f7f0406f36dc9079c1219bc59dc22f2ef43bc34262a7b3fdc943cff579685b4551c64bf55cf8fe6d8fd2dde22dc41fcaf905c584e37e9c6576f0a
7
- data.tar.gz: 2ad2c5a954d80a9b75cd93ce656062dd490742556e357bc8dfc29ed3cbf09192e94e468931d633531c071cb85611795531b15015f3b0cc860cf2d2c5ec04a389
6
+ metadata.gz: 05ef2f091d6f1b531f0099cfafe797836f31aac97418049ae061bcbe0ac65c4701801083569c1966904c101df8fd4fdd18688cb520d08ec28a46874f5368897a
7
+ data.tar.gz: b4cb7b7793675e60d44568ef9eaadb2ad58a07d40a58de8648d5a0601859421410845b059c24d79586effb945777827c039cf9508e7fc22e8a5c39c637d7905b
@@ -1,3 +1,3 @@
1
1
  module EnumExtensions
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -0,0 +1,7 @@
1
+ class Book < ActiveRecord::Base
2
+
3
+ simple_enum status: [ :proposed, :written, :published ]
4
+ simple_enum read_status: { unread: 0, reading: 2, read: 3 }
5
+ simple_enum nullable_status: [ :single, :married ]
6
+
7
+ end
Binary file
@@ -0,0 +1,13 @@
1
+ class CreateBooks < ActiveRecord::Migration
2
+
3
+ def change
4
+ create_table :books do |t|
5
+ t.column :name, :string
6
+ t.string :format
7
+ t.column :status, :integer, default: 0
8
+ t.column :read_status, :integer, default: 0
9
+ t.column :nullable_status, :integer
10
+ end
11
+ end
12
+
13
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20151002191153) do
15
+
16
+ create_table "books", force: :cascade do |t|
17
+ t.string "name"
18
+ t.string "format"
19
+ t.integer "status", default: 0
20
+ t.integer "read_status", default: 0
21
+ t.integer "nullable_status"
22
+ end
23
+
24
+ end
Binary file
@@ -0,0 +1,25 @@
1
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateBooks (20151002191153)
6
+  (0.2ms) begin transaction
7
+  (1.3ms) CREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "status" integer DEFAULT 0, "read_status" integer DEFAULT 0, "nullable_status" integer)
8
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151002191153"]]
9
+  (1.1ms) commit transaction
10
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13
+ Migrating to CreateBooks (20151002191153)
14
+  (0.1ms) begin transaction
15
+  (19.7ms) DROP TABLE "books"
16
+ SQL (0.3ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = ? [["version", "20151002191153"]]
17
+  (1.9ms) commit transaction
18
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
20
+ Migrating to CreateBooks (20151002191153)
21
+  (0.1ms) begin transaction
22
+  (0.6ms) CREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "format" varchar, "status" integer DEFAULT 0, "read_status" integer DEFAULT 0, "nullable_status" integer)
23
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151002191153"]]
24
+  (9.5ms) commit transaction
25
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"