corn_starch 1.3.37 → 1.3.38

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 009b25c357089151d03a6a6e407ec5a7a3d745ba
4
- data.tar.gz: 09df18f1e4b5c4070df548c67304089619001c44
3
+ metadata.gz: 3bb69ecc231b1f74856594915e730842ac078511
4
+ data.tar.gz: a31ca908402580a34e410115169d75c8f0a7cd21
5
5
  SHA512:
6
- metadata.gz: 785e968e2ef2177c195bae9fefc67586dde454a83f1cab950b54ba4e4a3bae2b716f0464698246c6bd84ae941b577665cc8c846ab9ce75524aa35940f627fe50
7
- data.tar.gz: 57f6d4ffe37bb576b9ace8a29d0453be0c975143109dcfdf01a4968e77bc17cc2a357b28ed1844f80cf29ea3ee8e6725fb0c51ad807f17e950e5da5113de3906
6
+ metadata.gz: d0a476f5610561f88b6a08e2d11980f1eb4129808d8e358aeab81c9419efed9ebb9cc7c042949e1e3f477eba56fc5d9d260bbfc32ffee335169524727b1faeb0
7
+ data.tar.gz: 446bc8faa6acd154f1ebdc5311c176e165ee0138e9b089ddd0a565d79ff88ae829ae7709729e4365142fbf6928260b0b12183e05b3c415b6117043cf37a26616
@@ -11,7 +11,7 @@ module CornStarch
11
11
  protect_from_forgery with: :exception
12
12
 
13
13
  # Global Filters
14
- before_filter :pagination_filter, :infiniscroll_filter
14
+ before_filter :pagination_filter, :infiniscroll_filter, :locale_filter
15
15
 
16
16
  # Helper Methods
17
17
  helper_method :user_model, :current_user, :is_authed, :is_self, :paginate, :notice_msg
@@ -82,6 +82,13 @@ module CornStarch
82
82
  @infiniscroll[:params][:records_per_page] = params[:records_per_page] if params[:records_per_page]
83
83
  end
84
84
 
85
+ # Locale Filter
86
+ def locale_filter
87
+
88
+ # Set Locale
89
+ I18n.locale = params[:locale] || I18n.default_locale
90
+ end
91
+
85
92
  ##################
86
93
  # Helper Methods #
87
94
  ##################
@@ -112,6 +119,13 @@ module CornStarch
112
119
  params[:id] == current_user.id.to_s
113
120
  end
114
121
 
122
+ # Default URL Options
123
+ def default_url_options options = {}
124
+
125
+ # Include Locale in all generated URLs
126
+ { locale: I18n.locale }.merge options
127
+ end
128
+
115
129
  # Get Records
116
130
  def get_records model, params
117
131
  paginate unisearch(model, params[:search]), params
@@ -1,3 +1,3 @@
1
1
  module CornStarch
2
- VERSION = '1.3.37'
2
+ VERSION = '1.3.38'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_starch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.37
4
+ version: 1.3.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse