active_mocker 1.1.8 → 1.1.9

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: 613f38220c1c399f17a225afae1041c1694bb982
4
- data.tar.gz: c645aa726a86296a7239fe1c173c37852a68b398
3
+ metadata.gz: d9940d5208df11f3cc98ab2172753293c4e6e480
4
+ data.tar.gz: 37c61f9c1cf275c9807f0de8b2f3c0bbdceedc30
5
5
  SHA512:
6
- metadata.gz: bee293efab67128df025c0d0c3810a69a2d533b78e10d6ab3ee42d491be09b23fb24718438f795000b1893a0e2c8f0d9bae8fc067b5119bec5fd0832704ccd86
7
- data.tar.gz: da922d7734e9b34e1edc048ddf3e6203a863bf996203761b22ed19ed353ae23e97c8678ce553abf813a024506ae72574dd272cc765c9c46b575072a153777482
6
+ metadata.gz: c49ea8b615fb04c03e59a75415dba2f906c262917785f8e1c8f5c6a49228425e2959f1c8d23c5819c5a3847c4380753b5b3bf6327528005237bcd1678b183820
7
+ data.tar.gz: 540acf96d88c6df5c474e8b69c40d92d3b6d4d4b691a87a71a55f558bf13b60da3ebb6d8e71c2ca48001c883569b317d5479923c32bde557bcef687f86c0cdb7
@@ -2,31 +2,35 @@ require_relative 'destroy_all'
2
2
  require_relative 'update'
3
3
  require_relative 'find_by'
4
4
  require_relative 'init'
5
+ module ActiveMocker
6
+ module ActiveHash
5
7
 
6
- module ActiveHash
8
+ module ARApi
7
9
 
8
- module ARApi
10
+ include ::ActiveHash::ARApi::Update
11
+ include ::ActiveHash::ARApi::Init
9
12
 
10
- include ARApi::Update
11
- include ARApi::Init
13
+ def self.included(base)
14
+ base.extend(ClassMethods)
15
+ end
12
16
 
13
- def self.included(base)
14
- base.extend(ClassMethods)
15
- end
17
+ module ClassMethods
18
+ include ::ActiveHash::ARApi::DestroyAll
19
+ include ::ActiveHash::ARApi::FindBy
16
20
 
17
- module ClassMethods
18
- include ARApi::DestroyAll
19
- include ARApi::FindBy
21
+ def find_or_create_by(attributes)
22
+ find_by(attributes) || create(attributes)
23
+ end
20
24
 
21
- def find_or_create_by(attributes)
22
- find_by(attributes) || create(attributes)
25
+ def find_or_initialize_by(attributes)
26
+ find_by(attributes) || new(attributes)
27
+ end
23
28
  end
24
29
 
25
- def find_or_initialize_by(attributes)
26
- find_by(attributes) || new(attributes)
27
- end
28
30
  end
29
31
 
32
+
33
+
30
34
  end
31
35
 
32
36
  end
@@ -216,7 +216,7 @@ module ActiveMocker
216
216
 
217
217
  def const_class
218
218
  remove_const(mock_class_name) if class_exists? mock_class_name
219
- klass = Object.const_set(mock_class_name ,Class.new(ActiveHash::Base)) if active_hash_as_base
219
+ klass = Object.const_set(mock_class_name ,Class.new(::ActiveHash::Base)) if active_hash_as_base
220
220
  klass.send(:include, ActiveHash::ARApi) if active_hash_as_base
221
221
  klass = Object.const_set(mock_class_name ,Class.new()) unless active_hash_as_base
222
222
  klass.extend ModelClassMethods
@@ -1,3 +1,3 @@
1
1
  module ActiveMocker
2
- VERSION = "1.1.8"
2
+ VERSION = "1.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_mocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Zeisler