human_urls 0.1.2 → 0.1.3.pre.alpha.0

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: 13699c5955926c5c88ebcebd384e80a28edc35da
4
- data.tar.gz: 29ed0b56910652b1025224c392db2558feb71adb
3
+ metadata.gz: 7b7a18ae4c2f218111f90f0d24c2f29b71f71a55
4
+ data.tar.gz: edeb13366c7d16750ef93cddc82244fa39be910d
5
5
  SHA512:
6
- metadata.gz: 20c8b148b563e514a1dc02010fa7ec64f9baf3dec47665f514b9c9387a8fe88c545d7da397c3d19120b456197f6f165b218f90b6bb59dbc4244a4ddac07cd85b
7
- data.tar.gz: 05e9864252f3e6b3f63f51df0730c8c706e2793f67eb25c0b37cfc5790fc9a4f772bf9b9b3a526a0f76e9330d77a0028d06a48f444fcf4308f094bbae8769fe7
6
+ metadata.gz: 47926910380b870dc616cb498a5155b9078ebafc05f71f097de7b9fa1178afb3dc540fc7a38015e621ca62cdbad3298716d16038a5b6a0d4471ac37a73c9330a
7
+ data.tar.gz: db5bca0240d3a0d809e115b356fda479ede9d485517db28b9b1f66f0e6cfcd157c1595ee904d5913f52454d2a183b1b06cb592dc92ac72d75011eba029b2c357
@@ -10,7 +10,6 @@ module HumanUrls
10
10
  module ClassMethods
11
11
  def sluggify(slug_param=:slug, generated_from: false)
12
12
  validates_presence_of slug_param
13
- validates_uniqueness_of slug_param, case_sensitive: false
14
13
  validates_length_of slug_param, maximum: 244
15
14
 
16
15
  define_method(:to_param) do
@@ -1,3 +1,3 @@
1
1
  module HumanUrls
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3-alpha.0"
3
3
  end
@@ -5312,3 +5312,75 @@ HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration_w
5312
5312
  HumanUrlsTest: test_truth
5313
5313
  -------------------------
5314
5314
   (0.2ms) ROLLBACK
5315
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
5316
+  (0.3ms) BEGIN
5317
+ -------------------------
5318
+ HumanUrlsTest: test_truth
5319
+ -------------------------
5320
+  (0.3ms) ROLLBACK
5321
+  (0.2ms) BEGIN
5322
+ ------------------------------------------------------------------------------------------------------------
5323
+ HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration_when_using_custom_slug_column
5324
+ ------------------------------------------------------------------------------------------------------------
5325
+  (0.3ms) ROLLBACK
5326
+  (0.2ms) BEGIN
5327
+ ------------------------------------------------------------------------------
5328
+ HumanUrls::SlugMigrationGeneratorTest: test_generator_creates_proper_migration
5329
+ ------------------------------------------------------------------------------
5330
+  (0.3ms) ROLLBACK
5331
+  (0.2ms) BEGIN
5332
+ ------------------------------------------------------------------------
5333
+ SluggableTest: test_slug_properly_formats_string_to_slug_friendly_format
5334
+ ------------------------------------------------------------------------
5335
+  (0.4ms) SAVEPOINT active_record_1
5336
+ SQL (3.0ms) INSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["slug", "this-i-my-slug"], ["created_at", "2016-02-13 02:10:36.981768"], ["updated_at", "2016-02-13 02:10:36.981768"]]
5337
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5338
+  (0.3ms) ROLLBACK
5339
+  (0.2ms) BEGIN
5340
+ ----------------------------------------------
5341
+ SluggableTest: test_#to_param_returns_the_slug
5342
+ ----------------------------------------------
5343
+  (0.2ms) SAVEPOINT active_record_1
5344
+ SQL (0.6ms) INSERT INTO "taggables" ("slug", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["slug", "slug"], ["created_at", "2016-02-13 02:10:36.993732"], ["updated_at", "2016-02-13 02:10:36.993732"]]
5345
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5346
+  (0.2ms) ROLLBACK
5347
+  (0.2ms) BEGIN
5348
+ -----------------------------------------------------------------------------------
5349
+ SluggableTest: test_slug_does_not_update_an_existing_slug_when_source_field_changes
5350
+ -----------------------------------------------------------------------------------
5351
+  (0.4ms) SAVEPOINT active_record_1
5352
+ SQL (0.9ms) INSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", "2016-02-13 02:10:37.009590"], ["updated_at", "2016-02-13 02:10:37.009590"]]
5353
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5354
+  (0.2ms) SAVEPOINT active_record_1
5355
+ SQL (0.7ms) UPDATE "taggable_w_generated_slugs" SET "title" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3 [["title", "Changed Title"], ["updated_at", "2016-02-13 02:10:37.013975"], ["id", 64]]
5356
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5357
+  (0.2ms) ROLLBACK
5358
+  (0.2ms) BEGIN
5359
+ ------------------------------------------------------------------------------
5360
+ SluggableTest: test_slug_properly_updates_an_existing_slug_when_auto_generated
5361
+ ------------------------------------------------------------------------------
5362
+  (0.2ms) SAVEPOINT active_record_1
5363
+ SQL (0.4ms) INSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["title", "my-title"], ["slug", "my-old-slug"], ["created_at", "2016-02-13 02:10:37.023940"], ["updated_at", "2016-02-13 02:10:37.023940"]]
5364
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5365
+  (0.2ms) SAVEPOINT active_record_1
5366
+ SQL (0.5ms) UPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3 [["slug", "my-new-slug"], ["updated_at", "2016-02-13 02:10:37.026620"], ["id", 65]]
5367
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5368
+  (0.2ms) SAVEPOINT active_record_1
5369
+ SQL (0.9ms) UPDATE "taggable_w_generated_slugs" SET "slug" = $1, "updated_at" = $2 WHERE "taggable_w_generated_slugs"."id" = $3 [["slug", "my-title"], ["updated_at", "2016-02-13 02:10:37.030511"], ["id", 65]]
5370
+  (0.4ms) RELEASE SAVEPOINT active_record_1
5371
+  (0.3ms) ROLLBACK
5372
+  (0.2ms) BEGIN
5373
+ --------------------------------------------------------------------
5374
+ SluggableTest: test_.sluggify_can_generate_slug_from_given_attribute
5375
+ --------------------------------------------------------------------
5376
+  (0.1ms) SAVEPOINT active_record_1
5377
+ SQL (0.4ms) INSERT INTO "taggable_w_generated_slugs" ("title", "slug", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["title", "My Title"], ["slug", "my-title"], ["created_at", "2016-02-13 02:10:37.035854"], ["updated_at", "2016-02-13 02:10:37.035854"]]
5378
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5379
+  (0.1ms) ROLLBACK
5380
+  (0.1ms) BEGIN
5381
+ ----------------------------------------------
5382
+ SluggableTest: test_validates_presence_of_slug
5383
+ ----------------------------------------------
5384
+  (0.1ms) SAVEPOINT active_record_1
5385
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
5386
+  (0.1ms) ROLLBACK
@@ -0,0 +1,6 @@
1
+ class AddSlugToPosts< ActiveRecord::Migration
2
+ def change
3
+ add_column :posts, :slug, :string
4
+ add_index :posts, :slug, unique: true
5
+ end
6
+ end
@@ -20,18 +20,6 @@ class SluggableTest < ActiveSupport::TestCase
20
20
  assert_match(/Validation failed: Slug can't be blank/, exp.message)
21
21
  end
22
22
 
23
- test "validates unqiueness of slug" do
24
- Taggable.create!(slug: "slug")
25
- exp = assert_raises { Taggable.create!(slug: "slug") }
26
- assert_match(/Slug has already been taken/, exp.message)
27
- end
28
-
29
- test "validates unqiueness of slug and isn't case sensitive" do
30
- Taggable.create!(slug: "Slug")
31
- exp = assert_raises { Taggable.create!(slug: "slug") }
32
- assert_match(/Slug has already been taken/, exp.message)
33
- end
34
-
35
23
  test "slug properly formats string to slug friendly format" do
36
24
  taggable = Taggable.create!(slug: "This i$ my SLUG")
37
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: human_urls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3.pre.alpha.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Klina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-12 00:00:00.000000000 Z
11
+ date: 2016-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -122,7 +122,7 @@ files:
122
122
  - test/dummy/public/422.html
123
123
  - test/dummy/public/500.html
124
124
  - test/dummy/public/favicon.ico
125
- - test/dummy/tmp/generators/db/migrate/20160212014003_add_slug_to_posts.rb
125
+ - test/dummy/tmp/generators/db/migrate/20160213021036_add_slug_to_posts.rb
126
126
  - test/human_urls/sluggable_test.rb
127
127
  - test/human_urls_test.rb
128
128
  - test/lib/generators/human_urls/slug_migration_generator_test.rb
@@ -142,9 +142,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: 2.0.0
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">="
145
+ - - ">"
146
146
  - !ruby/object:Gem::Version
147
- version: '0'
147
+ version: 1.3.1
148
148
  requirements: []
149
149
  rubyforge_project:
150
150
  rubygems_version: 2.4.5
@@ -189,7 +189,7 @@ test_files:
189
189
  - test/dummy/public/favicon.ico
190
190
  - test/dummy/Rakefile
191
191
  - test/dummy/README.rdoc
192
- - test/dummy/tmp/generators/db/migrate/20160212014003_add_slug_to_posts.rb
192
+ - test/dummy/tmp/generators/db/migrate/20160213021036_add_slug_to_posts.rb
193
193
  - test/human_urls/sluggable_test.rb
194
194
  - test/human_urls_test.rb
195
195
  - test/lib/generators/human_urls/slug_migration_generator_test.rb
@@ -1,6 +0,0 @@
1
- class AddSlugToPosts< ActiveRecord::Migration
2
- def change
3
- add_column :posts, :url, :string
4
- add_index :posts, :url, unique: true
5
- end
6
- end