model_view 0.6.0 → 0.6.1

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: 7f452a7c8518cd7317744d92c073b69ecda1a8ea
4
- data.tar.gz: d2f23452702e9503b9d6528318d3c3633626e67d
3
+ metadata.gz: '0885b745771d5534eb267626b8d700db8960179f'
4
+ data.tar.gz: f5b24180e59c055bd63657362e6fd28c13047149
5
5
  SHA512:
6
- metadata.gz: fb18484060aa0268040989d9442fa181bea59161c6eb1bccce476cdb6b31a1e168b6a37a0302155615b4d1371fbbfc16facc26e4d96132c3478d193159382d49
7
- data.tar.gz: e4f1038e682911d1a77a7576f262ff845ae0d343851ccd2162cd7dcc3e24324b62dc3fbb0399392401ce961ea731a537569e96ec442315edc4f318d4181690d5
6
+ metadata.gz: 01fdace93124435a1d22af99009656c8de9cde716319dbe8881b5d62aa14adf893b4b217663ced28f9c864e4ef5cc156542eecc8b0eed7e40a768b17b43c077a
7
+ data.tar.gz: ab43776039f08301579a2e607a06e1cc7aecc6627bd5dbdbd7783942ffced536a4c468bbd617f8c7155b8e788b180b9e0d3c4fc0476bf2e2a51ae9987f50f72f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ # 0.6.1
4
+ * Fix inheritance bug overwriting parent scope
5
+
3
6
  # 0.6.0
4
7
  * One level of inheritance from the parent class
5
8
 
data/lib/model_view.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'model_view/resolver'
2
2
  require 'model_view/updater'
3
+ require 'active_support/core_ext/object'
3
4
 
4
5
  module ModelView
5
6
 
@@ -102,7 +103,7 @@ module ModelView
102
103
 
103
104
  def create_scopes
104
105
  if self.superclass.respond_to?(:scopes) && @scopes.nil?
105
- @scopes = self.superclass.scopes
106
+ @scopes = self.superclass.scopes.deep_dup
106
107
  elsif @scopes.nil?
107
108
  @scopes = { ROOT => new_opts }
108
109
  end
@@ -1,3 +1,3 @@
1
1
  module ModelView
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -122,7 +122,7 @@ describe ModelView do
122
122
  child_class = Class.new(dummy_class)
123
123
  child_class.field :b_field, {setter: true, arg1: "foo2"}
124
124
 
125
- scope_setters = dummy_class.scopes[root_scope][:setters]
125
+ scope_setters = child_class.scopes[root_scope][:setters]
126
126
  expect(scope_setters[:a_field]).to eq({args: {arg1: "foo1"}, block: nil})
127
127
  expect(scope_setters[:b_field]).to eq({args: {arg1: "foo2"}, block: nil})
128
128
  end
@@ -136,7 +136,7 @@ describe ModelView do
136
136
  scope_fields = child_class.scopes[root_scope][:fields]
137
137
  expect(scope_fields[:a_field]).to eq({args: {arg1: "foo2"}, block: nil})
138
138
 
139
- scope_setters = dummy_class.scopes[root_scope][:setters]
139
+ scope_setters = child_class.scopes[root_scope][:setters]
140
140
  expect(scope_setters[:a_field]).to eq({args: {arg1: "foo2"}, block: nil})
141
141
  end
142
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Pretorius