secretary-rails 2.0.0 → 2.0.1
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 +4 -4
- data/lib/secretary/dirty_associations.rb +4 -3
- data/lib/secretary/dirty_associations/collection.rb +13 -9
- data/lib/secretary/gem_version.rb +1 -1
- data/spec/internal/app/models/story.rb +3 -0
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/db/schema.rb +2 -2
- data/spec/internal/log/test.log +127660 -0
- data/spec/lib/secretary/dirty_collection_association_spec.rb +16 -0
- data/spec/tmp/db/migrate/{20150317210159_secretary_create_versions.rb → 20150512091501_secretary_create_versions.rb} +0 -0
- metadata +6 -6
@@ -374,6 +374,22 @@ describe "Dirty Collection Association" do
|
|
374
374
|
let(:story) { create :story }
|
375
375
|
let(:user) { create :user, :name => "Bryan" }
|
376
376
|
|
377
|
+
it "can track the join model" do
|
378
|
+
# Github #14
|
379
|
+
story = build :story
|
380
|
+
user = build :user
|
381
|
+
|
382
|
+
user.save!
|
383
|
+
|
384
|
+
story.users << user
|
385
|
+
story.save!
|
386
|
+
|
387
|
+
version = story.versions.last
|
388
|
+
expect(version.object_changes["story_users"][0]).to eq []
|
389
|
+
expect(version.object_changes["story_users"][1][0]["story_id"]).to eq story.id
|
390
|
+
expect(version.object_changes["story_users"][1][0]["user_id"]).to eq user.id
|
391
|
+
end
|
392
|
+
|
377
393
|
it 'sets associations_were' do
|
378
394
|
story.users << user
|
379
395
|
expect(story.users_were).to eq []
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: secretary-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Ricker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
version: 1.7.0
|
80
80
|
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -89,7 +89,7 @@ dependencies:
|
|
89
89
|
version: 1.7.0
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
92
|
+
version: '2'
|
93
93
|
description: A Rails engine that provides simple versioning for your records.
|
94
94
|
email:
|
95
95
|
- bricker@scpr.org
|
@@ -147,7 +147,7 @@ files:
|
|
147
147
|
- spec/spec_helper.rb
|
148
148
|
- spec/support/test_setup.rb
|
149
149
|
- spec/tmp/config/initializers/secretary.rb
|
150
|
-
- spec/tmp/db/migrate/
|
150
|
+
- spec/tmp/db/migrate/20150512091501_secretary_create_versions.rb
|
151
151
|
homepage: https://github.com/scpr/secretary-rails
|
152
152
|
licenses:
|
153
153
|
- MIT
|
@@ -203,4 +203,4 @@ test_files:
|
|
203
203
|
- spec/spec_helper.rb
|
204
204
|
- spec/support/test_setup.rb
|
205
205
|
- spec/tmp/config/initializers/secretary.rb
|
206
|
-
- spec/tmp/db/migrate/
|
206
|
+
- spec/tmp/db/migrate/20150512091501_secretary_create_versions.rb
|