activerecord-postgres-json 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 2fa2ff434f05486be6458bac2bf2eb94f389acba
4
- data.tar.gz: 27b6a6c6c5abd025e246973aa221ace946442e27
3
+ metadata.gz: c71a68110de2bf3c602f747ca916b1b9e0f92a33
4
+ data.tar.gz: 1e6fa6249409434a3d5bf925b91ca3108f7f9a5d
5
5
  SHA512:
6
- metadata.gz: 8427901febe5ad97f87b4b3ffc7320d8634242907f8c347a99fc7d2b357971bcf6f76c6b1ea41fe35d4253c1f4b56a1a1481c19e3368bdcd226cbca1825dbfd4
7
- data.tar.gz: b8cd3670f4761e7d8bdef9fd70f654732fac829fb8046b85f941eb33e0148205043c738877d1f415ad83f0b8bc6fd281edf64136e6da59fa74ad3219c1759c00
6
+ metadata.gz: a6b67d07b0e864521f2bf846964b6789a3215da69335b464b4a96a8fc7395b020db66410603708f7e78251a8815eb31b7f71ce1991688048285e2142016962ea
7
+ data.tar.gz: 16489382cf0a757c2bdc999cc3744e453a261a468fe9dff5dac52131f4f606c2981a0a38c8ef058c45a1980233be0967aec27c955a4491d515ed238b83e047d5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: activerecord-postgres-json 0.1.0 ruby lib
5
+ # stub: activerecord-postgres-json 0.1.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "activerecord-postgres-json"
9
- s.version = "0.1.0"
9
+ s.version = "0.1.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Roman Shterenzon"]
14
- s.date = "2014-06-02"
14
+ s.date = "2014-06-11"
15
15
  s.description = "Active Record support for PostgreSQL JSON type"
16
16
  s.email = "romanbsd@yahoo.com"
17
17
  s.extra_rdoc_files = [
@@ -1,2 +1,4 @@
1
- require 'activerecord-postgres-json/activerecord'
1
+ ActiveSupport.on_load :active_record do
2
+ require 'activerecord-postgres-json/activerecord'
3
+ end
2
4
  require 'activerecord-postgres-json/coders'
@@ -13,6 +13,20 @@ module ActiveRecord
13
13
  end
14
14
 
15
15
  alias_method_chain :simplified_type, :json
16
+
17
+ class << self
18
+ def extract_value_from_default_with_json(default)
19
+ case default
20
+ when "'{}'::json"
21
+ {}
22
+ when "'[]'::json"
23
+ []
24
+ else
25
+ extract_value_from_default_without_json(default)
26
+ end
27
+ end
28
+ alias_method_chain :extract_value_from_default, :json
29
+ end
16
30
  end
17
31
  end
18
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-postgres-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Shterenzon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-02 00:00:00.000000000 Z
11
+ date: 2014-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord