translatable_records 1.1.4 → 1.1.6

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: b61704d024336a4509d9708a771599cee26caa2a
4
- data.tar.gz: 6a43167a74eb0f957779fc579a95f434dc6a3c6c
3
+ metadata.gz: f560f491f1cf29d0ee2783eefb6cabaa9827cb15
4
+ data.tar.gz: dd933b80c964c7dd4005b0b6a71185b59d07309a
5
5
  SHA512:
6
- metadata.gz: 3e2557a55fec2e33959ee5f08b1c7f36d9835cacdaa1dca0033d9900fa29244d443eb64bb7e02ee8390493ca5616275a91ddc1afcac49aff97b6e1157f5afbfe
7
- data.tar.gz: 55520113d806276d960f04884bd0c88beef632cea5c83920911c3b8051c448637aa5d084cfcbc6806e57cef0ce4f6f30d85e044b41dfb9581a48564347b1daa8
6
+ metadata.gz: c14ac3277533a56e4328992bca679ad24dbb2d46c2204b8c4ad12b9405a36abbf4341654a74b8339ba7875b6c2682a6a2b0a7d8c09797dba8659201e920d2ff8
7
+ data.tar.gz: fa56be64d0c590aa0a197582882013c40b05f604c055ff2b02cb81de3d9c530c6f2ee7307d03e008613036f31511e373ddcd75b62238f5f8ff561c9dc3b4ec50
@@ -2,7 +2,7 @@ class <%= "#{class_name}Translation" %> < ActiveRecord::Base
2
2
 
3
3
  belongs_to <%= ":#{singular_table_name}" %>
4
4
 
5
- validates :locale, presence: true
6
- validates <%= ":#{singular_table_name}_id" %>, uniqueness: { scope: :locale }
5
+ validates_presence_of :locale
6
+ validates_uniqueness_of <%= ":#{singular_table_name}_id" %>, scope: :locale
7
7
 
8
8
  end
@@ -1,5 +1,5 @@
1
1
  module TranslatableRecords
2
2
 
3
- VERSION = '1.1.4'
3
+ VERSION = '1.1.6'
4
4
 
5
5
  end
@@ -1,4 +1,3 @@
1
1
  class Model < ActiveRecord::Base
2
- attr_accessible :name if Rails::VERSION::MAJOR < 4
3
2
  attr_translatable :name
4
3
  end
@@ -2,7 +2,7 @@ class ModelTranslation < ActiveRecord::Base
2
2
 
3
3
  belongs_to :models
4
4
 
5
- validates :locale, presence: true
6
- validates :model_id, uniqueness: { scope: :locale }
5
+ validates_presence_of :locale
6
+ validates_uniqueness_of :model_id, scope: :locale
7
7
 
8
8
  end
