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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/model_view.rb +2 -1
- data/lib/model_view/version.rb +1 -1
- data/spec/model_view/model_view_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0885b745771d5534eb267626b8d700db8960179f'
|
4
|
+
data.tar.gz: f5b24180e59c055bd63657362e6fd28c13047149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01fdace93124435a1d22af99009656c8de9cde716319dbe8881b5d62aa14adf893b4b217663ced28f9c864e4ef5cc156542eecc8b0eed7e40a768b17b43c077a
|
7
|
+
data.tar.gz: ab43776039f08301579a2e607a06e1cc7aecc6627bd5dbdbd7783942ffced536a4c468bbd617f8c7155b8e788b180b9e0d3c4fc0476bf2e2a51ae9987f50f72f
|
data/CHANGELOG.md
CHANGED
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
|
data/lib/model_view/version.rb
CHANGED
@@ -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 =
|
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 =
|
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
|