polymorpheus 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/polymorpheus.rb +1 -0
- data/lib/polymorpheus/postgresql_adapter.rb +6 -0
- data/lib/polymorpheus/schema_dumper.rb +5 -3
- data/lib/polymorpheus/version.rb +1 -1
- data/polymorpheus.gemspec +1 -1
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ed8d4d7c368cb6a0881483bee736be9da580d24
|
4
|
+
data.tar.gz: 91f6db54c6323d392b470c97dfbc26c01d2f5946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ae1e2d62b17fb7634779da45165fbec63ce59684dcd038db73d0730f301653a2d5223373fdc0fb4bdab39569432db043d95d8820c449a7972332ceb4088ef2d
|
7
|
+
data.tar.gz: 70a440da6a5470585de16d9478e9899f0ba428ea3c5b8b1cd6e37ce4eb1070f2f575f96f826a47caaf98669e1a572a69360751ebb4ac13701dde79827a23547f
|
data/README.md
CHANGED
@@ -64,7 +64,7 @@ end
|
|
64
64
|
```ruby
|
65
65
|
class Picture < ActiveRecord::Base
|
66
66
|
belongs_to_polymorphic :employee, :product, :as => :imageable
|
67
|
-
|
67
|
+
validates_polymorph :imageable
|
68
68
|
end
|
69
69
|
|
70
70
|
class Employee < ActiveRecord::Base
|
@@ -115,7 +115,7 @@ Now let's review what we've done.
|
|
115
115
|
would use with a `has_many` association (such as `:order`, `:class_name`,
|
116
116
|
etc.). Specifically, the `has_many_as_polymorph` declaration in the `Employee`
|
117
117
|
class of the example above is equivalant to
|
118
|
-
`has_many :pictures, {
|
118
|
+
`has_many :pictures, { product_id: nil }`
|
119
119
|
and the `has_many_as_polymorph` declaration in the `Product` class is
|
120
120
|
equivalent to `has_many :pictures, { employee_id: nil }`
|
121
121
|
|
data/lib/polymorpheus.rb
CHANGED
@@ -9,11 +9,13 @@ module Polymorpheus
|
|
9
9
|
def tables_with_triggers(stream)
|
10
10
|
tables_without_triggers(stream)
|
11
11
|
|
12
|
-
@connection.triggers
|
13
|
-
|
12
|
+
if @connection.respond_to?(:triggers)
|
13
|
+
@connection.triggers.collect(&:schema_statement).each do |statement|
|
14
|
+
stream.puts statement
|
15
|
+
end
|
14
16
|
end
|
17
|
+
|
15
18
|
stream.puts
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
19
|
-
|
data/lib/polymorpheus/version.rb
CHANGED
data/polymorpheus.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.license = 'MIT'
|
19
19
|
|
20
20
|
s.add_dependency('foreigner')
|
21
|
-
s.add_dependency('activerecord', '>= 3.2', '<
|
21
|
+
s.add_dependency('activerecord', '>= 3.2', '< 4.2')
|
22
22
|
s.add_development_dependency('rspec-rails', '~> 2.14.0')
|
23
23
|
s.add_development_dependency('mysql2', '~> 0.3')
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polymorpheus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barun Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreigner
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '3.2'
|
34
34
|
- - <
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '4.2'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '3.2'
|
44
44
|
- - <
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '4.2'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec-rails
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,21 +80,26 @@ extra_rdoc_files:
|
|
80
80
|
- README.md
|
81
81
|
- LICENSE.txt
|
82
82
|
files:
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- lib/polymorpheus.rb
|
83
87
|
- lib/polymorpheus/adapter.rb
|
88
|
+
- lib/polymorpheus/interface.rb
|
84
89
|
- lib/polymorpheus/interface/belongs_to_polymorphic.rb
|
85
90
|
- lib/polymorpheus/interface/rails3/has_many_as_polymorph.rb
|
86
91
|
- lib/polymorpheus/interface/rails4/has_many_as_polymorph.rb
|
87
92
|
- lib/polymorpheus/interface/validates_polymorph.rb
|
88
|
-
- lib/polymorpheus/interface.rb
|
89
|
-
- lib/polymorpheus/interface_builder/association.rb
|
90
93
|
- lib/polymorpheus/interface_builder.rb
|
94
|
+
- lib/polymorpheus/interface_builder/association.rb
|
91
95
|
- lib/polymorpheus/mysql_adapter.rb
|
96
|
+
- lib/polymorpheus/postgresql_adapter.rb
|
92
97
|
- lib/polymorpheus/railtie.rb
|
93
98
|
- lib/polymorpheus/schema_dumper.rb
|
94
99
|
- lib/polymorpheus/schema_statements.rb
|
95
100
|
- lib/polymorpheus/trigger.rb
|
96
101
|
- lib/polymorpheus/version.rb
|
97
|
-
-
|
102
|
+
- polymorpheus.gemspec
|
98
103
|
- spec/interface_spec.rb
|
99
104
|
- spec/mysql2_adapter_spec.rb
|
100
105
|
- spec/schema_dumper_spec.rb
|
@@ -105,10 +110,6 @@ files:
|
|
105
110
|
- spec/support/custom_matchers.rb
|
106
111
|
- spec/support/db_setup.rb
|
107
112
|
- spec/trigger_spec.rb
|
108
|
-
- LICENSE.txt
|
109
|
-
- README.md
|
110
|
-
- polymorpheus.gemspec
|
111
|
-
- Rakefile
|
112
113
|
homepage: http://github.com/wegowise/polymorpheus
|
113
114
|
licenses:
|
114
115
|
- MIT
|
@@ -129,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
130
|
version: 1.3.6
|
130
131
|
requirements: []
|
131
132
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.4.5
|
133
134
|
signing_key:
|
134
135
|
specification_version: 4
|
135
136
|
summary: Provides a database-friendly method for polymorphic relationships
|