kakurenbo-puti 0.1.0 → 0.5.0

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: 5a7a55e62643987f839573cbee301f3114176a2a
4
- data.tar.gz: 440591cbabb762607202703a66c82b6d8c912b02
3
+ metadata.gz: d8c59a9207db34edcd4372ab1c694575ec46bfc7
4
+ data.tar.gz: 1a1598872bdc1ce6d2a605285c8330a2ef44a6f6
5
5
  SHA512:
6
- metadata.gz: ff003f0b53797305c1f7b78df14ca3ce00fef049ddb1fa1030b7927230ce2699546c59122f6e080291d1bd5ef7e68bdf68701c372bc11873db7d8cb385c338cb
7
- data.tar.gz: 5481b3aa1fa467ffd822703f62c3d49a232949194bd69462ff14a552528c083bd775ac2ff455cb81430b5f0c19c0c93fc37f299b69e9e48e466c0d61586c2d1a
6
+ metadata.gz: 6ae299724f9a93eb3e307b4b3accafd6f71419597c10e1cafa5cea6c1d5dd8dd184c8bab41e8793c5ac84d5a1d29443be1e4a0a085aa2393f746dc2d0db10bc9
7
+ data.tar.gz: 3e30172187a66d883e8cd05ed8741051e93797da9e4c2cd00204de981cde7199b460d120935cd18e39ed271894afcbf55860cd8e3e16b9466b1d10c191225d35
@@ -6,6 +6,11 @@ rvm:
6
6
  - 2.0.0
7
7
  - 2.1.0
8
8
  - 2.1.2
9
+ - 2.3.0
9
10
  env:
10
11
  - ACTIVE_RECORD_VERSION='~> 4.1.0'
11
12
  - ACTIVE_RECORD_VERSION='~> 4.2.0'
13
+ matrix:
14
+ include:
15
+ - rvm: 2.3.0
16
+ env: ACTIVE_RECORD_VERSION='~> 5.0.0'
data/README.md CHANGED
@@ -28,7 +28,8 @@ Or install it yourself as:
28
28
  At first, add `soft_destroyed_at` column to your model.
29
29
 
30
30
  ```shell
31
- rails g migration AddSoftDestroyedAtYourModel soft_destroyed_at:datetime:index
31
+ $ rails g migration AddSoftDestroyedAtToYourModel soft_destroyed_at:datetime:index
32
+ $ rake db:migrate
32
33
  ```
33
34
 
34
35
  Next, call `soft_deletable` in model.
@@ -64,7 +65,7 @@ model.soft_destroy!
64
65
  model.soft_destroyed? # => true
65
66
  ```
66
67
 
67
- # Restore record
68
+ ### Restore record
68
69
 
69
70
  ```ruby
70
71
  model.restore
@@ -60,7 +60,7 @@ module KakurenboPuti
60
60
 
61
61
  module InstanceMethods
62
62
  # Restore model.
63
- # @return [Boolean] Return true if it is success.
63
+ # @return [Boolean] Return true if it is successfully restored.
64
64
  def restore
65
65
  true.tap { restore! }
66
66
  rescue
@@ -74,7 +74,7 @@ module KakurenboPuti
74
74
  end
75
75
 
76
76
  # Soft-Delete model.
77
- # @return [Boolean] Return true if it is success.
77
+ # @return [Boolean] Return true if it is successfully restored.
78
78
  def soft_destroy
79
79
  true.tap { soft_destroy! }
80
80
  rescue
@@ -1,3 +1,3 @@
1
1
  module KakurenboPuti
2
- VERSION = '0.1.0'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -149,8 +149,12 @@ describe KakurenboPuti::ActiveRecordBase do
149
149
  end
150
150
 
151
151
  context 'When dependent association use in `has_many`' do
152
+ subject do
153
+ model_class.without_soft_destroyed
154
+ end
155
+
152
156
  let :model_class_options do
153
- {dependent_associations: [:soft_delete_children]}
157
+ { dependent_associations: [:soft_delete_children] }
154
158
  end
155
159
 
156
160
  it 'raise error' do
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
- require 'supports/active_record_model'
3
+ require 'spec_helpers/active_record_model'
4
4
  require 'coveralls'
5
5
  require 'kakurenbo-puti'
6
6
 
@@ -8,6 +8,7 @@ RSpec.configure do |config|
8
8
  config.color = true
9
9
  config.mock_framework = :rspec
10
10
  config.before :all do
11
+ ActiveRecord::Base.logger = Logger.new(STDOUT).tap { |logger| logger.level = Logger::WARN }
11
12
  ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
12
13
  end
13
14
  end
@@ -12,7 +12,7 @@ def define_active_record_model(model_name, &block)
12
12
 
13
13
  tableize_name = Inflector.tableize(model_name)
14
14
 
15
- before :all do
15
+ before :each do
16
16
  migration = ActiveRecord::Migration.new
17
17
  migration.verbose = false
18
18
  migration.create_table tableize_name, &block
@@ -25,7 +25,7 @@ def define_active_record_model(model_name, &block)
25
25
  Object.const_set model_name, mock_class
26
26
  end
27
27
 
28
- after :all do
28
+ after :each do
29
29
  migration = ActiveRecord::Migration.new
30
30
  migration.verbose = false
31
31
  migration.drop_table tableize_name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kakurenbo-puti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alfa-jpn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-14 00:00:00.000000000 Z
11
+ date: 2016-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -134,8 +134,8 @@ files:
134
134
  - spec/kakurenbo_puti/active_record_base_spec.rb
135
135
  - spec/kakurenbo_puti/situations/deep_nest_spec.rb
136
136
  - spec/spec_helper.rb
137
- - spec/supports/active_record_model.rb
138
- - spec/supports/active_record_model_spec.rb
137
+ - spec/spec_helpers/active_record_model.rb
138
+ - spec/spec_helpers/active_record_model_spec.rb
139
139
  homepage: https://github.com/alfa-jpn/kakurenbo-puti
140
140
  licenses:
141
141
  - MIT
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.4.5
159
+ rubygems_version: 2.5.1
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Lightweight soft-delete gem.
@@ -164,6 +164,6 @@ test_files:
164
164
  - spec/kakurenbo_puti/active_record_base_spec.rb
165
165
  - spec/kakurenbo_puti/situations/deep_nest_spec.rb
166
166
  - spec/spec_helper.rb
167
- - spec/supports/active_record_model.rb
168
- - spec/supports/active_record_model_spec.rb
167
+ - spec/spec_helpers/active_record_model.rb
168
+ - spec/spec_helpers/active_record_model_spec.rb
169
169
  has_rdoc: