remote_db 0.0.7 → 0.0.8

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: 9a04d319e52193956618290cf2b0f83edf74eb8b
4
- data.tar.gz: b5e2640d6bff66264d16cc9f1fb94e5dab11be41
3
+ metadata.gz: e825f0a0f855f9e13e2e0a853e5c3b953a7fa604
4
+ data.tar.gz: e851fd91b0844519e59db00879475a4982e3f858
5
5
  SHA512:
6
- metadata.gz: 03a856f22e4032eb4a27b250e43e519df732d8956f948e0cd2ea0152f862c4091e82f76d6de34a593922ed3fab43502368abe417ef166302aa2fd84ca5e86e40
7
- data.tar.gz: 8f4cb3df65bd76b2327011acfa46397af5133b39b616850d479ffd5917885ed85a56273317736f504c30d55937a733f2bca5693ee3ff64354ad4fc5ba643241e
6
+ metadata.gz: 972201bcb4d619fa850f00babf03146e71ed117d997d2d9ea7cfdbda2e393df8b8fb9746aacd0d5f206c9d7577951388b7b2ce98db184275d23a6f0b0941abcd
7
+ data.tar.gz: 6fc148e306fc88d83e9ec3fc78f04cf48beb7734206314f0be09f927c49e90433e04d3b35242bfe3e79918bfc842f5a7272d6cc0c766dc0aab9e5ced5fa8b2df
data/.gitignore CHANGED
@@ -8,3 +8,6 @@ dump.rdb
8
8
  /.idea
9
9
  /.project
10
10
  /pmip
11
+
12
+ # Ignore Gemfile.lock
13
+ Gemfile.lock
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.0.8
2
+
3
+ * Mock concern to unrestrict hidden columns
4
+
1
5
  ## v0.0.7
2
6
 
3
7
  * Fix incompatible read_attribute_wthout_safety method alias
@@ -63,10 +63,11 @@ module RemoteDb
63
63
  # Force model to be ready-only
64
64
  if options[:readonly]
65
65
  include Concerns::ReadOnlyModel
66
+ # Scope which columns are exposed
67
+ include Concerns::RestrictedColumns
68
+ else
69
+ include Concerns::RestrictedColumnsMock
66
70
  end
67
-
68
- # Scope which columns are exposed
69
- include Concerns::RestrictedColumns
70
71
  end
71
72
 
72
73
  self.const_set 'BaseRecord', klass
@@ -0,0 +1,11 @@
1
+ module RemoteDb
2
+ module Concerns
3
+ module RestrictedColumnsMock
4
+ extend ActiveSupport::Concern
5
+ module ClassMethods
6
+ def table_columns=(visible_columns)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module RemoteDb
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
data/lib/remote_db.rb CHANGED
@@ -6,3 +6,4 @@ require_relative 'remote_db/version'
6
6
  require_relative 'remote_db/concerns/configurable'
7
7
  require_relative 'remote_db/concerns/read_only_model'
8
8
  require_relative 'remote_db/concerns/restricted_columns'
9
+ require_relative 'remote_db/concerns/restricted_columns_mock'
@@ -157,6 +157,16 @@ describe RemoteDb do
157
157
  expect(TestDb::Person.first.first_name).to eq('John')
158
158
  expect(TestDb::Person.last.first_name).to eq('Bob')
159
159
  end
160
+
161
+ it 'should not raise error and successfully create with hidden column' do
162
+ expect(TestDb::Person.count).to eq(1)
163
+ TestDb.without_readonly do
164
+ TestDb::Person.create(first_name: 'Alice', last_name: 'Smith')
165
+ end
166
+ expect(TestDb::Person.count).to eq(2)
167
+ expect(TestDb::Person.last.first_name).to eq('Alice')
168
+ end
169
+
160
170
  end
161
171
  end
162
172
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Skalli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-03 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -82,6 +82,7 @@ files:
82
82
  - lib/remote_db/concerns/configurable.rb
83
83
  - lib/remote_db/concerns/read_only_model.rb
84
84
  - lib/remote_db/concerns/restricted_columns.rb
85
+ - lib/remote_db/concerns/restricted_columns_mock.rb
85
86
  - lib/remote_db/configuration.rb
86
87
  - lib/remote_db/version.rb
87
88
  - remote_db.gemspec
@@ -108,8 +109,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
109
  version: '0'
109
110
  requirements: []
110
111
  rubyforge_project:
111
- rubygems_version: 2.0.14
112
+ rubygems_version: 2.4.4
112
113
  signing_key:
113
114
  specification_version: 4
114
115
  summary: Easily create a gem for consuming remote database tables/columns.
115
116
  test_files: []
117
+ has_rdoc: