will_filter 3.1.3 → 3.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.gitignore +1 -0
  2. data/.rvmrc +1 -1
  3. data/Gemfile.lock +2 -2
  4. data/README.rdoc +0 -3
  5. data/app/assets/javascripts/will_filter/filter.js +5 -5
  6. data/app/assets/javascripts/will_filter/filter_prototype_effects.js +1 -1
  7. data/app/assets/stylesheets/will_filter/exporter.css.scss +72 -49
  8. data/app/assets/stylesheets/will_filter/filter.css.scss +1 -0
  9. data/app/controllers/will_filter/application_controller.rb +1 -1
  10. data/app/controllers/will_filter/calendar_controller.rb +1 -1
  11. data/app/controllers/will_filter/exporter_controller.rb +15 -26
  12. data/app/controllers/will_filter/filter_controller.rb +7 -1
  13. data/app/models/will_filter/filter.rb +69 -12
  14. data/app/views/will_filter/exporter/export.html.erb +26 -2
  15. data/app/views/will_filter/exporter/index.html.erb +35 -43
  16. data/app/views/will_filter/filter/_conditions.html.erb +13 -32
  17. data/app/views/will_filter/filter/_conditions_footer.html.erb +17 -0
  18. data/app/views/will_filter/filter/_conditions_header.html.erb +38 -0
  19. data/app/views/will_filter/filter/_container.html.erb +3 -25
  20. data/lib/generators/will_filter/templates/config.yml +34 -1
  21. data/lib/generators/will_filter/will_filter_generator.rb +1 -1
  22. data/lib/tasks/will_filter_tasks.rake +1 -5
  23. data/lib/will_filter.rb +1 -1
  24. data/lib/will_filter/calendar.rb +1 -1
  25. data/lib/will_filter/config.rb +9 -1
  26. data/lib/will_filter/containers/boolean.rb +1 -1
  27. data/lib/will_filter/containers/date.rb +2 -8
  28. data/lib/will_filter/containers/date_range.rb +3 -9
  29. data/lib/will_filter/containers/date_time.rb +2 -8
  30. data/lib/will_filter/containers/date_time_range.rb +4 -16
  31. data/lib/will_filter/containers/double.rb +52 -0
  32. data/lib/will_filter/containers/double_delimited.rb +50 -0
  33. data/lib/will_filter/containers/double_range.rb +64 -0
  34. data/lib/will_filter/containers/filter_list.rb +1 -1
  35. data/lib/will_filter/containers/list.rb +1 -1
  36. data/lib/will_filter/containers/nil.rb +1 -1
  37. data/lib/will_filter/containers/numeric.rb +1 -1
  38. data/lib/will_filter/containers/numeric_delimited.rb +1 -1
  39. data/lib/will_filter/containers/numeric_range.rb +1 -1
  40. data/lib/will_filter/containers/single_date.rb +3 -3
  41. data/lib/will_filter/containers/text.rb +1 -1
  42. data/lib/will_filter/containers/text_delimited.rb +1 -1
  43. data/lib/will_filter/engine.rb +1 -1
  44. data/lib/will_filter/extensions/action_controller_extension.rb +1 -1
  45. data/lib/will_filter/extensions/action_view_extension.rb +1 -1
  46. data/lib/will_filter/extensions/active_record_extension.rb +1 -1
  47. data/lib/will_filter/extensions/array_extension.rb +1 -1
  48. data/lib/will_filter/filter_condition.rb +1 -1
  49. data/lib/will_filter/filter_container.rb +21 -3
  50. data/lib/will_filter/filter_exception.rb +1 -1
  51. data/lib/will_filter/railtie.rb +1 -1
  52. data/lib/will_filter/version.rb +2 -2
  53. data/spec/containers/double_spec.rb +16 -0
  54. data/spec/fake_app.rb +6 -12
  55. data/test/dummy/app/models/event.rb +1 -1
  56. data/test/dummy/app/models/event_filter.rb +4 -0
  57. data/test/dummy/app/models/event_user_filter.rb +4 -0
  58. data/test/dummy/app/models/user_filter.rb +31 -2
  59. data/test/dummy/config/will_filter/config.yml +9 -1
  60. data/test/dummy/db/migrate/20120223232000_add_rank_to_events.rb +5 -0
  61. data/test/dummy/db/schema.rb +2 -1
  62. metadata +40 -108
  63. data/config/will_filter/config.yml +0 -97
  64. data/db/migrate/20110924023807_create_will_filter_filters.rb +0 -15
