activerecord-postgres-composite-types 0.2.1 → 0.2.2
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/README.rdoc +4 -5
- data/VERSION +1 -1
- data/activerecord-postgres-composite-types.gemspec +2 -4
- data/lib/activerecord-postgres-composite-types/active_record.rb +1 -1
- data/lib/activerecord-postgres-composite-types/active_record_3.rb +1 -1
- metadata +2 -4
- data/LICENSE.txt +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a672371db2d4c5253b4d0366fffacb81ca9a1f9
|
4
|
+
data.tar.gz: 95d2bc56e7de9667483dbff0b820b8a56c67b064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 996d82110e931d65a4d7ebff634614240f88f3c099b5daee3feda515ee670c14f6c60593b629d772e9bfc2bb7a369a04a59c379f919001fc39072f89ac2ad15d
|
7
|
+
data.tar.gz: db42a073c0563bafe9bd25d7c486e84cdc26df04a8e0a2e9fca6dae4020e21deb10f3db6275ea162a4627eaf835a2bb6e171cb32cfc827d56098d357117d0f6d
|
data/README.rdoc
CHANGED
@@ -20,13 +20,13 @@ But there is no support for user defined composite types.
|
|
20
20
|
|
21
21
|
== The Goal
|
22
22
|
|
23
|
-
|
23
|
+
I would like to be able to access data from table like this:
|
24
24
|
|
25
25
|
create_table :foos, :id => false do |t|
|
26
26
|
t.column :comp, :complex, default: "(0,\"\")"
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
in simple and natural way using ActiveRecord model:
|
30
30
|
|
31
31
|
class Foo < ActiveRecord::Base
|
32
32
|
end
|
@@ -42,7 +42,7 @@ and then
|
|
42
42
|
foo.comp.number # => 1.2
|
43
43
|
foo.comp.title # => "Cool!"
|
44
44
|
|
45
|
-
To achieve this goal I only have to define
|
45
|
+
To achieve this goal I only have to define composite type class in a following way:
|
46
46
|
|
47
47
|
class ComplexType < PostgresCompositeType
|
48
48
|
register_type :complex
|
@@ -62,6 +62,5 @@ That's all folks.
|
|
62
62
|
|
63
63
|
== Copyright
|
64
64
|
|
65
|
-
Copyright (c) 2014
|
66
|
-
further details.
|
65
|
+
Copyright (c) 2014 PuzzleFlow. See LICENSE for further details.
|
67
66
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -5,16 +5,15 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "activerecord-postgres-composite-types"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rafal Bigaj"]
|
12
|
-
s.date = "2014-09-
|
12
|
+
s.date = "2014-09-11"
|
13
13
|
s.description = "This gem adds support to the ActiveRecord (3.x and 4.x) for composite types."
|
14
14
|
s.email = "rafal.bigaj@puzzleflow.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
"LICENSE.txt",
|
18
17
|
"README.rdoc"
|
19
18
|
]
|
20
19
|
s.files = [
|
@@ -22,7 +21,6 @@ Gem::Specification.new do |s|
|
|
22
21
|
".travis.yml",
|
23
22
|
"Gemfile",
|
24
23
|
"LICENSE",
|
25
|
-
"LICENSE.txt",
|
26
24
|
"README.rdoc",
|
27
25
|
"Rakefile",
|
28
26
|
"VERSION",
|
@@ -73,7 +73,7 @@ module ActiveRecord
|
|
73
73
|
if composite_type_klass = PostgreSQLAdapter.composite_type_classes[type]
|
74
74
|
"#{self.class}.string_to_composite_type(#{composite_type_klass}, #{var_name})"
|
75
75
|
else
|
76
|
-
type_cast_code_without_composite_types(
|
76
|
+
type_cast_code_without_composite_types(var_name)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgres-composite-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafal Bigaj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -157,14 +157,12 @@ executables: []
|
|
157
157
|
extensions: []
|
158
158
|
extra_rdoc_files:
|
159
159
|
- LICENSE
|
160
|
-
- LICENSE.txt
|
161
160
|
- README.rdoc
|
162
161
|
files:
|
163
162
|
- .document
|
164
163
|
- .travis.yml
|
165
164
|
- Gemfile
|
166
165
|
- LICENSE
|
167
|
-
- LICENSE.txt
|
168
166
|
- README.rdoc
|
169
167
|
- Rakefile
|
170
168
|
- VERSION
|
data/LICENSE.txt
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Rafał Bigaj
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|