mobility 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +6 -2
- data/Gemfile.lock +59 -3
- data/README.md +9 -5
- data/lib/mobility/backend/active_record/key_value.rb +1 -1
- data/lib/mobility/backend/active_record/query_methods.rb +1 -1
- data/lib/mobility/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bb421026048d4880dc432cee0bbb14f04205b30
|
|
4
|
+
data.tar.gz: 1b17af3cadacee16f359d9954c330368426f4042
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e61e6725c7e9da3ca6cf1d52bab83d0db7ce2c44fe88a1dc93c24e5f07541811bd9e610c534d8df8558402ea2c4753d5b058e13e739550e71b1f5f1f7d602947
|
|
7
|
+
data.tar.gz: aa490f3b65ea4f0a16709f4e8aa4d4b964892efb20feaf404c405129baaa2618bf62daa5f515638170837a1857ca341c024426ca4f2526f1f92af8e3c46910ee
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## 0.1
|
|
4
4
|
|
|
5
|
+
### 0.1.16 (May 29, 2017)
|
|
6
|
+
* Fix deprecation warnings using class_name ([#32](https://github.com/shioyama/mobility/pull/32))
|
|
7
|
+
* Avoid using respond_to? on relation, to fix ImmutableRelation exception
|
|
8
|
+
([d3e974855f7e772b5df43f665a2251a1982cfff0](https://github.com/shioyama/mobility/commit/d3e974855f7e772b5df43f665a2251a1982cfff0).
|
|
9
|
+
|
|
5
10
|
### 0.1.15 (May 21, 2017)
|
|
6
11
|
* Add support for uniqueness validation ([#28](https://github.com/shioyama/mobility/pull/28))
|
|
7
12
|
* Inherit translated attributes in subclasses ([#30](https://github.com/shioyama/mobility/pull/30))
|
data/Gemfile
CHANGED
|
@@ -5,8 +5,12 @@ gemspec
|
|
|
5
5
|
|
|
6
6
|
group :development, :test do
|
|
7
7
|
if ENV['ORM'] == 'active_record'
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
if ENV['RAILS_VERSION'] == '5.1'
|
|
9
|
+
gem 'activerecord', '>= 5.1', '< 5.2'
|
|
10
|
+
else
|
|
11
|
+
gem 'activerecord', '>= 5.0', '< 5.1'
|
|
12
|
+
end
|
|
13
|
+
gem "generator_spec", '~> 0.9.4'
|
|
10
14
|
end
|
|
11
15
|
|
|
12
16
|
if ENV['ORM'] == 'sequel'
|
data/Gemfile.lock
CHANGED
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mobility (0.1.
|
|
4
|
+
mobility (0.1.15)
|
|
5
5
|
i18n (>= 0.6.10, < 0.9)
|
|
6
6
|
request_store (~> 1.0)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
+
actionpack (5.0.3)
|
|
12
|
+
actionview (= 5.0.3)
|
|
13
|
+
activesupport (= 5.0.3)
|
|
14
|
+
rack (~> 2.0)
|
|
15
|
+
rack-test (~> 0.6.3)
|
|
16
|
+
rails-dom-testing (~> 2.0)
|
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
18
|
+
actionview (5.0.3)
|
|
19
|
+
activesupport (= 5.0.3)
|
|
20
|
+
builder (~> 3.1)
|
|
21
|
+
erubis (~> 2.7.0)
|
|
22
|
+
rails-dom-testing (~> 2.0)
|
|
23
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
|
24
|
+
activemodel (5.0.3)
|
|
25
|
+
activesupport (= 5.0.3)
|
|
26
|
+
activerecord (5.0.3)
|
|
27
|
+
activemodel (= 5.0.3)
|
|
28
|
+
activesupport (= 5.0.3)
|
|
29
|
+
arel (~> 7.0)
|
|
30
|
+
activesupport (5.0.3)
|
|
31
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
32
|
+
i18n (~> 0.7)
|
|
33
|
+
minitest (~> 5.1)
|
|
34
|
+
tzinfo (~> 1.1)
|
|
35
|
+
arel (7.1.4)
|
|
36
|
+
builder (3.2.3)
|
|
11
37
|
byebug (9.0.6)
|
|
12
38
|
coderay (1.1.1)
|
|
13
|
-
|
|
39
|
+
concurrent-ruby (1.0.5)
|
|
40
|
+
database_cleaner (1.6.1)
|
|
14
41
|
diff-lcs (1.3)
|
|
42
|
+
erubis (2.7.0)
|
|
15
43
|
ffi (1.9.18)
|
|
16
44
|
formatador (0.2.5)
|
|
45
|
+
generator_spec (0.9.4)
|
|
46
|
+
activesupport (>= 3.0.0)
|
|
47
|
+
railties (>= 3.0.0)
|
|
17
48
|
guard (2.14.1)
|
|
18
49
|
formatador (>= 0.2.4)
|
|
19
50
|
listen (>= 2.7, < 4.0)
|
|
@@ -33,10 +64,16 @@ GEM
|
|
|
33
64
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
34
65
|
rb-inotify (~> 0.9, >= 0.9.7)
|
|
35
66
|
ruby_dep (~> 1.2)
|
|
67
|
+
loofah (2.0.3)
|
|
68
|
+
nokogiri (>= 1.5.9)
|
|
36
69
|
lumberjack (1.0.12)
|
|
37
70
|
method_source (0.8.2)
|
|
71
|
+
mini_portile2 (2.1.0)
|
|
72
|
+
minitest (5.10.2)
|
|
38
73
|
mysql2 (0.3.21)
|
|
39
74
|
nenv (0.3.0)
|
|
75
|
+
nokogiri (1.7.2)
|
|
76
|
+
mini_portile2 (~> 2.1.0)
|
|
40
77
|
notiffany (0.1.1)
|
|
41
78
|
nenv (~> 0.1)
|
|
42
79
|
shellany (~> 0.0)
|
|
@@ -48,6 +85,20 @@ GEM
|
|
|
48
85
|
pry-byebug (3.4.2)
|
|
49
86
|
byebug (~> 9.0)
|
|
50
87
|
pry (~> 0.10)
|
|
88
|
+
rack (2.0.3)
|
|
89
|
+
rack-test (0.6.3)
|
|
90
|
+
rack (>= 1.0)
|
|
91
|
+
rails-dom-testing (2.0.3)
|
|
92
|
+
activesupport (>= 4.2.0)
|
|
93
|
+
nokogiri (>= 1.6)
|
|
94
|
+
rails-html-sanitizer (1.0.3)
|
|
95
|
+
loofah (~> 2.0)
|
|
96
|
+
railties (5.0.3)
|
|
97
|
+
actionpack (= 5.0.3)
|
|
98
|
+
activesupport (= 5.0.3)
|
|
99
|
+
method_source
|
|
100
|
+
rake (>= 0.8.7)
|
|
101
|
+
thor (>= 0.18.1, < 2.0)
|
|
51
102
|
rake (10.5.0)
|
|
52
103
|
rb-fsevent (0.9.8)
|
|
53
104
|
rb-inotify (0.9.8)
|
|
@@ -71,14 +122,19 @@ GEM
|
|
|
71
122
|
slop (3.6.0)
|
|
72
123
|
sqlite3 (1.3.13)
|
|
73
124
|
thor (0.19.4)
|
|
125
|
+
thread_safe (0.3.6)
|
|
126
|
+
tzinfo (1.2.3)
|
|
127
|
+
thread_safe (~> 0.1)
|
|
74
128
|
yard (0.9.9)
|
|
75
129
|
|
|
76
130
|
PLATFORMS
|
|
77
131
|
ruby
|
|
78
132
|
|
|
79
133
|
DEPENDENCIES
|
|
134
|
+
activerecord (>= 5.0, < 5.1)
|
|
80
135
|
bundler (~> 1.12)
|
|
81
136
|
database_cleaner (~> 1.5, >= 1.5.3)
|
|
137
|
+
generator_spec (~> 0.9.4)
|
|
82
138
|
guard-rspec
|
|
83
139
|
mobility!
|
|
84
140
|
mysql2 (~> 0.3.10)
|
|
@@ -90,4 +146,4 @@ DEPENDENCIES
|
|
|
90
146
|
yard (~> 0.9.0)
|
|
91
147
|
|
|
92
148
|
BUNDLED WITH
|
|
93
|
-
1.
|
|
149
|
+
1.15.0
|
data/README.md
CHANGED
|
@@ -21,10 +21,11 @@ different languages.
|
|
|
21
21
|
Storage of translations is handled by customizable "backends" which encapsulate
|
|
22
22
|
different storage strategies. The default, preferred way to store translations
|
|
23
23
|
is to put them all in a set of two shared tables, but many alternatives are
|
|
24
|
-
also supported, including translatable
|
|
25
|
-
|
|
26
|
-
[
|
|
27
|
-
|
|
24
|
+
also supported, including [translatable
|
|
25
|
+
columns](http://dejimata.com/2017/3/3/translating-with-mobility#strategy-1) and
|
|
26
|
+
[model translation
|
|
27
|
+
tables](http://dejimata.com/2017/3/3/translating-with-mobility#strategy-2), as
|
|
28
|
+
well as database-specific storage solutions such as
|
|
28
29
|
[jsonb](https://www.postgresql.org/docs/current/static/datatype-json.html ) and
|
|
29
30
|
[Hstore](https://www.postgresql.org/docs/current/static/hstore.html) (for
|
|
30
31
|
PostgreSQL).
|
|
@@ -46,7 +47,7 @@ Installation
|
|
|
46
47
|
Add this line to your application's Gemfile:
|
|
47
48
|
|
|
48
49
|
```ruby
|
|
49
|
-
gem 'mobility', '~> 0.1.
|
|
50
|
+
gem 'mobility', '~> 0.1.16'
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
To translate attributes on a model, include (or extend) `Mobility`, then call
|
|
@@ -57,6 +58,9 @@ To translate attributes on a model, include (or extend) `Mobility`, then call
|
|
|
57
58
|
Requirements:
|
|
58
59
|
- ActiveRecord >= 5.0
|
|
59
60
|
|
|
61
|
+
Using Mobility with Rails 5.1 will currently result in some deprecation
|
|
62
|
+
warnings. This will be fixed soon.
|
|
63
|
+
|
|
60
64
|
(Support for some backends is also supported with ActiveRecord/Rails 4.2, see
|
|
61
65
|
the [active_record-4.2
|
|
62
66
|
branch](https://github.com/shioyama/mobility/tree/active_record_4.2).)
|
|
@@ -78,7 +78,7 @@ Implements the {Mobility::Backend::KeyValue} backend for ActiveRecord models.
|
|
|
78
78
|
|
|
79
79
|
has_many association_name, ->{ where key: association_attributes },
|
|
80
80
|
as: :translatable,
|
|
81
|
-
class_name: translations_class,
|
|
81
|
+
class_name: translations_class.name,
|
|
82
82
|
inverse_of: :translatable,
|
|
83
83
|
autosave: true
|
|
84
84
|
before_save do
|
|
@@ -20,7 +20,7 @@ models. For details see backend-specific subclasses.
|
|
|
20
20
|
# @note Only want to define this once, even if multiple QueryMethods
|
|
21
21
|
# modules are included, so define it here in extended method
|
|
22
22
|
def extended(relation)
|
|
23
|
-
unless relation.
|
|
23
|
+
unless relation.methods(false).include?(:mobility_where_chain)
|
|
24
24
|
relation.define_singleton_method(:mobility_where_chain) do
|
|
25
25
|
@mobility_where_chain ||= Class.new(::ActiveRecord::QueryMethods::WhereChain)
|
|
26
26
|
end
|
data/lib/mobility/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mobility
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Salzberg
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-05-
|
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: request_store
|