HornsAndHooves-moribus 0.4.3 → 0.4.4

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: 3f9194654bbeebef4db4c98f24246c8c444a307a
4
- data.tar.gz: b21548da9a34e71cf86d81fc4f3223bccac26f8c
3
+ metadata.gz: a9af55b2fc41dd5db61bc98f44e6a3f2b4de950d
4
+ data.tar.gz: f646aafaf86ec6389dbe8b39fe3664cb2909257e
5
5
  SHA512:
6
- metadata.gz: 3e010e70ad8cf22b9a909563faed39839e59dd6efb30bde31366502f31c75484ce1b7722e52945a8bb91aba842efd320ec59b28f68f3233d6a630b292cd8eb39
7
- data.tar.gz: 0f3133f27b5a5896525ba3d2a7a8fcca56a25b65497fc949bdfb9579fc8248b74fd871f87c4c0f501a41f595916ebc95c1f3e2cb5b073a89110dc83241ac852a
6
+ metadata.gz: 1ad85d605b3e35f1cf1e9c62ccb94be44d02b72af11f3b7abd5b6bfbea604ffdd1e209c8cd1a95da71e35a71dfbd02a67c27088aacb14f5a22f01e4295b4ebbd
7
+ data.tar.gz: a366ed36337e2516002bc426122715c49e8c4b15e58c2a8d56d479e5b1fd82de4941f23319f52bafe611f4ad07b7350684a91a1b9181dda2a140a187e19dd5d4
data/.simplecov CHANGED
@@ -12,7 +12,7 @@ SimpleCov.start do
12
12
  # Fail the build when coverage is weak:
13
13
  at_exit do
14
14
  SimpleCov.result.format!
15
- threshold, actual = 96.875, SimpleCov.result.covered_percent
15
+ threshold, actual = 96.969, SimpleCov.result.covered_percent
16
16
  if actual < threshold
17
17
  msg = "\nLow coverage: "
18
18
  msg << red("#{actual}%")
@@ -6,8 +6,8 @@ require "moribus/version"
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "HornsAndHooves-moribus"
8
8
  s.version = Moribus::VERSION
9
- s.authors = ["HornsAndHooves", "Artem Kuzko", "Sergey Potapov"]
10
- s.email = ["a.kuzko@gmail.com", "blake131313@gmail.com"]
9
+ s.authors = ["HornsAndHooves", "Arthur Shagall", "Artem Kuzko", "Sergey Potapov"]
10
+ s.email = ["arthur.shagall@gmail.com", "a.kuzko@gmail.com", "blake131313@gmail.com"]
11
11
  s.homepage = "https://github.com/HornsAndHooves/moribus"
12
12
  s.licenses = ["MIT"]
13
13
  s.summary = %q{Introduces Aggregated and Tracked behavior to ActiveRecord::Base models}
@@ -48,9 +48,18 @@ module Moribus
48
48
 
49
49
  # Bang version of #save.
50
50
  def save!(*args)
51
- save(*args) or raise ActiveRecord::RecordNotSaved
51
+ save(*args) or raise_record_not_saved_error
52
52
  end
53
53
 
54
+ # Raise "record not saved".
55
+ def raise_record_not_saved_error
56
+ args =
57
+ (Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR < 2) ? [] : ["Failed to save record"]
58
+
59
+ raise ActiveRecord::RecordNotSaved, *args
60
+ end
61
+ private :raise_record_not_saved_error
62
+
54
63
  # Use the +lookup_relation+ to get the very first existing record that
55
64
  # corresponds to +self+.
56
65
  def lookup_self
@@ -1,3 +1,3 @@
1
1
  module Moribus # :nodoc:
2
- VERSION = "0.4.3" # :nodoc:
2
+ VERSION = "0.4.4" # :nodoc:
3
3
  end
@@ -189,6 +189,14 @@ describe Moribus do
189
189
  expect(name.id).to eq @existing.id
190
190
  end
191
191
 
192
+ it "raises the expected error when 'save!' fails" do
193
+ name = SpecPersonName.create :first_name => "Alice", :last_name => "Smith"
194
+ name.last_name = nil
195
+ expect {
196
+ name.save!
197
+ }.to raise_error(ActiveRecord::RecordNotSaved)
198
+ end
199
+
192
200
  context "with caching" do
193
201
  before do
194
202
  @existing = SpecCustomerFeature.create(:feature_name => "Pays")
data/tags ADDED
@@ -0,0 +1,160 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.8 //
7
+ AggregatedBehavior lib/moribus/aggregated_behavior.rb 15;" m line:15 class:Moribus
8
+ AggregatedCacheBehavior lib/moribus/aggregated_cache_behavior.rb 20;" m line:20 class:Moribus
9
+ AliasAssociation lib/moribus/alias_association.rb 17;" m line:17 class:Moribus
10
+ AllFiles coverage/index.html 32;" a line:32
11
+ Application spec/dummy/config/application.rb 9;" c line:9 class:Dummy
12
+ ApplicationController spec/dummy/app/controllers/application_controller.rb 1;" c line:1
13
+ ApplicationHelper spec/dummy/app/helpers/application_helper.rb 1;" m line:1
14
+ ClassMethods lib/moribus.rb 24;" m line:24 class:Moribus
15
+ ClassMethods lib/moribus/aggregated_cache_behavior.rb 38;" m line:38 class:Moribus.AggregatedCacheBehavior
16
+ ClassMethods lib/moribus/alias_association.rb 21;" m line:21 class:Moribus.AliasAssociation
17
+ ClassMethods lib/moribus/extensions.rb 13;" m line:13 class:Moribus.Extensions
18
+ ClassMethods lib/moribus/tracked_behavior.rb 14;" m line:14 class:Moribus.TrackedBehavior
19
+ ColorizedText lib/colorized_text.rb 8;" m line:8
20
+ DelegateAssociated lib/moribus/extensions/delegate_associated.rb 8;" m line:8 class:Moribus.Extensions
21
+ Dummy spec/dummy/config/application.rb 8;" m line:8
22
+ Extensions lib/moribus/extensions.rb 4;" m line:4 class:Moribus
23
+ Extensions lib/moribus/extensions/delegate_associated.rb 2;" m line:2 class:Moribus
24
+ Extensions lib/moribus/extensions/has_aggregated_extension.rb 2;" m line:2 class:Moribus
25
+ Extensions lib/moribus/extensions/has_current_extension.rb 2;" m line:2 class:Moribus
26
+ HasAggregatedExtension lib/moribus/extensions/has_aggregated_extension.rb 5;" m line:5 class:Moribus.Extensions
27
+ HasCurrentExtension lib/moribus/extensions/has_current_extension.rb 5;" m line:5 class:Moribus.Extensions
28
+ Helper lib/moribus/extensions/has_aggregated_extension.rb 18;" c line:18 class:Moribus.Extensions.HasAggregatedExtension
29
+ K.D coverage/assets/0.10.0/application.js 17;" f line:17
30
+ K.D coverage/assets/0.8.0/application.js 17;" f line:17
31
+ K.E coverage/assets/0.10.0/application.js 17;" f line:17
32
+ K.E coverage/assets/0.8.0/application.js 17;" f line:17
33
+ K.l coverage/assets/0.10.0/application.js 17;" f line:17
34
+ K.l coverage/assets/0.8.0/application.js 17;" f line:17
35
+ K.m coverage/assets/0.10.0/application.js 17;" f line:17
36
+ K.m coverage/assets/0.8.0/application.js 17;" f line:17
37
+ Macros lib/moribus/macros.rb 4;" m line:4 class:Moribus
38
+ Moribus lib/moribus.rb 6;" m line:6
39
+ Moribus lib/moribus/aggregated_behavior.rb 1;" m line:1
40
+ Moribus lib/moribus/aggregated_cache_behavior.rb 1;" m line:1
41
+ Moribus lib/moribus/alias_association.rb 1;" m line:1
42
+ Moribus lib/moribus/extensions.rb 1;" m line:1
43
+ Moribus lib/moribus/extensions/delegate_associated.rb 1;" m line:1
44
+ Moribus lib/moribus/extensions/has_aggregated_extension.rb 1;" m line:1
45
+ Moribus lib/moribus/extensions/has_current_extension.rb 1;" m line:1
46
+ Moribus lib/moribus/macros.rb 1;" m line:1
47
+ Moribus lib/moribus/tracked_behavior.rb 1;" m line:1
48
+ Moribus lib/moribus/version.rb 1;" m line:1
49
+ MoribusSpecModel spec/support/moribus_spec_model.rb 26;" f line:26
50
+ MoribusSpecModel spec/support/moribus_spec_model.rb 2;" m line:2
51
+ SpecAuthor spec/moribus/alias_association_spec.rb 15;" c line:15
52
+ SpecComment spec/moribus/alias_association_spec.rb 23;" c line:23
53
+ SpecCustomer spec/moribus_spec.rb 87;" c line:87
54
+ SpecCustomerEmail spec/moribus_spec.rb 95;" c line:95
55
+ SpecCustomerFeature spec/moribus_spec.rb 44;" c line:44
56
+ SpecCustomerInfo spec/moribus_spec.rb 48;" c line:48
57
+ SpecCustomerInfoWithType spec/moribus_spec.rb 69;" c line:69
58
+ SpecPersonName spec/moribus_spec.rb 29;" c line:29
59
+ SpecPost spec/moribus/alias_association_spec.rb 5;" c line:5
60
+ SpecPostInfo spec/moribus/alias_association_spec.rb 19;" c line:19
61
+ SpecStatus spec/moribus_spec.rb 5;" c line:5
62
+ SpecSuffix spec/moribus_spec.rb 21;" c line:21
63
+ SpecType spec/moribus_spec.rb 13;" c line:13
64
+ TrackedBehavior lib/moribus/tracked_behavior.rb 8;" m line:8 class:Moribus
65
+ V.N coverage/assets/0.10.0/application.js 17;" f line:17
66
+ V.N coverage/assets/0.8.0/application.js 17;" f line:17
67
+ acts_as_aggregated lib/moribus.rb 28;" f line:28 class:Moribus.ClassMethods
68
+ acts_as_aggregated? lib/moribus.rb 58;" f line:58 class:Moribus.ClassMethods
69
+ acts_as_tracked lib/moribus.rb 46;" f line:46 class:Moribus.ClassMethods
70
+ acts_as_tracked? lib/moribus.rb 63;" f line:63 class:Moribus.ClassMethods
71
+ add_delegated_methods lib/moribus/extensions/has_aggregated_extension.rb 50;" f line:50 class:Moribus.Extensions.HasAggregatedExtension.Helper
72
+ aggregated_caching_column lib/moribus/aggregated_cache_behavior.rb 46;" f line:46 class:Moribus.AggregatedCacheBehavior.ClassMethods
73
+ alias_association lib/moribus/alias_association.rb 24;" f line:24 class:Moribus.AliasAssociation.ClassMethods
74
+ alias_association_accessor_methods lib/moribus/alias_association.rb 88;" f line:88 class:Moribus.AliasAssociation.ClassMethods
75
+ alias_association_methods lib/moribus/alias_association.rb 73;" f line:73 class:Moribus.AliasAssociation.ClassMethods
76
+ alias_collection_association_methods lib/moribus/alias_association.rb 108;" f line:108 class:Moribus.AliasAssociation.ClassMethods
77
+ alias_singular_association_methods lib/moribus/alias_association.rb 98;" f line:98 class:Moribus.AliasAssociation.ClassMethods
78
+ association lib/moribus/extensions.rb 24;" f line:24 class:Moribus.Extensions
79
+ b$.bA coverage/assets/0.10.0/application.js 17;" f line:17
80
+ b$.bA coverage/assets/0.8.0/application.js 17;" f line:17
81
+ b$.bW coverage/assets/0.10.0/application.js 17;" f line:17
82
+ b$.bW coverage/assets/0.8.0/application.js 17;" f line:17
83
+ b$.bX coverage/assets/0.10.0/application.js 17;" f line:17
84
+ b$.bX coverage/assets/0.8.0/application.js 17;" f line:17
85
+ b$.bY coverage/assets/0.10.0/application.js 17;" f line:17
86
+ b$.bY coverage/assets/0.8.0/application.js 17;" f line:17
87
+ b$.bZ coverage/assets/0.10.0/application.js 17;" f line:17
88
+ b$.bZ coverage/assets/0.8.0/application.js 17;" f line:17
89
+ b$.bi coverage/assets/0.10.0/application.js 17;" f line:17
90
+ b$.bi coverage/assets/0.8.0/application.js 17;" f line:17
91
+ b$.bj coverage/assets/0.10.0/application.js 17;" f line:17
92
+ b$.bj coverage/assets/0.8.0/application.js 17;" f line:17
93
+ b$.bk coverage/assets/0.10.0/application.js 17;" f line:17
94
+ b$.bk coverage/assets/0.8.0/application.js 17;" f line:17
95
+ b$.bl coverage/assets/0.10.0/application.js 17;" f line:17
96
+ b$.bl coverage/assets/0.8.0/application.js 17;" f line:17
97
+ b$.bm coverage/assets/0.10.0/application.js 17;" f line:17
98
+ b$.bm coverage/assets/0.8.0/application.js 17;" f line:17
99
+ belongs_to lib/moribus/alias_association.rb 39;" f line:39 class:Moribus.AliasAssociation.ClassMethods
100
+ bh.bg coverage/assets/0.10.0/application.js 17;" f line:17
101
+ bh.bg coverage/assets/0.8.0/application.js 17;" f line:17
102
+ bold lib/colorized_text.rb 30;" f line:30 class:ColorizedText
103
+ cache_aggregated_record lib/moribus/aggregated_cache_behavior.rb 63;" f line:63 class:Moribus.AggregatedCacheBehavior
104
+ caching_attribute lib/moribus/aggregated_cache_behavior.rb 71;" f line:71 class:Moribus.AggregatedCacheBehavior
105
+ cleanup spec/support/moribus_spec_model.rb 3;" F line:3 class:MoribusSpecModel
106
+ clear_cache lib/moribus/aggregated_cache_behavior.rb 40;" f line:40 class:Moribus.AggregatedCacheBehavior.ClassMethods
107
+ colorize lib/colorized_text.rb 10;" f line:10 class:ColorizedText
108
+ column_for_attribute lib/moribus/extensions/delegate_associated.rb 35;" f line:35 class:Moribus.Extensions.DelegateAssociated
109
+ content_changed? lib/moribus/tracked_behavior.rb 48;" f line:48 class:Moribus.TrackedBehavior
110
+ cp.ce coverage/assets/0.10.0/application.js 17;" f line:17
111
+ cp.ce coverage/assets/0.8.0/application.js 17;" f line:17
112
+ cp.cf coverage/assets/0.10.0/application.js 17;" f line:17
113
+ cp.cf coverage/assets/0.8.0/application.js 17;" f line:17
114
+ current_lock_value lib/moribus/tracked_behavior.rb 132;" f line:132
115
+ current_to_false_sql_statement lib/moribus/tracked_behavior.rb 105;" f line:105 class:Moribus.TrackedBehavior
116
+ define_delegation_module lib/moribus/extensions/has_aggregated_extension.rb 40;" f line:40 class:Moribus.Extensions.HasAggregatedExtension.Helper
117
+ define_effective_reader_for lib/moribus/macros.rb 144;" f line:144 class:Moribus.Macros
118
+ delegate_associated lib/moribus/macros.rb 51;" f line:51 class:Moribus.Macros
119
+ effective_ lib/moribus/macros.rb 146;" f line:146 class:Moribus.Macros.define_effective_reader_for
120
+ extend lib/moribus/extensions/has_aggregated_extension.rb 32;" f line:32 class:Moribus.Extensions.HasAggregatedExtension.Helper
121
+ extend_has_aggregated_reflection lib/moribus/extensions.rb 16;" f line:16 class:Moribus.Extensions.ClassMethods
122
+ first_name= spec/moribus_spec.rb 39;" f line:39 class:SpecPersonName
123
+ function.cr coverage/assets/0.10.0/application.js 17;" f line:17
124
+ function.cr coverage/assets/0.8.0/application.js 17;" f line:17
125
+ get_parent_relation_keys lib/moribus.rb 71;" f line:71 class:Moribus.ClassMethods
126
+ green lib/colorized_text.rb 20;" f line:20 class:ColorizedText
127
+ has_aggregated lib/moribus/macros.rb 108;" f line:108 class:Moribus.Macros
128
+ has_many lib/moribus/alias_association.rb 49;" f line:49 class:Moribus.AliasAssociation.ClassMethods
129
+ has_one lib/moribus/alias_association.rb 59;" f line:59 class:Moribus.AliasAssociation.ClassMethods
130
+ has_one_current lib/moribus/macros.rb 78;" f line:78 class:Moribus.Macros
131
+ include_delegation_module lib/moribus/extensions/has_aggregated_extension.rb 81;" f line:81 class:Moribus.Extensions.HasAggregatedExtension.Helper
132
+ initialize lib/moribus/extensions/has_aggregated_extension.rb 26;" f line:26 class:Moribus.Extensions.HasAggregatedExtension.Helper
133
+ k.function.J coverage/assets/0.10.0/application.js 17;" f line:17
134
+ k.function.J coverage/assets/0.8.0/application.js 17;" f line:17
135
+ k.var.e coverage/assets/0.10.0/application.js 17;" f line:17
136
+ k.var.e coverage/assets/0.8.0/application.js 17;" f line:17
137
+ lookup_relation lib/moribus/aggregated_behavior.rb 72;" f line:72 class:Moribus.AggregatedBehavior
138
+ lookup_self lib/moribus/aggregated_behavior.rb 65;" f line:65 class:Moribus.AggregatedBehavior
139
+ lookup_self lib/moribus/aggregated_cache_behavior.rb 52;" f line:52 class:Moribus.AggregatedCacheBehavior
140
+ lookup_self_and_replace lib/moribus/aggregated_behavior.rb 79;" f line:79 class:Moribus.AggregatedBehavior
141
+ methods_to_delegate_to lib/moribus/extensions/has_aggregated_extension.rb 67;" f line:67 class:Moribus.Extensions.HasAggregatedExtension.Helper
142
+ name lib/moribus/extensions/has_aggregated_extension.rb 87;" f line:87 class:Moribus.Extensions.HasAggregatedExtension.Helper
143
+ normalize_reflection lib/moribus/macros.rb 120;" f line:120 class:Moribus.Macros
144
+ raise_record_not_saved_error lib/moribus/aggregated_behavior.rb 55;" f line:55 class:Moribus.AggregatedBehavior
145
+ red lib/colorized_text.rb 25;" f line:25 class:ColorizedText
146
+ remove_target! lib/moribus/extensions/has_current_extension.rb 8;" f line:8 class:Moribus.Extensions.HasCurrentExtension
147
+ reset_persistence_values lib/moribus.rb 143;" f line:143 class:Moribus
148
+ restore_before_to_new_record_values lib/moribus.rb 133;" f line:133 class:Moribus
149
+ save lib/moribus/aggregated_behavior.rb 29;" f line:29 class:Moribus.AggregatedBehavior
150
+ save! lib/moribus/aggregated_behavior.rb 50;" f line:50 class:Moribus.AggregatedBehavior
151
+ set_lock lib/moribus/tracked_behavior.rb 69;" f line:69 class:Moribus.TrackedBehavior
152
+ set_parent lib/moribus.rb 108;" f line:108 class:Moribus
153
+ store_before_to_new_record_values lib/moribus.rb 124;" f line:124 class:Moribus
154
+ to_new_record! lib/moribus.rb 85;" f line:85 class:Moribus
155
+ to_persistent! lib/moribus.rb 94;" f line:94 class:Moribus
156
+ tracked_save_callback lib/moribus/tracked_behavior.rb 25;" f line:25 class:Moribus.TrackedBehavior
157
+ update_current lib/moribus/tracked_behavior.rb 56;" f line:56 class:Moribus.TrackedBehavior
158
+ updated? lib/moribus/extensions/has_aggregated_extension.rb 10;" f line:10 class:Moribus.Extensions.HasAggregatedExtension
159
+ updated_as_aggregated? lib/moribus.rb 117;" f line:117 class:Moribus
160
+ yellow lib/colorized_text.rb 15;" f line:15 class:ColorizedText
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HornsAndHooves-moribus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - HornsAndHooves
8
+ - Arthur Shagall
8
9
  - Artem Kuzko
9
10
  - Sergey Potapov
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2017-02-02 00:00:00.000000000 Z
14
+ date: 2017-03-30 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rails
@@ -120,6 +121,7 @@ description: |-
120
121
  Introduces Aggregated and Tracked behavior to ActiveRecord::Base models, as well
121
122
  as Macros and Extensions modules for more efficient usage.
122
123
  email:
124
+ - arthur.shagall@gmail.com
123
125
  - a.kuzko@gmail.com
124
126
  - blake131313@gmail.com
125
127
  executables: []
@@ -187,6 +189,7 @@ files:
187
189
  - spec/moribus_spec.rb
188
190
  - spec/spec_helper.rb
189
191
  - spec/support/moribus_spec_model.rb
192
+ - tags
190
193
  homepage: https://github.com/HornsAndHooves/moribus
191
194
  licenses:
192
195
  - MIT
@@ -207,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
210
  version: '0'
208
211
  requirements: []
209
212
  rubyforge_project:
210
- rubygems_version: 2.6.8
213
+ rubygems_version: 2.6.10
211
214
  signing_key:
212
215
  specification_version: 4
213
216
  summary: Introduces Aggregated and Tracked behavior to ActiveRecord::Base models