comable-backend 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +97 -0
  4. data/app/assets/javascripts/comable/admin/application.coffee +76 -0
  5. data/app/assets/javascripts/comable/admin/categories.coffee +59 -0
  6. data/app/assets/javascripts/comable/admin/dashboard.coffee +32 -0
  7. data/app/assets/javascripts/comable/admin/dispatcher.coffee +21 -0
  8. data/app/assets/javascripts/comable/admin/orders.coffee +44 -0
  9. data/app/assets/javascripts/comable/admin/pages.coffee +69 -0
  10. data/app/assets/javascripts/comable/admin/products.coffee +21 -0
  11. data/app/assets/javascripts/comable/admin/search.coffee +35 -0
  12. data/app/assets/javascripts/comable/admin/themes.coffee +64 -0
  13. data/app/assets/stylesheets/comable/admin/_common.scss +153 -0
  14. data/app/assets/stylesheets/comable/admin/_dashboard.scss +81 -0
  15. data/app/assets/stylesheets/comable/admin/_errors.scss +18 -0
  16. data/app/assets/stylesheets/comable/admin/_flow.scss +149 -0
  17. data/app/assets/stylesheets/comable/admin/_mixins.scss +16 -0
  18. data/app/assets/stylesheets/comable/admin/_orders.scss +54 -0
  19. data/app/assets/stylesheets/comable/admin/_overrides.scss +4 -0
  20. data/app/assets/stylesheets/comable/admin/_pages.scss +30 -0
  21. data/app/assets/stylesheets/comable/admin/_products.scss +18 -0
  22. data/app/assets/stylesheets/comable/admin/_themes.scss +71 -0
  23. data/app/assets/stylesheets/comable/admin/_user_sessions.scss +57 -0
  24. data/app/assets/stylesheets/comable/admin/_variables.scss +38 -0
  25. data/app/assets/stylesheets/comable/admin/application.scss +26 -0
  26. data/app/assets/stylesheets/comable/admin/overrides/awesome_admin_layout.scss +25 -0
  27. data/app/assets/stylesheets/comable/admin/overrides/bootstrap.scss +81 -0
  28. data/app/assets/stylesheets/comable/admin/overrides/jstree.scss +71 -0
  29. data/app/assets/stylesheets/comable/admin/overrides/tagit.scss +22 -0
  30. data/app/controllers/comable/admin/application_controller.rb +58 -0
  31. data/app/controllers/comable/admin/categories_controller.rb +17 -0
  32. data/app/controllers/comable/admin/dashboard_controller.rb +19 -0
  33. data/app/controllers/comable/admin/orders_controller.rb +102 -0
  34. data/app/controllers/comable/admin/pages_controller.rb +72 -0
  35. data/app/controllers/comable/admin/payment_methods_controller.rb +59 -0
  36. data/app/controllers/comable/admin/products_controller.rb +82 -0
  37. data/app/controllers/comable/admin/shipment_methods_controller.rb +57 -0
  38. data/app/controllers/comable/admin/stocks_controller.rb +81 -0
  39. data/app/controllers/comable/admin/store_controller.rb +42 -0
  40. data/app/controllers/comable/admin/themes_controller.rb +101 -0
  41. data/app/controllers/comable/admin/trackers_controller.rb +58 -0
  42. data/app/controllers/comable/admin/user_sessions_controller.rb +8 -0
  43. data/app/controllers/comable/admin/users_controller.rb +47 -0
  44. data/app/helpers/comable/admin/application_helper.rb +53 -0
  45. data/app/helpers/comable/admin/orders_helper.rb +30 -0
  46. data/app/helpers/comable/admin/pages_helper.rb +6 -0
  47. data/app/helpers/comable/admin/products_helper.rb +6 -0
  48. data/app/helpers/comable/admin/shipment_methods_helper.rb +6 -0
  49. data/app/helpers/comable/admin/stores_helper.rb +6 -0
  50. data/app/helpers/comable/admin/themes_helper.rb +69 -0
  51. data/app/views/comable/admin/categories/index.slim +40 -0
  52. data/app/views/comable/admin/dashboard/_widget.slim +13 -0
  53. data/app/views/comable/admin/dashboard/show.slim +43 -0
  54. data/app/views/comable/admin/orders/_google_map.slim +39 -0
  55. data/app/views/comable/admin/orders/_payment_state.slim +40 -0
  56. data/app/views/comable/admin/orders/_shipment_state.slim +44 -0
  57. data/app/views/comable/admin/orders/edit.slim +170 -0
  58. data/app/views/comable/admin/orders/index.slim +95 -0
  59. data/app/views/comable/admin/orders/show.slim +177 -0
  60. data/app/views/comable/admin/pages/_form.slim +69 -0
  61. data/app/views/comable/admin/pages/edit.slim +31 -0
  62. data/app/views/comable/admin/pages/index.slim +55 -0
  63. data/app/views/comable/admin/pages/new.slim +16 -0
  64. data/app/views/comable/admin/payment_methods/_form.slim +35 -0
  65. data/app/views/comable/admin/payment_methods/edit.slim +27 -0
  66. data/app/views/comable/admin/payment_methods/index.slim +40 -0
  67. data/app/views/comable/admin/payment_methods/new.slim +16 -0
  68. data/app/views/comable/admin/products/_form.slim +137 -0
  69. data/app/views/comable/admin/products/edit.slim +41 -0
  70. data/app/views/comable/admin/products/index.slim +95 -0
  71. data/app/views/comable/admin/products/new.slim +16 -0
  72. data/app/views/comable/admin/shared/_advanced_search.slim +7 -0
  73. data/app/views/comable/admin/shared/_condition_fields.slim +15 -0
  74. data/app/views/comable/admin/shared/_footer.slim +8 -0
  75. data/app/views/comable/admin/shared/_grouping_fields.slim +8 -0
  76. data/app/views/comable/admin/shared/_image_fields.slim +15 -0
  77. data/app/views/comable/admin/shared/_notifier.slim +5 -0
  78. data/app/views/comable/admin/shared/_value_fields.slim +1 -0
  79. data/app/views/comable/admin/shared/export.xlsx.axlsx +17 -0
  80. data/app/views/comable/admin/shipment_methods/_form.slim +29 -0
  81. data/app/views/comable/admin/shipment_methods/edit.slim +27 -0
  82. data/app/views/comable/admin/shipment_methods/index.slim +37 -0
  83. data/app/views/comable/admin/shipment_methods/new.slim +16 -0
  84. data/app/views/comable/admin/stocks/_form.slim +34 -0
  85. data/app/views/comable/admin/stocks/edit.slim +37 -0
  86. data/app/views/comable/admin/stocks/index.slim +81 -0
  87. data/app/views/comable/admin/stocks/new.slim +18 -0
  88. data/app/views/comable/admin/store/_form.slim +32 -0
  89. data/app/views/comable/admin/store/edit.slim +12 -0
  90. data/app/views/comable/admin/themes/_editor.slim +8 -0
  91. data/app/views/comable/admin/themes/_form.slim +31 -0
  92. data/app/views/comable/admin/themes/edit.slim +35 -0
  93. data/app/views/comable/admin/themes/index.slim +37 -0
  94. data/app/views/comable/admin/themes/new.slim +16 -0
  95. data/app/views/comable/admin/themes/show_file.slim +93 -0
  96. data/app/views/comable/admin/trackers/_form.slim +109 -0
  97. data/app/views/comable/admin/trackers/edit.slim +27 -0
  98. data/app/views/comable/admin/trackers/index.slim +37 -0
  99. data/app/views/comable/admin/trackers/new.slim +16 -0
  100. data/app/views/comable/admin/user_sessions/new.slim +25 -0
  101. data/app/views/comable/admin/users/edit.slim +79 -0
  102. data/app/views/comable/admin/users/index.slim +71 -0
  103. data/app/views/comable/admin/users/show.slim +88 -0
  104. data/app/views/kaminari/comable_backend/_first_page.html.slim +2 -0
  105. data/app/views/kaminari/comable_backend/_gap.html.slim +2 -0
  106. data/app/views/kaminari/comable_backend/_last_page.html.slim +2 -0
  107. data/app/views/kaminari/comable_backend/_next_page.html.slim +2 -0
  108. data/app/views/kaminari/comable_backend/_page.html.slim +3 -0
  109. data/app/views/kaminari/comable_backend/_paginator.html.slim +15 -0
  110. data/app/views/kaminari/comable_backend/_prev_page.html.slim +2 -0
  111. data/app/views/layouts/comable/admin/application.slim +36 -0
  112. data/config/initializers/awesome_admin_layout.rb +110 -0
  113. data/config/routes.rb +63 -0
  114. data/lib/comable/backend.rb +1 -0
  115. data/lib/comable/backend/engine.rb +67 -0
  116. data/lib/tasks/comable_backend_tasks.rake +4 -0
  117. metadata +514 -0
@@ -0,0 +1,71 @@
1
+ .comable-page
2
+ .comable-page-heading
3
+ ul.pull-right.list-inline
4
+ li
5
+ .btn-group role="group"
6
+ = link_to_previous_page @users, '<', class: 'btn btn-default' do
7
+ .btn.btn-default disabled="disabled"
8
+ | <
9
+ = link_to_next_page @users, '>', class: 'btn btn-default' do
10
+ .btn.btn-default disabled="disabled"
11
+ | >
12
+
13
+ h1.page-header
14
+ = Comable.t('admin.nav.user')
15
+ small<
16
+ | #{@users.total_count} #{Comable.t('admin.results')}
17
+
18
+ .comable-page-body
19
+ .comable-search
20
+ = search_form_for @q, url: comable.admin_users_path do |f|
21
+ .input-group
22
+ span.input-group-btn
23
+ button.btn.btn-default.dropdown-toggle type="button" data-toggle="dropdown"
24
+ i.fa.fa-search
25
+ span.caret<
26
+ ul.dropdown-menu role="menu"
27
+ li
28
+ = link_to Comable.t('admin.advanced_search'), 'javascript:void(0)', 'data-toggle' => 'collapse', 'data-target' => '#comable-advanced-search'
29
+ li
30
+ = link_to Comable.t('admin.clear_search_conditions'), comable.admin_users_path
31
+ = f.text_field :email_cont, class: 'form-control'
32
+ span.input-group-btn
33
+ = f.submit Comable.t('admin.search'), class: 'btn btn-default'
34
+
35
+ = render 'comable/admin/shared/advanced_search', f: f
36
+
37
+ section
38
+ - if @users.empty?
39
+ = Comable.t('admin.not_found')
40
+ - else
41
+ table.table.table-striped
42
+ thead
43
+ th
44
+ = sort_link [:comable, @q], :id
45
+ th
46
+ = sort_link [:comable, @q], :email
47
+ th
48
+ = @users.klass.human_attribute_name(:bill_full_name)
49
+ th
50
+ = @users.klass.human_attribute_name(:bill_address)
51
+ th
52
+ = @users.klass.human_attribute_name(:orders)
53
+ tbody
54
+ - @users.each do |user|
55
+ tr
56
+ td
57
+ = link_to user.human_id, comable.admin_user_path(user)
58
+ td
59
+ = user.email
60
+ td
61
+ = user.bill_full_name
62
+ td
63
+ - if user.bill_address
64
+ span> = user.bill_address.state_name
65
+ span> = user.bill_address.city
66
+ span> = user.bill_address.detail
67
+ td
68
+ | #{user.orders.count} #{Comable.t('admin.times')}
69
+
70
+ .text-center
71
+ = paginate @users, theme: :comable_backend
@@ -0,0 +1,88 @@
1
+ .comable-page
2
+ .comable-page-heading
3
+ ul.pull-right.list-inline
4
+ li.btn-group
5
+ = link_to comable.edit_admin_user_path(@user), class: 'btn btn-default' do
6
+ span.fa.fa-edit>
7
+ = Comable.t('admin.actions.edit')
8
+ = link_to Comable.t('admin.nav.order'), comable.admin_orders_path(q: { user_id_eq: @user.id }), class: 'btn btn-default'
9
+ li
10
+ / TODO: Comment out after implemented.
11
+ / = link_to Comable.t('admin.nav.orders.cart'), '#', class: 'btn btn-default'
12
+
13
+ h1.page-header
14
+ ol.breadcrumb
15
+ li>
16
+ = link_to Comable.t('admin.nav.user'), comable.admin_users_path
17
+ li.active
18
+ = @user.human_id
19
+ - if @user.bill_full_name
20
+ small<
21
+ = Comable.t('honorific', name: @user.bill_full_name)
22
+
23
+ .comable-page-body
24
+ section
25
+ dl.dl-horizontal
26
+ dt
27
+ = @user.class.human_attribute_name(:role)
28
+ dd
29
+ = @user.role.text
30
+ dt
31
+ = @user.class.human_attribute_name(:email)
32
+ dd
33
+ = @user.email
34
+ - if @user.bill_address
35
+ dt
36
+ = @user.class.human_attribute_name(:bill_address)
37
+ dd
38
+ ul.list-unstyled
39
+ li = @user.bill_address.zip_code
40
+ li = @user.bill_address.full_name
41
+ li = @user.bill_address.state_name
42
+ li = @user.bill_address.city
43
+ li = @user.bill_address.detail
44
+ li = "#{@user.bill_address.class.human_attribute_name(:phone_number)}: #{@user.bill_address.phone_number}"
45
+
46
+ - if @user.orders.any?
47
+ section
48
+ .panel.panel-default
49
+ .panel-heading
50
+ .panel-title
51
+ = Comable.t('admin.nav.users.new_orders', count: 5)
52
+
53
+ table.table
54
+ thead
55
+ tr
56
+ th
57
+ = @user.orders.klass.human_attribute_name(:code)
58
+ th
59
+ = @user.orders.klass.human_attribute_name(:state)
60
+ th
61
+ = @user.orders.klass.human_attribute_name(:bill_full_name)
62
+ th
63
+ = @user.orders.klass.human_attribute_name(:order_items)
64
+ th
65
+ = @user.orders.klass.human_attribute_name(:total_price)
66
+ th
67
+ = @user.orders.klass.human_attribute_name(:completed_at)
68
+ tbody
69
+ - @user.orders.limit(5).each do |order|
70
+ tr
71
+ td
72
+ = link_to order.code, comable.admin_order_path(order)
73
+ td
74
+ = order.human_state_name
75
+ td
76
+ = order.bill_full_name
77
+ td
78
+ ul.list-unstyled
79
+ - order.order_items.each do |order_item|
80
+ li
81
+ | #{order_item.name_with_sku} x #{order_item.quantity}
82
+ td
83
+ = number_to_currency order.total_price
84
+ td
85
+ = l order.completed_at
86
+
87
+ .panel-footer.text-right
88
+ = link_to Comable.t('admin.more'), comable.admin_orders_path(search_user_id: @user.id), class: 'btn btn-default'
@@ -0,0 +1,2 @@
1
+ li
2
+ = link_to raw(t 'views.pagination.first'), url, rel: 'first', remote: remote
@@ -0,0 +1,2 @@
1
+ li.disabled
2
+ = link_to raw(t 'views.pagination.truncate'), '#'
@@ -0,0 +1,2 @@
1
+ li
2
+ = link_to raw(t 'views.pagination.last'), url, rel: 'last', remote: remote
@@ -0,0 +1,2 @@
1
+ li
2
+ = link_to raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
@@ -0,0 +1,3 @@
1
+ li class="#{'active' if page.current?}"
2
+ = link_to page, page.current? ? '#' : url,
3
+ remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil
@@ -0,0 +1,15 @@
1
+ = paginator.render do
2
+ ul.pagination
3
+ - unless current_page.first?
4
+ == first_page_tag
5
+ == prev_page_tag
6
+
7
+ - each_page do |page|
8
+ - if page.left_outer? || page.right_outer? || page.inside_window?
9
+ == page_tag page
10
+ - elsif !page.was_truncated?
11
+ == gap_tag
12
+
13
+ - unless current_page.last?
14
+ == next_page_tag
15
+ == last_page_tag
@@ -0,0 +1,2 @@
1
+ li
2
+ = link_to raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
@@ -0,0 +1,36 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"
5
+ title
6
+ = Comable.app_name
7
+ = stylesheet_link_tag 'comable/admin/application', media: 'all', 'data-turbolinks-track' => true
8
+ = javascript_include_tag 'comable/admin/application', 'data-turbolinks-track' => true
9
+
10
+ = yield :head
11
+
12
+ / TODO: Use downloaded files
13
+ = stylesheet_link_tag 'http://rawgit.com/vakata/jstree/3.0.9/dist/themes/default/style.min.css', media: 'all', 'data-turbolinks-track' => true
14
+ = javascript_include_tag 'http://rawgit.com/vakata/jstree/3.0.9/dist/jstree.min.js', 'data-turbolinks-track' => true
15
+
16
+ / TODO: Use downloaded files
17
+ = stylesheet_link_tag 'http://rawgithub.com/aehlke/tag-it/master/css/jquery.tagit.css', media: 'all', 'data-turbolinks-track' => true
18
+ = stylesheet_link_tag 'http://rawgithub.com/aehlke/tag-it/master/css/tagit.ui-zendesk.css', media: 'all', 'data-turbolinks-track' => true
19
+ = javascript_include_tag 'http://rawgithub.com/aehlke/tag-it/master/js/tag-it.min.js', 'data-turbolinks-track' => true
20
+
21
+ = csrf_meta_tags
22
+
23
+ body id="#{"comable-#{controller_name.singularize}"}" data-page="#{page_name}"
24
+ = render 'comable/admin/shared/notifier'
25
+
26
+ - if current_comable_user.signed_in?
27
+ == render_admin_layout do
28
+ #wrapper
29
+ main.container-fluid
30
+ = yield
31
+
32
+ = render 'comable/admin/shared/footer'
33
+ - else
34
+ main
35
+ = yield
36
+ = render 'comable/admin/shared/footer'
@@ -0,0 +1,110 @@
1
+ AwesomeAdminLayout.setup(only: Comable::Admin::ApplicationController) do |controller|
2
+ comable = controller.comable
3
+ current_comable_user = controller.current_comable_user
4
+
5
+ navigation do
6
+ brand Comable.app_name do
7
+ external_link comable.root_path
8
+ end
9
+
10
+ item Comable.t('admin.nav.dashboard') do
11
+ link comable.admin_root_path
12
+ icon 'dashboard'
13
+ end
14
+
15
+ item Comable.t('admin.nav.order') do
16
+ link comable.admin_orders_path
17
+ icon 'shopping-cart'
18
+ end
19
+
20
+ item Comable.t('admin.nav.product') do
21
+ nest :products
22
+ icon 'cube'
23
+ end
24
+
25
+ item Comable.t('admin.nav.user') do
26
+ link comable.admin_users_path
27
+ icon 'user'
28
+ active controller.controller_name == 'users' && controller.action_name != 'profile'
29
+ end
30
+
31
+ divider
32
+
33
+ item Comable.t('admin.nav.store') do
34
+ nest :store
35
+ icon 'home'
36
+ end
37
+
38
+ flex_divider
39
+
40
+ item current_comable_user.email do
41
+ nest :profile
42
+ icon 'gift'
43
+ end
44
+ end
45
+
46
+ navigation :products do
47
+ brand Comable.t('admin.nav.product')
48
+
49
+ item Comable.t('admin.nav.products.list') do
50
+ link comable.admin_products_path(hoge: 112)
51
+ end
52
+
53
+ item Comable.t('admin.nav.stock') do
54
+ link comable.admin_stocks_path
55
+ end
56
+
57
+ item Comable.t('admin.nav.category') do
58
+ link comable.admin_categories_path
59
+ end
60
+ end
61
+
62
+ navigation :store do
63
+ brand Comable.t('admin.nav.store') do
64
+ external_link comable.root_path
65
+ end
66
+
67
+ item Comable.t('admin.nav.theme') do
68
+ link comable.admin_themes_path
69
+ end
70
+
71
+ item Comable.t('admin.nav.page') do
72
+ link comable.admin_pages_path
73
+ end
74
+
75
+ divider
76
+
77
+ item Comable.t('admin.nav.shipment_method') do
78
+ link comable.admin_shipment_methods_path
79
+ end
80
+
81
+ item Comable.t('admin.nav.payment_method') do
82
+ link comable.admin_payment_methods_path
83
+ end
84
+
85
+ item Comable.t('admin.nav.tracker') do
86
+ link comable.admin_trackers_path
87
+ end
88
+
89
+ divider
90
+
91
+ item Comable.t('admin.nav.store') do
92
+ link comable.admin_store_path
93
+ end
94
+ end
95
+
96
+ navigation :profile do
97
+ brand current_comable_user.email
98
+
99
+ item Comable.t('admin.edit_profile') do
100
+ link comable.admin_profile_path
101
+ active controller.controller_name == 'users' && controller.action_name == 'profile'
102
+ end
103
+
104
+ divider
105
+
106
+ item Comable.t('admin.sign_out') do
107
+ link comable.destroy_user_session_path, method: :delete
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,63 @@
1
+ Comable::Core::Engine.routes.draw do
2
+ namespace :admin do
3
+ root to: 'dashboard#show'
4
+
5
+ resource :dashboard, only: :show
6
+
7
+ resources :products do
8
+ resources :stocks
9
+
10
+ collection do
11
+ get :export
12
+ post :import
13
+ end
14
+ end
15
+
16
+ resources :stocks do
17
+ collection do
18
+ get :export
19
+ post :import
20
+ end
21
+ end
22
+
23
+ resources :orders do
24
+ collection do
25
+ get :export
26
+ end
27
+
28
+ member do
29
+ post :cancel
30
+ post :resume
31
+ post :cancel_payment
32
+ post :resume_payment
33
+ post :ship
34
+ post :cancel_shipment
35
+ post :resume_shipment
36
+ end
37
+ end
38
+
39
+ resources :categories
40
+ resources :pages
41
+ resources :users
42
+ resources :shipment_methods
43
+ resources :payment_methods
44
+ resources :trackers
45
+
46
+ resources :themes do
47
+ member do
48
+ get 'tree', action: :tree, as: :tree
49
+ get 'file/*path', action: :show_file, constraints: { path: /.+/, format: false }, as: :file
50
+ put 'file/*path', action: :update_file, constraints: { path: /.+/, format: false }
51
+ put :use
52
+ end
53
+ end
54
+
55
+ resource :store, controller: :store, only: [:show, :edit, :update]
56
+
57
+ devise_for :user, path: :user, class_name: Comable::User.name, module: :devise, controllers: {
58
+ sessions: 'comable/admin/user_sessions'
59
+ }
60
+
61
+ get :profile, controller: :users
62
+ end
63
+ end
@@ -0,0 +1 @@
1
+ require 'comable/backend/engine'
@@ -0,0 +1,67 @@
1
+ require 'comable/core'
2
+
3
+ require 'slim'
4
+ require 'sass-rails'
5
+ require 'coffee-rails'
6
+ require 'compass-rails'
7
+ require 'bootstrap-sass'
8
+ require 'font-awesome-rails'
9
+ require 'kaminari'
10
+ require 'dynamic_form'
11
+ require 'ransack'
12
+
13
+ require 'jquery-rails'
14
+ require 'jquery-ui-rails'
15
+ require 'raphael-rails'
16
+ require 'morrisjs-rails'
17
+ require 'nprogress-rails'
18
+ require 'gritter'
19
+ require 'turbolinks'
20
+ require 'jquery-turbolinks'
21
+ require 'awesome_admin_layout'
22
+ require 'ace-rails-ap'
23
+
24
+ require 'bootstrap3-datetimepicker-rails'
25
+ require 'momentjs-rails'
26
+
27
+ module Comable
28
+ module Backend
29
+ class Engine < ::Rails::Engine
30
+ # XXX: a code below to delegate comable:install:migrations to comable-core
31
+ config.paths['db/migrate'] = []
32
+
33
+ config.generators do |g|
34
+ g.template_engine :slim
35
+ g.stylesheet_engine :sass
36
+ g.javascript_engine :coffee
37
+ g.test_framework :rspec, fixture: true
38
+ g.fixture_replacement :factory_girl, dir: 'spec/factories'
39
+ end
40
+
41
+ initializer 'comable.ransack.configure' do
42
+ Ransack.configure do |config|
43
+ config.add_predicate(
44
+ 'eq_any_splitted',
45
+ arel_predicate: 'eq_any',
46
+ formatter: proc { |v| v.split(' ') },
47
+ validator: proc { |v| v.present? },
48
+ compounds: false,
49
+ type: :string
50
+ )
51
+
52
+ config.add_predicate(
53
+ 'cont_any_splitted',
54
+ arel_predicate: 'matches_any',
55
+ formatter: proc { |v| v.split(' ').map { |s| "%#{s}%" } },
56
+ validator: proc { |v| v.present? },
57
+ compounds: false,
58
+ type: :string
59
+ )
60
+ end
61
+ end
62
+
63
+ # Add support Rails 4.1.x, 4.2.x for gritter
64
+ config.assets.precompile += %w( error.png gritter-close.png gritter.png ie-spacer.gif notice.png progress.gif success.png warning.png ) if Rails::VERSION::MAJOR == 4
65
+ end
66
+ end
67
+ end