list_controls 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -13,7 +13,7 @@ Controller:
13
13
 
14
14
  class ProductsController < ApplicationController
15
15
 
16
- can_filter_and_sort
16
+ enable_list_controls
17
17
 
18
18
  def default_filters
19
19
  { 'state' => 'new' }
@@ -0,0 +1,2 @@
1
+ require 'list_controls/action_controller'
2
+ require 'list_controls/rails_helpers'
@@ -1,17 +1,17 @@
1
- module ActionController
2
- module ListControls
1
+ module ListControls
2
+ module ActionController
3
3
 
4
4
  def self.included(base)
5
5
  base.extend(ClassMethods)
6
6
  end
7
7
 
8
8
  module ClassMethods
9
- def can_filter_and_sort(options = {})
10
- include ActionController::ListControls::InstanceMethods
9
+ def enable_list_controls(options = {})
10
+ include ::ListControls::ActionController::InstanceMethods
11
11
 
12
12
  attr_reader :filters
13
13
 
14
- before_filter :set_filters
14
+ before_filter :assign_filters
15
15
  end
16
16
  end
17
17
 
@@ -23,7 +23,7 @@ module ActionController
23
23
  {}
24
24
  end
25
25
 
26
- def set_filters
26
+ def assign_filters
27
27
  session[:list_controls]||= {}
28
28
 
29
29
  session_store = session[:list_controls][self.class.to_s]||= {}
@@ -39,4 +39,4 @@ module ActionController
39
39
  end
40
40
  end
41
41
 
42
- ::ActionController::Base.send(:include, ActionController::ListControls)
42
+ ::ActionController::Base.send(:include, ::ListControls::ActionController)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: list_controls
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Laurynas Butkus
@@ -41,8 +41,9 @@ extensions: []
41
41
  extra_rdoc_files: []
42
42
 
43
43
  files:
44
- - lib/action_controller.rb
45
- - lib/rails_helpers.rb
44
+ - lib/list_controls.rb
45
+ - lib/list_controls/action_controller.rb
46
+ - lib/list_controls/rails_helpers.rb
46
47
  - README
47
48
  - MIT-LICENSE
48
49
  - Rakefile