has-many-with-set 1.2.0 → 1.3.0

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: 4b1ed22920558c4bdd4b9254c7da6f730939d2ce
4
- data.tar.gz: 08e49dffaca90769eaaab09aba831b7916ccd76e
3
+ metadata.gz: 93548e8a95e04b64e08bebcf6fba55282f3ea3d7
4
+ data.tar.gz: 374a51505970c3b07ecf2ac7801c7a5578f69428
5
5
  SHA512:
6
- metadata.gz: fa351c04866a417c8404b3fa87e894953398c8ad3795f14e14b1c646c7f19a3cfad2bc6e7fb380f2c30e5e2f2ba1e2dc3e3a51fe1fef994fa6d2431dccd760f0
7
- data.tar.gz: d7c752071400ce7920552af6e971ea9344a7a99b309cf9095917bea826bd4aae72c682d84223acbf39744b0d76c7b470fed716f2941f0e159f6d11d76ce5b2f2
6
+ metadata.gz: f444c8f81e462051803fdd0fc2e326b60f876237aa34e5ebf7620f95cc916fccabc8468b76ea134d93c318a77729b3eba7fae19f9c21307d61c2f50cd831ec63
7
+ data.tar.gz: b448cc6bb24875e48e1ddb039ec11e286b54b1fba0d178c28af900058f16ef38f607392c4e5a7af46837eef82c6b240cd658cec8406fccab72c369e18959b23b
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ has-many-with-set 1.3.0
2
+
3
+ - Updated code to work with Rails 4.1.*
4
+
1
5
  has-many-with-set 1.2.0
2
6
 
3
7
  - Updated gemspec so the gem works with Rails 4.*.
@@ -3,6 +3,7 @@ require 'rails/generators'
3
3
  module HasManyWithSet
4
4
  class MigrationGenerator < Rails::Generators::Base
5
5
  include Rails::Generators::Migration
6
+
6
7
  source_root File.expand_path('../templates', __FILE__)
7
8
 
8
9
  def self.next_migration_number(path)
@@ -17,7 +18,7 @@ module HasManyWithSet
17
18
  attr_accessor :parent, :child
18
19
 
19
20
  desc "This generates the migration file needed for a has_many_with_set relationship."
20
- def create_migration
21
+ def create_migration_file
21
22
  @parent_table = parent.tableize
22
23
  @child_table = child.tableize
23
24
  @set_table = "#{ @parent_table }_#{ @child_table }_sets"
@@ -1,3 +1,3 @@
1
1
  module HasManyWithSet
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -5,6 +5,8 @@ CHILD = "ModelTwo"
5
5
  MIGRATION_PATH = "test/tmp/"
6
6
  MIGRATION_FILE = "db/migrate/create_model_ones_model_twos_set"
7
7
 
8
+ PrepareActiveRecord.prepare_default_schema
9
+
8
10
  class MigrationGeneratorTest < Rails::Generators::TestCase
9
11
  tests HasManyWithSet::MigrationGenerator
10
12
 
@@ -18,6 +20,8 @@ class MigrationGeneratorTest < Rails::Generators::TestCase
18
20
  end
19
21
  end
20
22
 
23
+ PrepareActiveRecord.run_migration(MIGRATION_FILE, MIGRATION_PATH)
24
+
21
25
  class HasManyWithSetTest < ActiveSupport::TestCase
22
26
  def setup
23
27
  unless @initialized
@@ -18,14 +18,9 @@ class PrepareActiveRecord
18
18
  end
19
19
 
20
20
  def run_migration(relative, root)
21
- file = migration_file_name(relative, root)
21
+ require(migration_file_name(relative, root))
22
22
 
23
- require(file)
24
-
25
- # I think this is horrendous but I don't want to hardcode the name of the class either.
26
- loaded_klass = Module.constants.last
27
-
28
- Object.const_get(loaded_klass).new.change
23
+ CreateModelOnesModelTwosSet.new.change
29
24
  end
30
25
 
31
26
  private
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has-many-with-set
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Soto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-04 00:00:00.000000000 Z
11
+ date: 2014-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '4.1'
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: '4.0'
26
+ version: '4.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: A smarter way of doing many-to-many relationships in Rails.
@@ -45,24 +45,24 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - CHANGELOG
49
+ - MIT-LICENSE
50
+ - README.textile
51
+ - Rakefile
48
52
  - lib/generators/has_many_with_set/migration_generator.rb
49
53
  - lib/generators/has_many_with_set/templates/sets.rb.erb
54
+ - lib/has-many-with-set.rb
50
55
  - lib/has-many-with-set/accessors.rb
51
56
  - lib/has-many-with-set/callbacks.rb
52
57
  - lib/has-many-with-set/has-many-with-set.rb
53
58
  - lib/has-many-with-set/queries.rb
54
59
  - lib/has-many-with-set/relationships.rb
55
60
  - lib/has-many-with-set/version.rb
56
- - lib/has-many-with-set.rb
57
- - MIT-LICENSE
58
- - Rakefile
59
- - README.textile
60
- - CHANGELOG
61
61
  - test/has-many-with-set_test.rb
62
62
  - test/support/models.rb
63
63
  - test/support/prepare_activerecord.rb
64
64
  - test/test_helper.rb
65
- - test/tmp/db/migrate/20130804213649_create_model_ones_model_twos_set.rb
65
+ - test/tmp/db/migrate/20141013205312_create_model_ones_model_twos_set.rb
66
66
  homepage: https://github.com/ebobby/has-many-with-set
67
67
  licenses: []
68
68
  metadata: {}
@@ -72,17 +72,17 @@ require_paths:
72
72
  - lib
73
73
  required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.0.2
85
+ rubygems_version: 2.2.2
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: A smarter way of doing many-to-many relationships in Rails.
@@ -91,4 +91,4 @@ test_files:
91
91
  - test/support/models.rb
92
92
  - test/support/prepare_activerecord.rb
93
93
  - test/test_helper.rb
94
- - test/tmp/db/migrate/20130804213649_create_model_ones_model_twos_set.rb
94
+ - test/tmp/db/migrate/20141013205312_create_model_ones_model_twos_set.rb