friendly_id-mobility 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: eb6a5bb8543453a82c0e904a16cc7413e4fb4debe749ac80625d8c8dfd980315
4
- data.tar.gz: 45a83bd377e9a3fb0c3af48662801aea35e1a4a10447d68bce843fbda08705ca
3
+ metadata.gz: 04e899ca7fccbde715e312d131d3234c507fb388c11ae6cf2fea9aca0d07b18c
4
+ data.tar.gz: d179dda1a53c65d19aa094e9af3f8450bf385e2293d5ec84a54b643ca72a6d0d
5
5
  SHA512:
6
- metadata.gz: 8aa29d1e6a03307595897b8a3e1266ee7c5b1254d96dfb966ab17c92abfba3b251e8cf6eb7c63feab79f609820d6ed4d933c9354fce0c23e3201a6b4a9967247
7
- data.tar.gz: 348a2964552f2c828385193fff36a136d4c582bbde0e2768541743dcad1217edcdd365495de937a5c3a0b62e4575a5d190506dfc3d065f62cd02208d2148c996
6
+ metadata.gz: e30cdda75e3850bc631f5197683c0b4fbdb7ada21c3b5203dc11043f896ce616730d44e0f7468073970f7bf0dd51f61a7033d02c776a9e635ea05a5d6f8c780f
7
+ data.tar.gz: cc19d88058cda9ea0dbaf6ddde380ca7533c9289fa4194e464d7cf8d0959a6cae47e436f8d2a166b8e1fa8a1bceec7d5793ed103078882b28779a613a8a36ccc
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## 1.0
4
4
 
5
+ ### 1.0.2
6
+
7
+ * Depend on Mobility 1.0.1 to avoid need for `const_get`
8
+ ([#25](https://github.com/shioyama/friendly_id-mobility/pull/25/files))
9
+
5
10
  ### 1.0.1
6
11
 
7
12
  * Update friendly_id dependency ([#21](https://github.com/shioyama/friendly_id-mobility/pull/21))
data/README.md CHANGED
@@ -18,7 +18,7 @@ Installation
18
18
  Add this line to your application's Gemfile:
19
19
 
20
20
  ```ruby
21
- gem 'friendly_id-mobility', '~> 1.0.1'
21
+ gem 'friendly_id-mobility', '~> 1.0.2'
22
22
  ```
23
23
 
24
24
  And then execute:
@@ -27,19 +27,27 @@ And then execute:
27
27
  bundle
28
28
  ```
29
29
 
30
- Or install it yourself as:
30
+ Then run the Mobility generator:
31
31
 
32
32
  ```
33
- gem install friendly_id-mobility
33
+ rails generate mobility:install
34
34
  ```
35
35
 
36
- Run the Mobility generator:
36
+ This will generate an initializer for Mobility. To ensure that FriendlyId sees
37
+ changes correctly on attributes, enable (uncomment) the `dirty` plugin line in
38
+ your Mobility configuration:
37
39
 
38
- ```
39
- rails generate mobility:install
40
+ ```ruby
41
+ Mobility.configure do
42
+ plugins do
43
+ # ...
44
+ dirty
45
+ # ...
46
+ end
47
+ end
40
48
  ```
41
49
 
42
- Run the FriendlyId generator:
50
+ Next, run the FriendlyId generator:
43
51
 
44
52
  ```
45
53
  rails generate friendly_id
@@ -99,7 +107,7 @@ You can also translate both slug and base attribute:
99
107
  ```ruby
100
108
  class Article < ActiveRecord::Base
101
109
  extend Mobility
102
- translates :slug, :title, dirty: true
110
+ translates :slug, :title
103
111
 
104
112
  extend FriendlyId
105
113
  friendly_id :title, use: :mobility
@@ -125,10 +133,6 @@ article.slug
125
133
  #=> "my-foo-title"
126
134
  ```
127
135
 
128
- Setting `dirty: true` on the translated base attribute is recommended in order
129
- to ensure that changes in any locale trigger updates to the slug in that
130
- locale.
131
-
132
136
  ### Friendly Finders with Translated Attributes
133
137
 
134
138
  The Mobility `i18n` scope is mixed into the `friendly` scope for models which
@@ -156,7 +160,7 @@ calling `friendly_id` from your model:
156
160
  ```ruby
157
161
  class Article < ActiveRecord::Base
158
162
  extend Mobility
159
- translates :slug, :title, dirty: true
163
+ translates :slug, :title
160
164
 
161
165
  extend FriendlyId
162
166
  friendly_id :title, use: [:history, :mobility]
@@ -23,8 +23,7 @@ module FriendlyId
23
23
 
24
24
  mod = Module.new do
25
25
  def friendly
26
- # TODO: Make this constant public in Mobility 1.1 so we don't need const_get
27
- super.extending(::Mobility::Plugins::ActiveRecord::Query.const_get(:QueryExtension))
26
+ super.extending(::Mobility::Plugins::ActiveRecord::Query::QueryExtension)
28
27
  end
29
28
  end
30
29
  model_class.send :extend, mod
@@ -1,5 +1,5 @@
1
1
  module FriendlyId
2
2
  module Mobility
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_id-mobility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-17 00:00:00.000000000 Z
11
+ date: 2020-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mobility
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.0.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '2.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.0
29
+ version: 1.0.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '2.0'