web-connect 0.1.9 → 0.1.10

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: c8852960947e0101b9aed18431e816918a725f40
4
- data.tar.gz: fc021a0da52de9ad21c1711954bb7c6eb38e46bb
3
+ metadata.gz: b297a57d736e3dc2860b710c3fb2d53f9e962841
4
+ data.tar.gz: 20e06cbe434da29e8cba8171fd7a018f1e3c7f64
5
5
  SHA512:
6
- metadata.gz: bac7b2e4a6e609c2b5a606c37ce47deb406b6316a44205a0afde70294d811f58b83f70ae9a3984b028cccec476dbf28099f2393358472db91135f04a235c149c
7
- data.tar.gz: 4e787404157caaaa09e3d57807b9760b03fed6fa58d5fb6901ae20546e17b3bd0e39f37622d0ab21f1ec80da7de9e4c9f691381e6e5a717732004c35e9895cb8
6
+ metadata.gz: 323eb6b99f136b4530bf1804879339a8909b642bf96f06f097231afabcec247c18a2cefe02718a0cc24080d365bf520a5f2d0454dc0a71a4ce64aab0d023d51e
7
+ data.tar.gz: f054a41d4dc3b02f4a22a8447320c3d111e83274172671c6e0d918c149e479af78ea9ac7f14f478c65c29ec49e59de09dfaaa03154b8b1140cea3d5afe74642d
@@ -33,6 +33,14 @@ module Netfira::WebConnect
33
33
  [name, ActiveRecord::Base.method(name)]
34
34
  end.to_h
35
35
 
36
+ # Save the original schema migration table
37
+ migration_table = ActiveRecord::SchemaMigration.all.table
38
+ original_migration_table = [migration_table.name, migration_table.engine]
39
+
40
+ # Sub in our own migration table details
41
+ migration_table.name = Netfira::WebConnect.schema_migrations_table_name
42
+ migration_table.engine = Model
43
+
36
44
  # Add some new methods
37
45
  class << ActiveRecord::Base
38
46
  def connection_pool
@@ -49,6 +57,9 @@ module Netfira::WebConnect
49
57
  # Run the given block
50
58
  result = yield
51
59
 
60
+ # Restore the original migration table name
61
+ migration_table.name, migration_table.engine = original_migration_table
62
+
52
63
  # Restore the original methods
53
64
  originals.each { |name, method| ActiveRecord::Base.define_singleton_method name, method }
54
65
 
@@ -35,7 +35,7 @@ class Netfira::WebConnect::RackApp
35
35
 
36
36
  def unrelate_records(origin_ids)
37
37
  records = origin_ids.map{ |k, id| k.find_by_origin_id shop, id }.reject(&:nil?)
38
- records[0].delete records[1] if records.size == 2
38
+ records[0].unrelate records[1] if records.size == 2
39
39
  end
40
40
 
41
41
  def complete_relation(class_name, relation)
@@ -9,7 +9,7 @@ module Netfira::WebConnect
9
9
  merge! classes.map{ |klass| [klass, Table.new(klass)] }.to_h
10
10
  end
11
11
 
12
- def as_json(options)
12
+ def as_json(options = nil)
13
13
  map do |klass, table|
14
14
  [klass.name.demodulize.pluralize, table.as_json(options)]
15
15
  end.to_h
@@ -1,5 +1,5 @@
1
1
  module Netfira
2
2
  module WebConnect
3
- VERSION = '0.1.9'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil E. Pearson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-22 00:00:00.000000000 Z
12
+ date: 2014-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord