live_fixtures 0.1.1 → 0.2.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: 8395ce611ed8a861cdc45201f736748f1553170b
4
- data.tar.gz: 2f2366f259279f43a1df43df05b6d42ab16dfca4
3
+ metadata.gz: 65c289e9334bcc64e494914412b0009ba331df5d
4
+ data.tar.gz: 1c4e83eb54bc2e270b425e04626fe24d15b0f327
5
5
  SHA512:
6
- metadata.gz: d8967a938a1ce69b465e64c2d82949624274cc69fe82f4fa46a3d4b11d055ce7ddb7edec0227b8c15ec60dd1cd9968e9d3a979de7a74d14feb47d091a8ee75c2
7
- data.tar.gz: 74867a18f1f3996c48ced1cfa65498b7b30fa08a4511650766706291d6d4bf960491b0b073b9fbac747e93dc85a30036822fc95947df8cb41b6dd8faf75170be
6
+ metadata.gz: 1ce276cc748f25dd873cd6685da27f96893cba3a1fe254b3dfaf135f46c2ed2db485b9710ad9d45f53f10faa2759a54d419b00fee50c8e9efd147ae83b7a3bae
7
+ data.tar.gz: 16dafe289086b77e9177766fe059451258c1647d84b1c03249c83f965a176930be4d9d9578ab72ac50a2388040bd37ab24751f551398ddeeb3ccc9f48e1a4ae5
@@ -2,12 +2,18 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [0.2.0] - (Unreleased)
6
+ ### Breaking change
7
+ - live_fixtures now depends on activerecord ~> 4.2
8
+
9
+ [0.2.0]: https://github.com/NoRedInk/live_fixtures/compare/v0.1.1...v0.2.0
10
+
5
11
  ## [0.1.1] - 2016-06-30
6
12
  ### Fixed
7
13
  - [live fixtures works better with slow TTYs & zeus](https://github.com/NoRedInk/live_fixtures/pull/4)
8
14
 
15
+ [0.1.1]: https://github.com/NoRedInk/live_fixtures/compare/v0.1.0...v0.1.1
16
+
9
17
  ## 0.1.0 - 2016-06-13
10
18
  ### Added
11
19
  - initial release
12
-
13
- [0.1.1]: https://github.com/NoRedInk/live_fixtures/compare/v0.1.0...v0.1.1
@@ -65,8 +65,8 @@ class LiveFixtures::Import
65
65
  @label_to_id = {}
66
66
  end
67
67
 
68
- # https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/fixtures.rb#L462
69
- # The very similar method: ActiveRecord::Fixtures.create_fixtures has the
68
+ # https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/fixtures.rb#L496
69
+ # The very similar method: ActiveRecord::FixtureSet.create_fixtures has the
70
70
  # unfortunate side effect of truncating each table!!
71
71
  #
72
72
  # Therefore, we have reproduced the relevant sections here, without DELETEs,
@@ -8,15 +8,15 @@ class LiveFixtures::Import
8
8
  attr_reader :ar_fixtures
9
9
 
10
10
  def initialize(connection, table_name, class_name, filepath, label_to_id)
11
- @ar_fixtures = ActiveRecord::Fixtures.new connection,
12
- table_name,
13
- class_name,
14
- filepath
11
+ @ar_fixtures = ActiveRecord::FixtureSet.new connection,
12
+ table_name,
13
+ class_name,
14
+ filepath
15
15
  @label_to_id = label_to_id
16
16
  end
17
17
 
18
- # https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/fixtures.rb#L569
19
- # Rewritten to take advantage of @label_to_id instead of AR::Fixtures#identify,
18
+ # https://github.com/rails/rails/blob/4-2-stable/activerecord/lib/active_record/fixtures.rb#L611
19
+ # Rewritten to take advantage of @label_to_id instead of AR::FixtureSet#identify,
20
20
  # and to make an iterator.
21
21
  #
22
22
  # Iterator which yields [table_name, label, row] for each fixture
@@ -37,7 +37,7 @@ class LiveFixtures::Import
37
37
  maybe_convert_association_to_foreign_key row, association
38
38
 
39
39
  when :has_and_belongs_to_many
40
- join_table_name = association.options[:join_table]
40
+ join_table_name = association.join_table
41
41
 
42
42
  targets = row.delete(association.name.to_s)
43
43
  targets = targets.split(/\s*,\s*/) unless targets.is_a?(Array)
@@ -1,3 +1,3 @@
1
1
  module LiveFixtures
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jleven
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '4.2'
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.2'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ruby-progressbar
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- version: '0'
153
+ version: '2.1'
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="