active_record-events 3.0.0 → 4.0.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
  SHA256:
3
- metadata.gz: 4d3c49af800cff40043af18ec6357dd41a8492a75942525701fa607b078a0bb0
4
- data.tar.gz: 01b3d06c56050a764fa67b772e8fdf6f791603be7e220773d7e7547a53450ef6
3
+ metadata.gz: 5039a0306f7a2a2c89a4e6cea36d6995153caeaf8e2941ac12baea60e351f9bd
4
+ data.tar.gz: ffaa64e1917f5824b67e9a9b72f6edff09a25b05149aff624c08974e8ab264b5
5
5
  SHA512:
6
- metadata.gz: a3f18c26a27d1eca9ee0517ea19dbf087019200e02fa02b95f0412c4901f4a2aec4239115fc38191d1e6ad7f643067f1567fde10633ace0beb71ddb4623f027b
7
- data.tar.gz: a388c51a55a45a13bccc7aad2288aefbef85c49ba322f6bd7fe0791aa4f378b1be1e41ac85562c732168be41553499560e1f8d79a2e0ea2b4691d25980189087
6
+ metadata.gz: ce136868ee5545c3a13d28a766b43adb868c3b6f4e92574f006eb7338d1247982fceeff0aca60f39ad395b90bfb002a65f964f2180914dde566397e79676918b
7
+ data.tar.gz: 9acbffdd536499d00fb481d3eb16d60798fb34e6cfdefb0daf5c6f1400e5b3cb750d5e50892dea62c897c673d0f2e14221173ea1cba486cccc77f6b6ffe4055a
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ActiveRecord::Events [![Gem version](https://img.shields.io/gem/v/active_record-events.svg)](https://rubygems.org/gems/active_record-events) [![Build status](https://img.shields.io/travis/pienkowb/active_record-events.svg)](https://travis-ci.org/pienkowb/active_record-events)
1
+ # ActiveRecord::Events [![Gem version](https://img.shields.io/gem/v/active_record-events)](https://rubygems.org/gems/active_record-events) [![Build status](https://img.shields.io/travis/pienkowb/active_record-events/develop)](https://travis-ci.org/pienkowb/active_record-events) [![Coverage status](https://img.shields.io/coveralls/github/pienkowb/active_record-events/develop)](https://coveralls.io/github/pienkowb/active_record-events) [![Maintainability status](https://img.shields.io/codeclimate/maintainability/pienkowb/active_record-events)](https://codeclimate.com/github/pienkowb/active_record-events)
2
2
 
3
3
  An ActiveRecord extension providing convenience methods for timestamp management.
4
4
 
@@ -93,14 +93,24 @@ In such a case, many lines of code can be replaced with an expressive one-liner.
93
93
  has_events :complete, :archive
94
94
  ```
95
95
 
96
- ### Setting a field type
96
+ ### Date fields
97
97
 
98
- In case of date fields, which by convention have names ending with `_on` instead of `_at` (e.g. `delivered_on`), the `field_type` option needs to be passed to the macro:
98
+ In case of date fields, which by convention have names ending with `_on` instead of `_at` (e.g. `completed_on`), the `field_type` option needs to be passed to the macro:
99
99
 
100
100
  ```ruby
101
- has_event :deliver, field_type: :date
101
+ has_event :complete, field_type: :date
102
102
  ```
103
103
 
104
+ ### Custom field name
105
+
106
+ If there's a field with a name that doesn't follow the naming convention (i.e. does not end with `_at` or `_on`), you can pass it as the `field_name` option.
107
+
108
+ ```ruby
109
+ has_event :complete, field_name: :completion_time
110
+ ```
111
+
112
+ Note that the `field_name` option takes precedence over the `field_type` option.
113
+
104
114
  ### Specifying an object
105
115
 
106
116
  There are events which do not relate to a model itself but to one of its attributes – take the `User` model with the `email_confirmed_at` field as an example.
data/Rakefile CHANGED
@@ -22,9 +22,23 @@ RDoc::Task.new(:rdoc) do |rdoc|
22
22
  rdoc.rdoc_files.include('lib/**/*.rb')
23
23
  end
24
24
 
25
- require 'standalone_migrations'
25
+ require 'active_record'
26
+ require 'yaml'
26
27
 
27
- StandaloneMigrations::Tasks.load_tasks
28
+ include ActiveRecord::Tasks
29
+
30
+ dummy_root = File.expand_path('spec/dummy', __dir__)
31
+ database_config = YAML.load_file("#{dummy_root}/config/database.yml")
32
+
33
+ DatabaseTasks.root = dummy_root
34
+ DatabaseTasks.env = ENV['RAILS_ENV'] || 'development'
35
+ DatabaseTasks.db_dir = "#{dummy_root}/db"
36
+ DatabaseTasks.database_configuration = database_config
37
+ DatabaseTasks.migrations_paths = "#{dummy_root}/db/migrate"
38
+
39
+ task :environment do
40
+ require "#{dummy_root}/config/environment.rb"
41
+ end
28
42
 
29
43
  ACTIVE_RECORD_MIGRATION_CLASS =
30
44
  if ActiveRecord::VERSION::MAJOR >= 5
@@ -33,6 +47,8 @@ ACTIVE_RECORD_MIGRATION_CLASS =
33
47
  ActiveRecord::Migration
34
48
  end
35
49
 
50
+ load 'active_record/railties/databases.rake'
51
+
36
52
  Bundler::GemHelper.install_tasks
37
53
 
38
54
  require 'rspec/core'
@@ -1,57 +1,13 @@
1
1
  require 'active_support'
2
- require 'active_record/events/naming'
3
-
4
- module ActiveRecord
5
- module Events
6
- def has_events(*names)
7
- options = names.extract_options!
8
- names.each { |n| has_event(n, options) }
9
- end
10
-
11
- def has_event(name, options = {})
12
- naming = Naming.new(name, options)
13
-
14
- include(Module.new do
15
- define_method(naming.predicate) do
16
- self[naming.field].present?
17
- end
18
-
19
- define_method(naming.inverse_predicate) do
20
- !__send__(naming.predicate)
21
- end
22
2
 
23
- define_method(naming.action) do
24
- touch(naming.field)
25
- end
3
+ require 'active_record/events/version'
26
4
 
27
- define_method(naming.safe_action) do
28
- __send__(naming.action) if __send__(naming.inverse_predicate)
29
- end
30
- end)
31
-
32
- extend(Module.new do
33
- define_method(naming.collective_action) do
34
- if respond_to?(:touch_all)
35
- touch_all(naming.field)
36
- else
37
- update_all(naming.field => Time.current)
38
- end
39
- end
40
-
41
- unless options[:skip_scopes]
42
- define_method(naming.scope) do
43
- where(arel_table[naming.field].not_eq(nil))
44
- end
5
+ require 'active_record/events/naming'
6
+ require 'active_record/events/method_factory'
7
+ require 'active_record/events/extension'
45
8
 
46
- define_method(naming.inverse_scope) do
47
- where(arel_table[naming.field].eq(nil))
48
- end
49
- end
50
- end)
51
- end
52
- end
53
- end
9
+ require 'active_record/events/macro'
54
10
 
55
11
  ActiveSupport.on_load(:active_record) do
56
- extend ActiveRecord::Events
12
+ extend ActiveRecord::Events::Extension
57
13
  end
@@ -0,0 +1,19 @@
1
+ require 'active_record/events/method_factory'
2
+
3
+ module ActiveRecord
4
+ module Events
5
+ module Extension
6
+ def has_events(*names)
7
+ options = names.extract_options!
8
+ names.each { |n| has_event(n, options) }
9
+ end
10
+
11
+ def has_event(name, options = {})
12
+ method_factory = MethodFactory.new(name, options)
13
+
14
+ include method_factory.instance_methods
15
+ extend method_factory.class_methods
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,84 @@
1
+ require 'active_record/events/naming'
2
+
3
+ module ActiveRecord
4
+ module Events
5
+ class MethodFactory
6
+ def initialize(event_name, options)
7
+ @options = options
8
+ @naming = Naming.new(event_name, options)
9
+ end
10
+
11
+ def instance_methods
12
+ Module.new.tap do |module_|
13
+ define_predicate_method(module_, naming)
14
+ define_inverse_predicate_method(module_, naming)
15
+
16
+ define_action_method(module_, naming)
17
+ define_safe_action_method(module_, naming)
18
+ end
19
+ end
20
+
21
+ def class_methods
22
+ Module.new.tap do |module_|
23
+ define_collective_action_method(module_, naming)
24
+
25
+ unless options[:skip_scopes]
26
+ define_scope_method(module_, naming)
27
+ define_inverse_scope_method(module_, naming)
28
+ end
29
+ end
30
+ end
31
+
32
+ private
33
+
34
+ attr_reader :options
35
+ attr_reader :naming
36
+
37
+ def define_predicate_method(module_, naming)
38
+ module_.send(:define_method, naming.predicate) do
39
+ self[naming.field].present?
40
+ end
41
+ end
42
+
43
+ def define_inverse_predicate_method(module_, naming)
44
+ module_.send(:define_method, naming.inverse_predicate) do
45
+ !__send__(naming.predicate)
46
+ end
47
+ end
48
+
49
+ def define_action_method(module_, naming)
50
+ module_.send(:define_method, naming.action) do
51
+ touch(naming.field)
52
+ end
53
+ end
54
+
55
+ def define_safe_action_method(module_, naming)
56
+ module_.send(:define_method, naming.safe_action) do
57
+ __send__(naming.action) if __send__(naming.inverse_predicate)
58
+ end
59
+ end
60
+
61
+ def define_collective_action_method(module_, naming)
62
+ module_.send(:define_method, naming.collective_action) do
63
+ if respond_to?(:touch_all)
64
+ touch_all(naming.field)
65
+ else
66
+ update_all(naming.field => Time.current)
67
+ end
68
+ end
69
+ end
70
+
71
+ def define_scope_method(module_, naming)
72
+ module_.send(:define_method, naming.scope) do
73
+ where(arel_table[naming.field].not_eq(nil))
74
+ end
75
+ end
76
+
77
+ def define_inverse_scope_method(module_, naming)
78
+ module_.send(:define_method, naming.inverse_scope) do
79
+ where(arel_table[naming.field].eq(nil))
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -1,4 +1,4 @@
1
- require 'active_record/events/verbs'
1
+ require 'verbs'
2
2
 
3
3
  module ActiveRecord
4
4
  module Events
@@ -6,11 +6,15 @@ module ActiveRecord
6
6
  def initialize(infinitive, options = {})
7
7
  @infinitive = infinitive
8
8
  @object = options[:object].presence
9
+ @field_name = options[:field_name].to_s
9
10
  @field_type = options[:field_type].try(:to_sym)
10
11
  end
11
12
 
12
13
  def field
14
+ return field_name if field_name.present?
15
+
13
16
  suffix = field_type == :date ? 'on' : 'at'
17
+
14
18
  concatenate(object, past_participle, suffix)
15
19
  end
16
20
 
@@ -46,6 +50,7 @@ module ActiveRecord
46
50
 
47
51
  attr_reader :infinitive
48
52
  attr_reader :object
53
+ attr_reader :field_name
49
54
  attr_reader :field_type
50
55
 
51
56
  def concatenate(*parts)
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Events
3
- VERSION = '3.0.0'.freeze
3
+ VERSION = '4.0.0'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe ActiveRecord::Events::MethodFactory do
4
+ let(:event_name) { :complete }
5
+ let(:options) { {} }
6
+
7
+ subject { described_class.new(event_name, options) }
8
+
9
+ it 'generates instance methods' do
10
+ result = subject.instance_methods
11
+
12
+ expect(result).to have_method(:completed?)
13
+ expect(result).to have_method(:not_completed?)
14
+ expect(result).to have_method(:complete!)
15
+ expect(result).to have_method(:complete)
16
+ end
17
+
18
+ it 'generates class methods' do
19
+ result = subject.class_methods
20
+
21
+ expect(result).to have_method(:complete_all)
22
+ expect(result).to have_method(:completed)
23
+ expect(result).to have_method(:not_completed)
24
+ end
25
+
26
+ context 'with the object option' do
27
+ let(:options) { { object: :task } }
28
+
29
+ it 'generates instance methods' do
30
+ result = subject.instance_methods
31
+
32
+ expect(result).to have_method(:task_completed?)
33
+ expect(result).to have_method(:task_not_completed?)
34
+ expect(result).to have_method(:complete_task!)
35
+ expect(result).to have_method(:complete_task)
36
+ end
37
+
38
+ it 'generates class methods' do
39
+ result = subject.class_methods
40
+
41
+ expect(result).to have_method(:complete_all_tasks)
42
+ expect(result).to have_method(:task_completed)
43
+ expect(result).to have_method(:task_not_completed)
44
+ end
45
+ end
46
+
47
+ context 'with the skip scopes option' do
48
+ let(:options) { { skip_scopes: true } }
49
+
50
+ it 'generates class methods without scopes' do
51
+ result = subject.class_methods
52
+
53
+ expect(result).to have_method(:complete_all)
54
+
55
+ expect(result).not_to have_method(:completed)
56
+ expect(result).not_to have_method(:not_completed)
57
+ end
58
+ end
59
+ end
@@ -1,7 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe ActiveRecord::Events::Naming do
4
- subject { described_class.new(:complete) }
4
+ let(:event_name) { :complete }
5
+ let(:options) { {} }
6
+
7
+ subject { described_class.new(event_name, options) }
5
8
 
6
9
  it 'generates a field name' do
7
10
  expect(subject.field).to eq('completed_at')
@@ -36,46 +39,54 @@ RSpec.describe ActiveRecord::Events::Naming do
36
39
  end
37
40
 
38
41
  context 'with an object' do
39
- subject { described_class.new(:confirm, object: :email) }
42
+ let(:options) { { object: :task } }
40
43
 
41
44
  it 'generates a field name' do
42
- expect(subject.field).to eq('email_confirmed_at')
45
+ expect(subject.field).to eq('task_completed_at')
43
46
  end
44
47
 
45
48
  it 'generates a predicate name' do
46
- expect(subject.predicate).to eq('email_confirmed?')
49
+ expect(subject.predicate).to eq('task_completed?')
47
50
  end
48
51
 
49
52
  it 'generates an inverse predicate name' do
50
- expect(subject.inverse_predicate).to eq('email_not_confirmed?')
53
+ expect(subject.inverse_predicate).to eq('task_not_completed?')
51
54
  end
52
55
 
53
56
  it 'generates an action name' do
54
- expect(subject.action).to eq('confirm_email!')
57
+ expect(subject.action).to eq('complete_task!')
55
58
  end
56
59
 
57
60
  it 'generates a safe action name' do
58
- expect(subject.safe_action).to eq('confirm_email')
61
+ expect(subject.safe_action).to eq('complete_task')
59
62
  end
60
63
 
61
64
  it 'generates a collective action name' do
62
- expect(subject.collective_action).to eq('confirm_all_emails')
65
+ expect(subject.collective_action).to eq('complete_all_tasks')
63
66
  end
64
67
 
65
68
  it 'generates a scope name' do
66
- expect(subject.scope).to eq('email_confirmed')
69
+ expect(subject.scope).to eq('task_completed')
67
70
  end
68
71
 
69
72
  it 'generates an inverse scope name' do
70
- expect(subject.inverse_scope).to eq('email_not_confirmed')
73
+ expect(subject.inverse_scope).to eq('task_not_completed')
71
74
  end
72
75
  end
73
76
 
74
77
  context 'with a date field' do
75
- subject { described_class.new(:deliver, field_type: :date) }
78
+ let(:options) { { field_type: :date } }
76
79
 
77
80
  it 'generates a field name' do
78
- expect(subject.field).to eq('delivered_on')
81
+ expect(subject.field).to eq('completed_on')
82
+ end
83
+ end
84
+
85
+ context 'with a custom field name' do
86
+ let(:options) { { field_name: :completion_time } }
87
+
88
+ it 'returns the field name' do
89
+ expect(subject.field).to eq('completion_time')
79
90
  end
80
91
  end
81
92
  end
@@ -1,7 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe ActiveRecord::Events do
4
- around { |e| Timecop.freeze { e.run } }
4
+ around(:each) do |example|
5
+ Timecop.freeze { example.run }
6
+ end
5
7
 
6
8
  let!(:task) { create(:task) }
7
9
 
@@ -32,6 +34,7 @@ RSpec.describe ActiveRecord::Events do
32
34
 
33
35
  it 'records multiple timestamps at once' do
34
36
  Task.complete_all
37
+
35
38
  expect(task.reload).to be_completed
36
39
  end
37
40
 
@@ -43,16 +46,6 @@ RSpec.describe ActiveRecord::Events do
43
46
  expect(Task.not_completed).to include(task)
44
47
  end
45
48
 
46
- context 'with the skip scopes flag' do
47
- it "doesn't define a scope" do
48
- expect(Task).not_to respond_to(:archived)
49
- end
50
-
51
- it "doesn't define an inverse scope" do
52
- expect(Task).not_to respond_to(:not_archived)
53
- end
54
- end
55
-
56
49
  it 'allows overriding instance methods' do
57
50
  expect(ActiveRecord::Base.logger).to receive(:info)
58
51
 
@@ -1,6 +1,6 @@
1
1
  class Task < ActiveRecord::Base
2
2
  has_event :complete
3
- has_event :archive, skip_scopes: true
3
+ has_events :archive, skip_scopes: true
4
4
 
5
5
  def complete!
6
6
  super
@@ -1,3 +1,4 @@
1
+ ENV['RAILS_ENV'] ||= 'development'
1
2
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
2
3
 
3
4
  require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -5,7 +5,7 @@
5
5
  # gem 'sqlite3'
6
6
  development:
7
7
  adapter: sqlite3
8
- database: spec/dummy/db/development.sqlite3
8
+ database: db/development.sqlite3
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
@@ -14,12 +14,12 @@ development:
14
14
  # Do not set this db to the same as development or production.
15
15
  test:
16
16
  adapter: sqlite3
17
- database: spec/dummy/db/test.sqlite3
17
+ database: db/test.sqlite3
18
18
  pool: 5
19
19
  timeout: 5000
20
20
 
21
21
  production:
22
22
  adapter: sqlite3
23
- database: spec/dummy/db/production.sqlite3
23
+ database: db/production.sqlite3
24
24
  pool: 5
25
25
  timeout: 5000
@@ -1,5 +1,10 @@
1
1
  ENV['RAILS_ENV'] ||= 'test'
2
2
 
3
+ require 'bundler/setup'
4
+ require 'coveralls'
5
+
6
+ Coveralls.wear!
7
+
3
8
  require File.expand_path('dummy/config/environment.rb', __dir__)
4
9
 
5
10
  require 'factory_girl'
@@ -10,9 +15,6 @@ require 'zonebie/rspec'
10
15
  Dir["#{__dir__}/support/**/*.rb"].each { |f| require f }
11
16
 
12
17
  RSpec.configure do |config|
13
- config.color = true
14
- config.order = :random
15
-
16
18
  config.include FactoryGirl::Syntax::Methods
17
19
  config.include GeneratorHelpers, type: :generator
18
20
  end
@@ -0,0 +1,5 @@
1
+ RSpec::Matchers.define :have_method do |expected|
2
+ match do |actual|
3
+ actual.public_instance_methods.include?(expected)
4
+ end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record-events
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Pieńkowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-28 00:00:00.000000000 Z
11
+ date: 2020-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: verbs
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.1'
33
+ version: '2.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.1'
40
+ version: '2.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: factory_girl
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -114,28 +128,14 @@ dependencies:
114
128
  requirements:
115
129
  - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: 1.3.13
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 1.3.13
125
- - !ruby/object:Gem::Dependency
126
- name: standalone_migrations
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '5.2'
131
+ version: '1.3'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '5.2'
138
+ version: '1.3'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: timecop
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -175,27 +175,28 @@ files:
175
175
  - README.md
176
176
  - Rakefile
177
177
  - lib/active_record/events.rb
178
+ - lib/active_record/events/extension.rb
178
179
  - lib/active_record/events/macro.rb
180
+ - lib/active_record/events/method_factory.rb
179
181
  - lib/active_record/events/naming.rb
180
- - lib/active_record/events/verbs.rb
181
182
  - lib/active_record/events/version.rb
182
183
  - lib/generators/active_record/event/USAGE
183
184
  - lib/generators/active_record/event/event_generator.rb
184
185
  - spec/active_record/events/macro_spec.rb
186
+ - spec/active_record/events/method_factory_spec.rb
185
187
  - spec/active_record/events/naming_spec.rb
186
188
  - spec/active_record/events_spec.rb
187
189
  - spec/dummy/app/models/task.rb
188
190
  - spec/dummy/config/boot.rb
189
191
  - spec/dummy/config/database.yml
190
192
  - spec/dummy/config/environment.rb
191
- - spec/dummy/db/development.sqlite3
192
193
  - spec/dummy/db/migrate/20150813132804_create_tasks.rb
193
194
  - spec/dummy/db/schema.rb
194
- - spec/dummy/db/test.sqlite3
195
195
  - spec/generators/active_record/event/event_generator_spec.rb
196
196
  - spec/spec_helper.rb
197
- - spec/support/factories.rb
198
- - spec/support/generator_helpers.rb
197
+ - spec/support/factories/task_factory.rb
198
+ - spec/support/helpers/generator_helpers.rb
199
+ - spec/support/matchers/have_method.rb
199
200
  homepage: https://github.com/pienkowb/active_record-events
200
201
  licenses:
201
202
  - MIT
@@ -226,12 +227,12 @@ test_files:
226
227
  - spec/dummy/config/database.yml
227
228
  - spec/dummy/config/boot.rb
228
229
  - spec/dummy/db/schema.rb
229
- - spec/dummy/db/test.sqlite3
230
230
  - spec/dummy/db/migrate/20150813132804_create_tasks.rb
231
- - spec/dummy/db/development.sqlite3
231
+ - spec/active_record/events/method_factory_spec.rb
232
232
  - spec/active_record/events/naming_spec.rb
233
233
  - spec/active_record/events/macro_spec.rb
234
234
  - spec/active_record/events_spec.rb
235
- - spec/support/generator_helpers.rb
236
- - spec/support/factories.rb
235
+ - spec/support/factories/task_factory.rb
236
+ - spec/support/matchers/have_method.rb
237
+ - spec/support/helpers/generator_helpers.rb
237
238
  - spec/generators/active_record/event/event_generator_spec.rb
@@ -1,5 +0,0 @@
1
- require 'verbs'
2
-
3
- Verbs::Conjugator.conjugations do |conjugate|
4
- conjugate.single_terminal_consonant :deliver
5
- end
Binary file