activerecord-nulldb-adapter 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 599fc67d2e38b95a598aa65ad53c5f4601021280
4
- data.tar.gz: f9f23fb4f7d53378e973a746202ef62176831fd5
3
+ metadata.gz: 1433573809eb7d294ca0e0b2b6fc70aa7abeb7c7
4
+ data.tar.gz: 0785af97f872961fc00d8bef4e266b9dea66d724
5
5
  SHA512:
6
- metadata.gz: c4b2e4abb46f08367f84d5c26751fad6e9b59f78d11d397c22a91cb1cc5426ceb07b51d420adb9274b9b0c7c23b7eaef903c95bbc269f79ccfe8d516d41ef88b
7
- data.tar.gz: 696421bb75ef8a63648cca86727ddb9537d4d2a1c91ddadc1123faaed2cd149210eed1db0e5794b104913583f31f02180ec10318648e557e7575cec3558bb0ea
6
+ metadata.gz: 168c2584d0a743ed7d1b5baa9e07d58d92bb74f59f1e8239c08fbe8fac6efa0c4f4bae646220cbef26deca80c4a2ae90867c7bc6b161484fcf6709e28f66bf49
7
+ data.tar.gz: 451f5933473a48ac09047a09317fd6392ff80317680eece6086ba6ad22d2dfaf48e8714356a4b384afe0a23e3d42ed48154bd2494cfc259fcbaae371c79698eb
data/.travis.yml CHANGED
@@ -4,10 +4,9 @@ bundler_args: --without development
4
4
  sudo: false
5
5
 
6
6
  rvm:
7
- - 2.0.0
8
- - 2.1.8
9
- - 2.2.4
10
- - 2.3.0
7
+ - 2.1.10
8
+ - 2.2.5
9
+ - 2.3.1
11
10
  - jruby
12
11
  - rbx
13
12
 
@@ -24,3 +23,4 @@ gemfile:
24
23
  - gemfiles/activerecord_3.2.gemfile
25
24
  - gemfiles/activerecord_4.0.gemfile
26
25
  - gemfiles/activerecord_4.1.gemfile
26
+ - gemfiles/activerecord_4.2.gemfile
data/Appraisals CHANGED
@@ -22,3 +22,7 @@ end
22
22
  appraise "activerecord-4.1" do
23
23
  gem "activerecord", "~> 4.1.0"
24
24
  end
25
+
26
+ appraise "activerecord-4.2" do
27
+ gem "activerecord", "~> 4.2.0"
28
+ end
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.3.3 (2016-08-01)
2
+ -----------
3
+ - Adds support for ActiveRecord 4.2.
4
+ - Deprecates support for MRI 2.0.0.
5
+
6
+
1
7
  0.3.2 (2016-01-25)
2
8
  -----------
3
9
  - Deprecates support for MRI 1.9.3 and adds support for 2.3.x.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -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-nulldb-adapter 0.3.2 ruby lib
5
+ # stub: activerecord-nulldb-adapter 0.3.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "activerecord-nulldb-adapter"
9
- s.version = "0.3.2"
9
+ s.version = "0.3.3"
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 = ["Avdi Grimm", "Myron Marston"]
14
- s.date = "2016-01-25"
14
+ s.date = "2016-08-01"
15
15
  s.description = "A database backend that translates database interactions into no-ops. Using NullDB enables you to test your model business logic - including after_save hooks - without ever touching a real database."
16
16
  s.email = "myron.marston@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "gemfiles/activerecord_3.2.gemfile",
35
35
  "gemfiles/activerecord_4.0.gemfile",
36
36
  "gemfiles/activerecord_4.1.gemfile",
37
+ "gemfiles/activerecord_4.2.gemfile",
37
38
  "lib/active_record/connection_adapters/nulldb_adapter.rb",
38
39
  "lib/active_record/connection_adapters/nulldb_adapter/checkpoint.rb",
39
40
  "lib/active_record/connection_adapters/nulldb_adapter/column.rb",
@@ -58,7 +59,7 @@ Gem::Specification.new do |s|
58
59
  s.homepage = "http://github.com/nulldb/nulldb"
59
60
  s.licenses = ["MIT"]
60
61
  s.rubyforge_project = "nulldb"
