we_bridge_rails_engine_langs 0.1.4 → 0.1.5

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: b654160340c79fd8f61102d7e78a55a3a99cb91d
4
- data.tar.gz: 23f7272f88c4e14c63f43811e870a3c50a260ef0
3
+ metadata.gz: 51f852e2a11e2dad023b20a7274c251173500e97
4
+ data.tar.gz: 8b9ba47220bfe674f6fde2660bce863dbd5b624b
5
5
  SHA512:
6
- metadata.gz: bf21931bbc8c42ffe48790a1ffc3ed32f83488a042062ad6e7b8c4480c2e8c8935afaabcf460d21274ae2852ae5e6a77a02ab896f7608436f7a95f5bdc60dd57
7
- data.tar.gz: 929b0da02d87029b29afbf3ca9efcc64296505ae3a4f5f49d65fa1d5ac4e1d9705996816aa0a9c4d1817a686ce9520055951d72888412037d4f41b02053f3e76
6
+ metadata.gz: 77a71409658f0db473eaaa6f1aaba7a105c346533a2f781f63f6334e92dfeaac5a4d87bc8309784275f3c518b322ce5472b9bd403788f2dcb299c81f8305e2ca
7
+ data.tar.gz: c547a1a644b1bf9ce99f9425d5a359ebad8f5024cd9a84a5e8511c55d69dee35f8e85e99bf7264c72d354dfc1497bdfddb179b442cd426e346ce613bd85b87ae
data/app/models/lang.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'activerecord/mlang'
2
2
  class Lang < ActiveRecord::Mlang::Lang
3
+ default_scope{ order :position }
3
4
  include ActionView::Helpers::AutoTagHelper::FormInfo
4
5
  set_accessible_attrs :code,:east,:position,:enable
5
6
  def __display__
@@ -0,0 +1,5 @@
1
+ class ModifyLangPositionDefault < ActiveRecord::Migration
2
+ def change
3
+ change_column :langs, :position, :integer, default: 10000
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineLangs
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
Binary file
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20150803101150) do
14
+ ActiveRecord::Schema.define(version: 20150814101311) do
15
15
 
16
16
  create_table "lang_texts", force: :cascade do |t|
17
17
  t.integer "parent_id", null: false
@@ -26,7 +26,7 @@ ActiveRecord::Schema.define(version: 20150803101150) do
26
26
  create_table "langs", force: :cascade do |t|
27
27
  t.string "code", limit: 5, null: false
28
28
  t.boolean "east", default: false, null: false
29
- t.integer "position", default: 1, null: false
29
+ t.integer "position", default: 10000, null: false
30
30
  t.boolean "enable", default: true, null: false
31
31
  t.datetime "created_at", null: false
32
32
  t.datetime "updated_at", null: false
Binary file
@@ -14980,3 +14980,73 @@ Completed 200 OK in 114ms (Views: 107.7ms | ActiveRecord: 2.1ms)
14980
14980
  SQL (0.6ms) INSERT INTO "langs" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-08-09 04:16:12.302387"], ["updated_at", "2015-08-09 04:16:12.302387"]]
14981
14981
  SQLite3::ConstraintException: NOT NULL constraint failed: langs.code: INSERT INTO "langs" ("created_at", "updated_at") VALUES (?, ?)
14982
14982
   (0.2ms) rollback transaction
14983
+ Lang Load (0.7ms) SELECT "langs".* FROM "langs" ORDER BY "langs"."position" ASC
14984
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
14985
+ Migrating to CreateLangs (20150803101150)
14986
+  (0.1ms) begin transaction
14987
+  (0.2ms) CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 1 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
14988
+ SQLite3::SQLException: table "langs" already exists: CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 1 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
14989
+  (0.1ms) rollback transaction
14990
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
14991
+ Migrating to CreateLangs (20150803101150)
14992
+  (0.1ms) begin transaction
14993
+  (0.1ms) CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 1 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
14994
+ SQLite3::SQLException: table "langs" already exists: CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 1 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
14995
+  (0.0ms) rollback transaction
14996
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
14997
+  (0.1ms) select sqlite_version(*)
14998
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14999
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
15000
+ Migrating to CreateLangs (20150803101150)
15001
+  (0.1ms) begin transaction
15002
+  (0.5ms) CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 1 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
15003
+  (1.1ms) CREATE UNIQUE INDEX "index_langs_on_code" ON "langs" ("code")
15004
+  (0.1ms) CREATE TABLE "lang_texts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "parent_id" integer NOT NULL, "lang_id" integer NOT NULL, "label" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
15005
+  (0.1ms) CREATE UNIQUE INDEX "index_lang_texts_on_parent_id_and_lang_id" ON "lang_texts" ("parent_id", "lang_id")
15006
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150803101150"]]
15007
+  (1.3ms) commit transaction
15008
+ Migrating to ModifyLangPositionDefault (20150814101311)
15009
+  (0.1ms) begin transaction
15010
+  (0.6ms) CREATE TEMPORARY TABLE "alangs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 1 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
15011
+  (0.1ms) SELECT sql
15012
+ FROM sqlite_master
15013
+ WHERE name='index_langs_on_code' AND type='index'
15014
+ UNION ALL
15015
+ SELECT sql
15016
+ FROM sqlite_temp_master
15017
+ WHERE name='index_langs_on_code' AND type='index'
15018
+
15019
+  (0.3ms) CREATE UNIQUE INDEX "tindex_alangs_on_code" ON "alangs" ("code")
15020
+  (0.1ms) SELECT * FROM "langs"
15021
+  (1.0ms) DROP TABLE "langs"
15022
+  (0.2ms) CREATE TABLE "langs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(5) NOT NULL, "east" boolean DEFAULT 'f' NOT NULL, "position" integer DEFAULT 10000 NOT NULL, "enable" boolean DEFAULT 't' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
15023
+  (0.1ms)  SELECT sql
15024
+ FROM sqlite_master
15025
+ WHERE name='tindex_alangs_on_code' AND type='index'
15026
+ UNION ALL
15027
+ SELECT sql
15028
+ FROM sqlite_temp_master
15029
+ WHERE name='tindex_alangs_on_code' AND type='index'
15030
+ 
15031
+  (0.9ms) CREATE UNIQUE INDEX "index_langs_on_code" ON "langs" ("code")
15032
+  (0.0ms) SELECT * FROM "alangs"
15033
+  (0.1ms) DROP TABLE "alangs"
15034
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150814101311"]]
15035
+  (1.2ms) commit transaction
15036
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
15037
+  (0.1ms) SELECT sql
15038
+ FROM sqlite_master
15039
+ WHERE name='index_lang_texts_on_parent_id_and_lang_id' AND type='index'
15040
+ UNION ALL
15041
+ SELECT sql
15042
+ FROM sqlite_temp_master
15043
+ WHERE name='index_lang_texts_on_parent_id_and_lang_id' AND type='index'
15044
+
15045
+  (0.1ms)  SELECT sql
15046
+ FROM sqlite_master
15047
+ WHERE name='index_langs_on_code' AND type='index'
15048
+ UNION ALL
15049
+ SELECT sql
15050
+ FROM sqlite_temp_master
15051
+ WHERE name='index_langs_on_code' AND type='index'
15052
+ 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: we_bridge_rails_engine_langs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinjiro Itagaki
@@ -143,6 +143,7 @@ files:
143
143
  - app/views/langs/show.html.builder
144
144
  - config/routes.rb
145
145
  - db/migrate/20150803101150_create_langs.rb
146
+ - db/migrate/20150814101311_modify_lang_position_default.rb
146
147
  - db/seeds.rb
147
148
  - db/seeds/de.rb
148
149
  - db/seeds/de/de.txt