schema_plus 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +3 -0
- data/README.md +3 -0
- data/lib/schema_plus/active_record/base.rb +1 -1
- data/lib/schema_plus/active_record/connection_adapters/column.rb +4 -4
- data/lib/schema_plus/railtie.rb +1 -1
- data/lib/schema_plus/version.rb +1 -1
- data/schema_plus.gemspec +1 -1
- data/spec/named_schemas_spec.rb +3 -1
- metadata +3 -8
data/.rspec
ADDED
data/README.md
CHANGED
@@ -277,6 +277,9 @@ of foreign key constraints, you can re-enable it:
|
|
277
277
|
|
278
278
|
## Release notes:
|
279
279
|
|
280
|
+
### 1.1.2
|
281
|
+
* Now works with rails 3.2.13 (fixed railtie initialization)
|
282
|
+
|
280
283
|
### 1.1.1
|
281
284
|
|
282
285
|
* Dependency constraint to rails 3.2.12 max, since schema_plus doesn't
|
@@ -21,7 +21,7 @@ module SchemaPlus
|
|
21
21
|
|
22
22
|
def columns_with_schema_plus #:nodoc:
|
23
23
|
columns = columns_without_schema_plus
|
24
|
-
columns.each do |column| column.
|
24
|
+
columns.each do |column| column.model = self end unless @schema_plus_extended_columns
|
25
25
|
columns
|
26
26
|
end
|
27
27
|
|
@@ -8,13 +8,13 @@ module SchemaPlus
|
|
8
8
|
module Column
|
9
9
|
|
10
10
|
attr_reader :default_expr
|
11
|
-
attr_writer :
|
11
|
+
attr_writer :model # model gets set by SchemaPlus::ActiveRecord::Base::columns_with_schema_plus
|
12
12
|
|
13
13
|
# Returns the list of IndexDefinition instances for each index that
|
14
14
|
# refers to this column. Returns an empty list if there are no
|
15
15
|
# such indexes.
|
16
16
|
def indexes
|
17
|
-
@indexes ||= @
|
17
|
+
@indexes ||= @model.indexes.select{|index| index.columns.include? self.name}
|
18
18
|
end
|
19
19
|
|
20
20
|
# If the column is in a unique index, returns a list of names of other columns in
|
@@ -53,9 +53,9 @@ module SchemaPlus
|
|
53
53
|
end
|
54
54
|
|
55
55
|
# The default as_jon includes all instance variables. but
|
56
|
-
# @
|
56
|
+
# @model can't be dumped (it contains circular references)
|
57
57
|
def as_json(options=nil)
|
58
|
-
instance_values.except "
|
58
|
+
instance_values.except "model"
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
data/lib/schema_plus/railtie.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module SchemaPlus
|
2
2
|
class Railtie < Rails::Railtie #:nodoc:
|
3
3
|
|
4
|
-
initializer 'schema_plus.insert', :
|
4
|
+
initializer 'schema_plus.insert', :before => "active_record.initialize_database" do
|
5
5
|
ActiveSupport.on_load(:active_record) do
|
6
6
|
SchemaPlus.insert
|
7
7
|
end
|
data/lib/schema_plus/version.rb
CHANGED
data/schema_plus.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_dependency("rails", ">= 3.2"
|
23
|
+
s.add_dependency("rails", ">= 3.2")
|
24
24
|
s.add_dependency("valuable")
|
25
25
|
|
26
26
|
s.add_development_dependency("rake")
|
data/spec/named_schemas_spec.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
3
|
describe "with multiple schemas" do
|
4
|
-
|
4
|
+
def connection
|
5
|
+
ActiveRecord::Base.connection
|
6
|
+
end
|
5
7
|
|
6
8
|
before(:all) do
|
7
9
|
newdb = case connection.adapter_name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-03-
|
13
|
+
date: 2013-03-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -20,9 +20,6 @@ dependencies:
|
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3.2'
|
23
|
-
- - <=
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: 3.2.12
|
26
23
|
type: :runtime
|
27
24
|
prerelease: false
|
28
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -31,9 +28,6 @@ dependencies:
|
|
31
28
|
- - ! '>='
|
32
29
|
- !ruby/object:Gem::Version
|
33
30
|
version: '3.2'
|
34
|
-
- - <=
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 3.2.12
|
37
31
|
- !ruby/object:Gem::Dependency
|
38
32
|
name: valuable
|
39
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,6 +119,7 @@ extensions: []
|
|
125
119
|
extra_rdoc_files: []
|
126
120
|
files:
|
127
121
|
- .gitignore
|
122
|
+
- .rspec
|
128
123
|
- .travis.yml
|
129
124
|
- Gemfile
|
130
125
|
- MIT-LICENSE
|