active_restrictors 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc
CHANGED
Binary file
|
@@ -47,7 +47,14 @@ module ActiveRestrictors
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
@_restrictor_inflector_helper ||= Class.send(:include, ActiveSupport::Inflector).new
|
50
|
-
values
|
50
|
+
unless(values)
|
51
|
+
values = restrictor[:class].scoped
|
52
|
+
if(restrictor[:views][:scope])
|
53
|
+
scoping = restrictor[:views][:scope].respond_to?(:call) ? restrictor[:views][:scope].call : restrictor[:views][:scope]
|
54
|
+
values = values.merge(scoping) if scoping
|
55
|
+
values = values.order("#{restrictor[:class].table_name}.#{restrictor[:views][:value]}").all
|
56
|
+
end
|
57
|
+
end
|
51
58
|
if(defined?(Formtastic) && form.is_a?(Formtastic::FormBuilder))
|
52
59
|
form.input(
|
53
60
|
restrictor[:name],
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_restrictors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Roberts
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-02-
|
18
|
+
date: 2012-02-29 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- gemfiles/activerecord3_1.gemfile.lock
|
48
48
|
- gemfiles/activerecord3_0.gemfile
|
49
49
|
- gemfiles/activerecord3_1.gemfile
|
50
|
+
- active_restrictors-0.2.2.gem
|
50
51
|
- Gemfile.lock
|
51
52
|
- spec/restrictor_spec.rb
|
52
53
|
- spec/setup.rb
|