@@ -5343,3 +5343,98 @@ RecordsTest: test_associated_translation_creation
5343
5343
  SQL (0.1ms) INSERT INTO "model_translations" ("locale", "name", "model_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["locale", "en"], ["name", "name"], ["model_id", 1], ["created_at", "2015-02-15 21:11:03.135716"], ["updated_at", "2015-02-15 21:11:03.135716"]]
5344
5344
   (0.1ms) RELEASE SAVEPOINT active_record_1
5345
5345
   (0.1ms) rollback transaction
5346
+  (0.2ms) CREATE TABLE "model_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "model_id" integer, "locale" varchar, "name" varchar, "created_at" datetime, "updated_at" datetime) 
5347
+  (0.1ms) select sqlite_version(*)
5348
+  (0.1ms) CREATE INDEX "index_model_translations_on_locale" ON "model_translations" ("locale")
5349
+  (0.1ms) SELECT sql
5350
+ FROM sqlite_master
5351
+ WHERE name='index_model_translations_on_locale' AND type='index'
5352
+ UNION ALL
5353
+ SELECT sql
5354
+ FROM sqlite_temp_master
5355
+ WHERE name='index_model_translations_on_locale' AND type='index'
5356
+
5357
+  (0.1ms) CREATE INDEX "index_model_translations_on_model_id" ON "model_translations" ("model_id")
5358
+  (0.1ms) CREATE TABLE "models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)
5359
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
5360
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5361
+  (0.0ms) SELECT version FROM "schema_migrations"
5362
+  (0.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20130819165249')
5363
+  (0.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20130819155126')
5364
+  (0.3ms) CREATE TABLE "model_translations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "model_id" integer, "locale" varchar, "name" varchar, "created_at" datetime, "updated_at" datetime) 
5365
+  (0.0ms) select sqlite_version(*)
5366
+  (0.1ms) CREATE INDEX "index_model_translations_on_locale" ON "model_translations" ("locale")
5367
+  (0.1ms) SELECT sql
5368
+ FROM sqlite_master
5369
+ WHERE name='index_model_translations_on_locale' AND type='index'
5370
+ UNION ALL
5371
+ SELECT sql
5372
+ FROM sqlite_temp_master
5373
+ WHERE name='index_model_translations_on_locale' AND type='index'
5374
+
5375
+  (0.1ms) CREATE INDEX "index_model_translations_on_model_id" ON "model_translations" ("model_id")
5376
+  (0.1ms) CREATE TABLE "models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime)
5377
+  (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
5378
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5379
+  (0.0ms) SELECT version FROM "schema_migrations"
5380
+  (0.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20130819165249')
5381
+  (0.1ms) begin transaction
5382
+ -------------------------------------------------
5383
+ RecordsTest: test_associated_translation_creation
5384
+ -------------------------------------------------
5385
+  (0.1ms) SAVEPOINT active_record_1
5386
+ ModelTranslation Exists (0.1ms) SELECT 1 AS one FROM "model_translations" WHERE ("model_translations"."model_id" IS NULL AND "model_translations"."locale" = 'en') LIMIT 1
5387
+ SQL (0.1ms) INSERT INTO "models" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-03 23:32:49.407786"], ["updated_at", "2015-07-03 23:32:49.407786"]]
5388
+ SQL (0.1ms) INSERT INTO "model_translations" ("locale", "name", "model_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["locale", "en"], ["name", "name"], ["model_id", 1], ["created_at", "2015-07-03 23:32:49.408761"], ["updated_at", "2015-07-03 23:32:49.408761"]]
5389
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5390
+  (12.0ms) rollback transaction
5391
+  (0.1ms) begin transaction
5392
+ -------------------------------
5393
+ RecordsTest: test_locale_change
5394
+ -------------------------------
5395
+  (0.0ms) SAVEPOINT active_record_1
5396
+ ModelTranslation Exists (0.1ms) SELECT 1 AS one FROM "model_translations" WHERE ("model_translations"."model_id" IS NULL AND "model_translations"."locale" = 'en') LIMIT 1
5397
+ SQL (0.0ms) INSERT INTO "models" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-03 23:32:49.424201"], ["updated_at", "2015-07-03 23:32:49.424201"]]
5398
+ SQL (0.0ms) INSERT INTO "model_translations" ("locale", "name", "model_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["locale", "en"], ["name", "name"], ["model_id", 1], ["created_at", "2015-07-03 23:32:49.424748"], ["updated_at", "2015-07-03 23:32:49.424748"]]
5399
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5400
+ ModelTranslation Load (0.1ms) SELECT "model_translations".* FROM "model_translations" WHERE "model_translations"."model_id" = ? AND "model_translations"."locale" = ? LIMIT 1 [["model_id", 1], ["locale", "es"]]
5401
+ ModelTranslation Load (0.1ms) SELECT "model_translations".* FROM "model_translations" WHERE "model_translations"."model_id" = ? AND "model_translations"."locale" = ? LIMIT 1 [["model_id", 1], ["locale", "es"]]
5402
+  (0.0ms) SAVEPOINT active_record_1
5403
+ ModelTranslation Exists (0.1ms) SELECT 1 AS one FROM "model_translations" WHERE ("model_translations"."model_id" = 1 AND "model_translations"."locale" = 'es') LIMIT 1
5404
+ SQL (0.1ms) INSERT INTO "model_translations" ("locale", "name", "model_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["locale", "es"], ["name", "new name"], ["model_id", 1], ["created_at", "2015-07-03 23:32:49.438761"], ["updated_at", "2015-07-03 23:32:49.438761"]]
5405
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5406
+  (0.0ms) rollback transaction
5407
+  (0.0ms) begin transaction
5408
+ -------------------------------------------------
5409
+ RecordsTest: test_associated_translation_deletion
5410
+ -------------------------------------------------
5411
+  (0.0ms) SAVEPOINT active_record_1
5412
+ ModelTranslation Exists (0.0ms) SELECT 1 AS one FROM "model_translations" WHERE ("model_translations"."model_id" IS NULL AND "model_translations"."locale" = 'en') LIMIT 1
5413
+ SQL (0.0ms) INSERT INTO "models" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-03 23:32:49.441097"], ["updated_at", "2015-07-03 23:32:49.441097"]]
5414
+ SQL (0.0ms) INSERT INTO "model_translations" ("locale", "name", "model_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["locale", "en"], ["name", "name"], ["model_id", 1], ["created_at", "2015-07-03 23:32:49.441565"], ["updated_at", "2015-07-03 23:32:49.441565"]]
5415
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5416
+  (0.0ms) SAVEPOINT active_record_1
5417
+ SQL (0.0ms) DELETE FROM "model_translations" WHERE "model_translations"."id" = ? [["id", 1]]
5418
+ SQL (0.0ms) DELETE FROM "models" WHERE "models"."id" = ? [["id", 1]]
5419
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5420
+ ModelTranslation Load (0.1ms) SELECT "model_translations".* FROM "model_translations" WHERE "model_translations"."model_id" = ? LIMIT 1 [["model_id", 1]]
5421
+  (0.1ms) rollback transaction
5422
+  (0.0ms) begin transaction
5423
+ ------------------------------------------------
5424
+ RecordsTest: test_associated_translation_edition
5425
+ ------------------------------------------------
5426
+  (0.0ms) SAVEPOINT active_record_1
5427
+ ModelTranslation Exists (0.1ms) SELECT 1 AS one FROM "model_translations" WHERE ("model_translations"."model_id" IS NULL AND "model_translations"."locale" = 'en') LIMIT 1
5428
+ SQL (0.0ms) INSERT INTO "models" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2015-07-03 23:32:49.447613"], ["updated_at", "2015-07-03 23:32:49.447613"]]
5429
+ SQL (0.0ms) INSERT INTO "model_translations" ("locale", "name", "model_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["locale", "en"], ["name", "name"], ["model_id", 1], ["created_at", "2015-07-03 23:32:49.448191"], ["updated_at", "2015-07-03 23:32:49.448191"]]
5430
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5431
+  (0.0ms) SAVEPOINT active_record_1
5432
+ ModelTranslation Exists (0.1ms) SELECT 1 AS one FROM "model_translations" WHERE ("model_translations"."model_id" = 1 AND "model_translations"."id" != 1 AND "model_translations"."locale" = 'en') LIMIT 1
5433
+ SQL (0.1ms) UPDATE "model_translations" SET "name" = ?, "updated_at" = ? WHERE "model_translations"."id" = ? [["name", "new name"], ["updated_at", "2015-07-03 23:32:49.450220"], ["id", 1]]
5434
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5435
+  (0.0ms) rollback transaction
5436
+  (0.0ms) begin transaction
5437
+ -------------------------------------
5438
+ GeneratorsTest: test_files_generation
5439
+ -------------------------------------
5440
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: translatable_records
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Museways
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-15 00:00:00.000000000 Z
11
+ date: 2015-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,9 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.0
20
- - - "<="
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 4.2.0
22
+ version: 4.3.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +27,9 @@ dependencies:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 4.0.0
30
- - - "<="
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 4.2.0
32
+ version: 4.3.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sqlite3
35
35
  requirement: !ruby/object:Gem::Requirement