hstore_attribute_support 0.0.4 → 0.0.5
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.
- data/README.md +4 -4
- data/hstore_attribute_support.gemspec +2 -2
- metadata +2 -13
data/README.md
CHANGED
@@ -37,14 +37,14 @@ On top of this, the model obtains getter methods to return values typecasted
|
|
37
37
|
|
38
38
|
# the explicit definition of a boolean attribute admin (stored in hstore
|
39
39
|
# column 'data', initialized with default value false) looks like this:
|
40
|
-
hstore_attr_accessor :admin, :boolean, false
|
40
|
+
hstore_attr_accessor :admin, :cast => :boolean, :default => false
|
41
41
|
|
42
42
|
# however for each hstore column there are autogenerated prefixed methods:
|
43
|
-
data_hstore_accessor :age, :integer
|
44
|
-
data_hstore_accessor :salary, :float, 1234.56 # with default value 1234.56
|
43
|
+
data_hstore_accessor :age, :cast => :integer # defaults to nil
|
44
|
+
data_hstore_accessor :salary, :cast => :float, :default => 1234.56 # with default value 1234.56
|
45
45
|
|
46
46
|
# it is even possible to define a custom typecast via a lambda
|
47
|
-
data_hstore_accessor :icq, lambda{|n| n.blank? ? 'UIN: n/a' : "UIN: \##{n}"}
|
47
|
+
data_hstore_accessor :icq, :cast => lambda{|n| n.blank? ? 'UIN: n/a' : "UIN: \##{n}"}
|
48
48
|
|
49
49
|
# as accessors get defined, validation and other stuff works out of the box:
|
50
50
|
validates :salary,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'hstore_attribute_support'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.5'
|
4
4
|
s.date = '2011-11-16'
|
5
5
|
s.summary = "Adds AR Attributes support for Postgres hstore columns "
|
6
6
|
s.description = "Adds AR Attributes support for Postgres hstore columns "
|
@@ -12,5 +12,5 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
|
15
|
-
s.add_dependency 'activerecord-postgres-hstore', '>= 0.1.2'
|
15
|
+
#s.add_dependency 'activerecord-postgres-hstore', '>= 0.1.2'
|
16
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hstore_attribute_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,18 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2011-11-16 00:00:00.000000000Z
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: activerecord-postgres-hstore
|
16
|
-
requirement: &70308241492240 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.1.2
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70308241492240
|
13
|
+
dependencies: []
|
25
14
|
description: ! 'Adds AR Attributes support for Postgres hstore columns '
|
26
15
|
email: asmailbox@gmx.de
|
27
16
|
executables: []
|