rails-tables 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,11 +7,11 @@ attr_accessor :name, :model
7
7
  self.model = model
8
8
  end
9
9
 
10
- attr_accessor :view, :filters
10
+ attr_accessor :view, :scopes
11
11
  def render_with(view, *args)
12
12
  arguments = args.pop || {}
13
13
  self.view = view
14
- self.filters = arguments.fetch(:filters, {})
14
+ self.scopes = arguments.fetch(:scopes, {})
15
15
  return self
16
16
  end
17
17
 
@@ -24,7 +24,7 @@ attr_accessor :view, :filters
24
24
  }
25
25
  end
26
26
 
27
- class_attribute :columns, :searches, :scopes, :match_any
27
+ class_attribute :columns, :searches, :authorized_scopes, :match_any
28
28
  def self.column(name, *args)
29
29
  arguments = args.pop || {}
30
30
  self.columns = [] if self.columns.nil?
@@ -36,8 +36,8 @@ class_attribute :columns, :searches, :scopes, :match_any
36
36
  self.searches << Search.new(name, self, arguments)
37
37
  end
38
38
  def self.available_scopes(*args)
39
- self.scopes = [] if self.scopes.nil?
40
- self.scopes += args
39
+ self.authorized_scopes = [] if self.authorized_scopes.nil?
40
+ self.authorized_scopes += args
41
41
  end
42
42
  def self.match_any_column(match_any=true)
43
43
  self.match_any = true if self.match_any.nil?
@@ -52,8 +52,8 @@ private
52
52
  else
53
53
  objects = self.model
54
54
  end
55
- self.filters.each do |method, arguments|
56
- objects = objects.send(method, *arguments) if self.scopes.include?(method.to_sym)
55
+ self.scopes.each do |method, arguments|
56
+ objects = objects.send(method, *arguments) if self.authorized_scopes.include?(method.to_sym)
57
57
  end
58
58
  if params[:sSearch].present?
59
59
  objects = objects.send("#{self.name}_search", params[:sSearch])
@@ -1,3 +1,3 @@
1
1
  module RailsTables
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-tables
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -75,8 +75,7 @@ dependencies:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 1.0.11
78
- description: A clean jQuery datatables DSL that follows the structure of Ryan Bate's
79
- jQuery datatables railscast.
78
+ description: A clean jQuery datatables DSL.
80
79
  email:
81
80
  - dev@chriskeele.com
82
81
  executables: []