hstore_translate 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/README.md +6 -0
- data/lib/hstore_translate/translates.rb +14 -0
- data/lib/hstore_translate/version.rb +1 -1
- data/test/gemfiles/Gemfile.rails-3.1.x +3 -0
- data/test/gemfiles/Gemfile.rails-3.2.x +3 -0
- data/test/gemfiles/Gemfile.rails-4.0.x +3 -0
- metadata +11 -39
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZGQyYjIyN2M3YmQ4YjFkN2EwN2MzODhjMTU1ODBlMDA4YmNkNTg1OA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f0a61686dda6d3edff9b95e30d2492a653a881ce
|
4
|
+
data.tar.gz: ba1c0a328e0edb4aed2301eb625e1b6cb761558b
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZTY5YzA4MGQ4MDgxYzIzZTYwNDIwMzc2NTU4Mzg1YTZhMDljYzg1YjAyNjA0
|
11
|
-
OWE3ZTJhMzkxOTkwZjQ2MzA1ODczMzkwNWRhNjg1YzZjYTEyM2U=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
N2UzNDYyZjJmNDNmMTdhNzk4MjUxZDZjZDkwYWQ2Y2NhZjk5Zjc2ODEyM2Ez
|
14
|
-
MjUxZTc2ZTQyM2QxMGUyOWZkNTYwOTgwYzdmMmMwY2VlNGNkNDA2NmE3OTdm
|
15
|
-
MjgxYjA1ZWMyOThkMDA4MTdkOTgzZGFkOWY5NDVmYjgxZDY3MDA=
|
6
|
+
metadata.gz: 6b9acf482bd9278ed08558976f14fe545b51efb414d0e070740d72ea20fddb0f6c2f75ce39b50ba8aeac268718f1c3de161e971ebb43deb55e073a4864e7c7a5
|
7
|
+
data.tar.gz: 469ecfcbee5a65c63600de43e21fdba040f3fec1f916dc1d5a7e340fa6ebacce3384bef087faef36be0b02cf996b12403983e94ef33bb47a5cecc52611b647ba
|
data/README.md
CHANGED
@@ -27,6 +27,12 @@ gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
|
|
27
27
|
gem 'hstore_translate'
|
28
28
|
```
|
29
29
|
|
30
|
+
For ActiveRecord < 4.0 you'll also want to add:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
gem 'activerecord-postgres-hstore', '~> 0.7.0'
|
34
|
+
```
|
35
|
+
|
30
36
|
## Model translations
|
31
37
|
|
32
38
|
Model translations allow you to translate your models' attribute values. E.g.
|
@@ -86,6 +86,20 @@ module HstoreTranslate
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
# Internal: Parse a translated convenience accessor name.
|
90
|
+
#
|
91
|
+
# method_name - The accessor name.
|
92
|
+
#
|
93
|
+
# Examples
|
94
|
+
#
|
95
|
+
# parse_translated_attribute_accessor("title_en=")
|
96
|
+
# # => [:title, :en, true]
|
97
|
+
#
|
98
|
+
# parse_translated_attribute_accessor("title_fr")
|
99
|
+
# # => [:title, :fr, false]
|
100
|
+
#
|
101
|
+
# Returns the attribute name Symbol, locale Symbol, and a Boolean
|
102
|
+
# indicating whether or not the caller is attempting to assign a value.
|
89
103
|
def parse_translated_attribute_accessor(method_name)
|
90
104
|
return unless method_name =~ /\A([a-z_]+)_([a-z]{2})(=?)\z/
|
91
105
|
|
metadata
CHANGED
@@ -1,69 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hstore_translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Worley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: pg
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ! '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ! '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: activerecord
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- -
|
17
|
+
- - '>='
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: 3.1.0
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- -
|
24
|
+
- - '>='
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: 3.1.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: activerecord-postgres-hstore
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.7.0
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.7.0
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: rake
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
|
-
- -
|
31
|
+
- - '>='
|
60
32
|
- !ruby/object:Gem::Version
|
61
33
|
version: '0'
|
62
34
|
type: :development
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
|
-
- -
|
38
|
+
- - '>='
|
67
39
|
- !ruby/object:Gem::Version
|
68
40
|
version: '0'
|
69
41
|
- !ruby/object:Gem::Dependency
|
@@ -84,14 +56,14 @@ dependencies:
|
|
84
56
|
name: database_cleaner
|
85
57
|
requirement: !ruby/object:Gem::Requirement
|
86
58
|
requirements:
|
87
|
-
- -
|
59
|
+
- - '>='
|
88
60
|
- !ruby/object:Gem::Version
|
89
61
|
version: '0'
|
90
62
|
type: :development
|
91
63
|
prerelease: false
|
92
64
|
version_requirements: !ruby/object:Gem::Requirement
|
93
65
|
requirements:
|
94
|
-
- -
|
66
|
+
- - '>='
|
95
67
|
- !ruby/object:Gem::Version
|
96
68
|
version: '0'
|
97
69
|
description: Rails I18n library for ActiveRecord model/data translation using PostgreSQL's
|
@@ -123,17 +95,17 @@ require_paths:
|
|
123
95
|
- lib
|
124
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
97
|
requirements:
|
126
|
-
- -
|
98
|
+
- - '>='
|
127
99
|
- !ruby/object:Gem::Version
|
128
100
|
version: '0'
|
129
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
102
|
requirements:
|
131
|
-
- -
|
103
|
+
- - '>='
|
132
104
|
- !ruby/object:Gem::Version
|
133
105
|
version: '0'
|
134
106
|
requirements: []
|
135
107
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.0.6
|
137
109
|
signing_key:
|
138
110
|
specification_version: 4
|
139
111
|
summary: Rails I18n library for ActiveRecord model/data translation using PostgreSQL's
|