@@ -1,97 +0,0 @@
1
- #############################################################################
2
- # will_filter configuration
3
- #
4
- # Default settings for all environments
5
- #
6
- # You can overload any feature for any environment by changing the
7
- # environment settings at the bottom of the file.
8
- #
9
- # Alternatively, you can overload any of the methods of WillFilter::Config
10
- #############################################################################
11
-
12
- defaults: &defaults
13
- effects_options:
14
- enabled: false
15
- script_path: "will_filter/filter_prototype_effects.js"
16
-
17
- save_options:
18
- enabled: true
19
- user_filters_enabled: false # if set to true, the filters will be private
20
- user_class_name: User
21
- current_user_method: current_user
22
-
23
- export_options:
24
- enabled: true
25
- default_formats: [html, csv, xml, json]
26
-
27
- containers: # container implementation mapping
28
- nil: WillFilter::Containers::Nil
29
- numeric: WillFilter::Containers::Numeric
30
- numeric_range: WillFilter::Containers::NumericRange
31
- numeric_delimited: WillFilter::Containers::NumericDelimited
32
- date_time_range: WillFilter::Containers::DateTimeRange
33
- single_date: WillFilter::Containers::SingleDate
34
- date: WillFilter::Containers::Date
35
- date_time: WillFilter::Containers::DateTime
36
- date_range: WillFilter::Containers::DateRange
37
- text: WillFilter::Containers::Text
38
- text_delimited: WillFilter::Containers::TextDelimited
39
- boolean: WillFilter::Containers::Boolean
40
- list: WillFilter::Containers::List
41
- filter_list: WillFilter::Containers::FilterList
42
-
43
- data_types: # mapping between data types and containers
44
- bigint: [nil, numeric, numeric_range, numeric_delimited]
45
- numeric: [nil, numeric, numeric_range, numeric_delimited]
46
- smallint: [nil, numeric, numeric_range, numeric_delimited]
47
- integer: [nil, numeric, numeric_range, numeric_delimited]
48
- int: [nil, numeric, numeric_range, numeric_delimited]
49
- double: [nil, numeric, numeric_range, numeric_delimited]
50
- timestamp: [nil, date_time, date_time_range, single_date]
51
- datetime: [nil, date_time, date_time_range, single_date]
52
- date: [nil, date, date_range]
53
- character: [nil, text, text_delimited]
54
- varchar: [nil, text, text_delimited]
55
- text: [nil, text, text_delimited]
56
- text[]: [nil, text, text_delimited]
57
- bytea: [nil, text, text_delimited]
58
- boolean: [nil, boolean]
59
- tinyint: [nil, boolean]
60
-
61
- operators: # operators precedence
62
- is: 100
63
- is_not: 200
64
- is_on: 300
65
- is_in: 400
66
- is_provided: 500
67
- is_not_provided: 600
68
- is_after: 700
69
- is_before: 800
70
- is_in_the_range: 900
71
- contains: 1000
72
- does_not_contain: 1100
73
- starts_with: 1200
74
- ends_with: 1300
75
- is_greater_than: 1400
76
- is_less_than: 1500
77
- is_filtered_by: 1600
78
-
79
-
80
- #############################################################################
81
- # Environment Settings
82
- # You can overload any feature defined in the defaults for any environment
83
- #############################################################################
84
- development:
85
- <<: *defaults
86
-
87
- test:
88
- <<: *defaults
89
-
90
- qa:
91
- <<: *defaults
92
-
93
- stage:
94
- <<: *defaults
95
-
96
- production:
97
- <<: *defaults
@@ -1,15 +0,0 @@
1
- class CreateWillFilterFilters < ActiveRecord::Migration
2
- def change
3
- create_table :will_filter_filters do |t|
4
- t.string :type
5
- t.string :name
6
- t.text :data
7
- t.integer :user_id
8
- t.string :model_class_name
9
-
10
- t.timestamps
11
- end
12
-
13
- add_index :will_filter_filters, [:user_id]
14
- end
15
- end