active-list 4.1.5 → 4.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.5
1
+ 4.1.6
@@ -4,7 +4,7 @@ module ActiveList
4
4
  class Table
5
5
 
6
6
  # Add a new method in Table which permit to define data columns
7
- def action(name, options={})
7
+ def action(name, options = {})
8
8
  @columns << ActionColumn.new(self, name, options)
9
9
  end
10
10
 
@@ -17,7 +17,7 @@ module ActiveList
17
17
  end
18
18
 
19
19
 
20
- def operation(record='record')
20
+ def operation(record = 'record')
21
21
  @options[:method] = :delete if @name.to_s == "destroy" and !@options.has_key?(:method)
22
22
  @options[:confirm] = :are_you_sure_you_want_to_delete if @name.to_s == "destroy" and !@options.has_key?(:confirm)
23
23
  link_options = ""
@@ -69,6 +69,9 @@ module ActiveList
69
69
  if @options[:if]
70
70
  code = "if (" + (@options[:if].is_a?(Symbol) ? "#{record}.#{@options[:if]}" : @options[:if].to_s.gsub('RECORD', record)) + ")\n" + code + "\n end"
71
71
  end
72
+ if @options[:unless]
73
+ code = "unless (" + (@options[:unless].is_a?(Symbol) ? "#{record}.#{@options[:unless]}" : @options[:unless].to_s.gsub('RECORD', record)) + ")\n" + code + "\n end"
74
+ end
72
75
  code
73
76
  end
74
77
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: active-list
3
3
  version: !ruby/object:Gem::Version
4
4
  version: !binary |-
5
- NC4xLjU=
5
+ NC4xLjY=
6
6
  prerelease:
7
7
  platform: ruby
8
8
  authors: