qm-acts-as-generic-controller 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
  gemspec.email = "marcin@saepia.net"
10
10
  gemspec.homepage = "http://q.saepia.net"
11
11
  gemspec.authors = ["Marcin Lewandowski"]
12
- gemspec.version = "0.1.11"
12
+ gemspec.version = "0.1.12"
13
13
  gemspec.files = Rake::FileList.new [ "MIT-LICENSE", "Rakefile", "lib/*", "app/views/generic_controller/*" ]
14
14
  gemspec.add_dependency "qui-common-helpers", ">= 0.0.8"
15
15
  gemspec.add_dependency "qui-index-table", ">= 0.0.8"
@@ -1,7 +1,8 @@
1
1
  <%- records ||= instance_variable_get("@#{@controller.class.to_s.demodulize.gsub("Controller", "").tableize}") -%>
2
2
  <%- class_name ||= @controller.class.to_s.demodulize.gsub("Controller", "").singularize.constantize -%>
3
3
 
4
- <%- privileged_fields = class_name.generic_fields(:action => :index).collect{|field| field if not current_user.respond_to? "has_privileges?" or (class_name.generic_field_associations.has_key?(field[:name]) and current_user.has_privileges?(:class_name => class_name.generic_field_associations[field[:name]][:class_name])) or (current_user.has_privileges?(:class_name => class_name, :attribute => field[:name], :mode => :read)) } -%>
4
+ <%- privileged_fields = class_name.generic_fields(:action => :index).collect{|field| field if not current_user.respond_to? "has_privileges?" or (class_name.generic_field_associations.has_key?(field[:name]) and current_user.has_privileges?(:class_name => class_name.generic_field_associations[field[:name]][:class_name])) or (current_user.has_privileges?(:class_name => class_name, :attribute => field[:name], :mode => :read)) }.compact -%>
5
+
5
6
 
6
7
  <%- headers = privileged_fields.collect{ |x| x[:options][:index_header] || ".#{x[:name]}".to_sym } -%>
7
8
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qm-acts-as-generic-controller
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 11
10
- version: 0.1.11
9
+ - 12
10
+ version: 0.1.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcin Lewandowski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-18 00:00:00 +01:00
18
+ date: 2010-11-22 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency