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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98f62a13d469e88f1edb1e1698d2898847d2a502
4
- data.tar.gz: 5fc6c4393b389fb1484380869acd665486989c99
3
+ metadata.gz: 8ed8d4d7c368cb6a0881483bee736be9da580d24
4
+ data.tar.gz: 91f6db54c6323d392b470c97dfbc26c01d2f5946
5
5
  SHA512:
6
- metadata.gz: cbc7cbdaa014f3dfe73be1259d7e3ccfe9be282891077a52223bd67ea6607025d2147e89122e26ca3760f64fd47312f6f69c1c0e34e5c3c66f3b05df33f0d82e
7
- data.tar.gz: a857f954015d60c9ba09cbfee46370b3db654b23a32ef6ac7e2c518c42ec23ee7120c24065144aa3e8c7f6325f9d032e77793fd253508643aed9a78515a57dbc
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
- validates_polymorphic :imageable
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, { picture_id: nil }`
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
 
@@ -26,5 +26,6 @@ module Polymorpheus
26
26
  end
27
27
 
28
28
  Polymorpheus::Adapter.register 'mysql2', 'polymorpheus/mysql_adapter'
29
+ Polymorpheus::Adapter.register 'postgresql', 'polymorpheus/postgresql_adapter'
29
30
 
30
31
  require 'polymorpheus/railtie' if defined?(Rails)
@@ -0,0 +1,6 @@
1
+ module Polymorpheus
2
+ module ConnectionAdapters
3
+ module PostgresqlAdapter
4
+ end
5
+ end
6
+ end
@@ -9,11 +9,13 @@ module Polymorpheus
9
9
  def tables_with_triggers(stream)
10
10
  tables_without_triggers(stream)
11
11
 
12
- @connection.triggers.collect(&:schema_statement).each do |statement|
13
- stream.puts statement
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
-
@@ -1,3 +1,3 @@
1
1
  module Polymorpheus
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
@@ -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', '< 5.0')
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.0
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: 2014-06-20 00:00:00.000000000 Z
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: '5.0'
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: '5.0'
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
- - lib/polymorpheus.rb
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.0.14
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