61
- s.rubygems_version = "2.4.5.1"
62
+ s.rubygems_version = "2.4.8"
62
63
  s.summary = "The Null Object pattern as applied to ActiveRecord database adapters"
63
64
 
64
65
  if s.respond_to? :specification_version then
@@ -0,0 +1,17 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 4.2.0"
6
+
7
+ group :development, :test do
8
+ gem "spec"
9
+ gem "rspec", ">= 1.2.9"
10
+ gem "rake"
11
+ end
12
+
13
+ group :development do
14
+ gem "jeweler"
15
+ gem "appraisal"
16
+ gem "simplecov", :require => false
17
+ end
@@ -131,12 +131,7 @@ class ActiveRecord::ConnectionAdapters::NullDBAdapter < ActiveRecord::Connection
131
131
 
132
132
  if table = @tables[table_name]
133
133
  table.columns.map do |col_def|
134
- ActiveRecord::ConnectionAdapters::NullDBAdapter::Column.new(
135
- col_def.name.to_s,
136
- col_def.default,
137
- col_def.type,
138
- col_def.null
139
- )
134
+ ActiveRecord::ConnectionAdapters::NullDBAdapter::Column.new(*new_column_arguments(col_def))
140
135
  end
141
136
  else
142
137
  []
@@ -181,7 +176,7 @@ class ActiveRecord::ConnectionAdapters::NullDBAdapter < ActiveRecord::Connection
181
176
 
182
177
  def delete(statement, name=nil, binds = [])
183
178
  with_entry_point(:delete) do
184
- super(statement, name)
179
+ super(statement, name).size
185
180
  end
186
181
  end
187
182
 
@@ -267,4 +262,28 @@ class ActiveRecord::ConnectionAdapters::NullDBAdapter < ActiveRecord::Connection
267
262
  raise "Unsupported ActiveRecord version #{::ActiveRecord::VERSION::STRING}"
268
263
  end
269
264
  end
265
+
266
+ def new_column_arguments(col_def)
267
+ args_with_optional_cast_type(col_def)
268
+ end
269
+
270
+ def args_with_optional_cast_type(col_def)
271
+ default_column_arguments(col_def).tap do |args|
272
+ args.insert(2, lookup_cast_type(col_def.type)) if initialize_column_with_cast_type?
273
+ end
274
+ end
275
+
276
+ def default_column_arguments(col_def)
277
+ [
278
+ col_def.name.to_s,
279
+ col_def.default,
280
+ col_def.type,
281
+ col_def.null
282
+ ]
283
+ end
284
+
285
+ def initialize_column_with_cast_type?
286
+ ::ActiveRecord::VERSION::MAJOR == 4 && ::ActiveRecord::VERSION::MINOR >= 2
287
+ end
288
+
270
289
  end
data/spec/nulldb_spec.rb CHANGED
@@ -249,7 +249,7 @@ describe "NullDB" do
249
249
 
250
250
  def should_have_column(klass, col_name, col_type)
251
251
  col = klass.columns_hash[col_name.to_s]
252
- expect(col.type).to eq col_type
252
+ expect(col.sql_type.to_sym).to eq col_type
253
253
  end
254
254
 
255
255
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-nulldb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avdi Grimm
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-25 00:00:00.000000000 Z
12
+ date: 2016-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -134,6 +134,7 @@ files:
134
134
  - gemfiles/activerecord_3.2.gemfile
135
135
  - gemfiles/activerecord_4.0.gemfile
136
136
  - gemfiles/activerecord_4.1.gemfile
137
+ - gemfiles/activerecord_4.2.gemfile
137
138
  - lib/active_record/connection_adapters/nulldb_adapter.rb
138
139
  - lib/active_record/connection_adapters/nulldb_adapter/checkpoint.rb
139
140
  - lib/active_record/connection_adapters/nulldb_adapter/column.rb
@@ -174,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  version: '0'
175
176
  requirements: []
176
177
  rubyforge_project: nulldb
177
- rubygems_version: 2.4.5.1
178
+ rubygems_version: 2.4.8
178
179
  signing_key:
179
180
  specification_version: 4
180
181
  summary: The Null Object pattern as applied to ActiveRecord database adapters