agilibox 1.5.10 → 1.5.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c12899fd207f2f1598ba96d7236d4dceabd6dcfba0f250b24c3117121e73e51
4
- data.tar.gz: bb76c0c9eb2fb6d88567349780c828c1bba27630269288457d47e6e3d54a195b
3
+ metadata.gz: 35b58f952138f0913e8c9d626c66ad37f7b0a7a39bc1ac102b69481e10988d22
4
+ data.tar.gz: 146206be03aee69642c108527794cb20959f7c2c4c3dc00a7498e1ddfe7841e1
5
5
  SHA512:
6
- metadata.gz: ec464cd8675ceaa72f6072933620158bdf1716e3686ef2cf0a866109e6b5950ba1fd8cd9b94d9329be2c593898256c8e4f9f64a0c55cb4d8c39090a9dd18b339
7
- data.tar.gz: 2e5f10e3f3e40599d48c0762312cebd5303f19f705dcc6a8a7ba600715dcfc294c92e4d1efdd45581474b15bcee235c57709340479ce561aa88d1db60573caad
6
+ metadata.gz: d9b82e5b810fc3d1fa5ca1262f0a77c4dfbc6308b0b0522856a5687ce830aa8c8ee6b3448727e3729402225c614b63fe4d949bf18d90dd0c19c5973e3eaf1edf
7
+ data.tar.gz: 0a763586b8f70114e205f9e8e62361eb3692659b264492963b8cd0aa5b446c22637be87fc7972d684fd85daee67d3488f61055842187083a077b280df76a382c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 1.5.11
6
+ - Add `nbsp` helper
7
+ - Add `PluckDistinct` model concern
8
+ - Add pagination helpers
9
+
5
10
  ## 1.5.10
6
11
  - Cucumber Helpers : add cuprite support
7
12
 
@@ -3,4 +3,12 @@ module Agilibox::PaginationHelper
3
3
  options = {theme: "twitter-bootstrap-3"}.merge(options)
4
4
  super(objects, options).gsub(/>(\s+)</, "><").html_safe
5
5
  end
6
+
7
+ def pagination_infos(collection)
8
+ content_tag(:p, class: "pagination-infos") { page_entries_info(collection) }
9
+ end
10
+
11
+ def pagination_and_infos(collection)
12
+ paginate(collection) + pagination_infos(collection)
13
+ end
6
14
  end
@@ -3,6 +3,14 @@ module Agilibox::TextHelper
3
3
  include ::ActionView::Helpers::SanitizeHelper
4
4
  include ::ActionView::Helpers::TextHelper
5
5
 
6
+ def nbsp(text = :no_argument)
7
+ if text == :no_argument
8
+ " "
9
+ else
10
+ text.to_s.gsub(" ", nbsp)
11
+ end
12
+ end
13
+
6
14
  def euros(n)
7
15
  currency(n, "€")
8
16
  end
@@ -0,0 +1,13 @@
1
+ module Agilibox::PluckDistinct
2
+ extend ActiveSupport::Concern
3
+
4
+ class_methods do
5
+ def pluck_distinct(column)
6
+ all
7
+ .reorder(column)
8
+ .select(column)
9
+ .distinct
10
+ .pluck(column)
11
+ end
12
+ end # class_methods
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.5.10"
2
+ VERSION = "1.5.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agilibox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.10
4
+ version: 1.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-17 00:00:00.000000000 Z
11
+ date: 2019-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-i18n
@@ -129,6 +129,7 @@ files:
129
129
  - app/models/concerns/agilibox/default_values_concern.rb
130
130
  - app/models/concerns/agilibox/model_i18n.rb
131
131
  - app/models/concerns/agilibox/model_to_s.rb
132
+ - app/models/concerns/agilibox/pluck_distinct.rb
132
133
  - app/models/concerns/agilibox/pluck_to_hash.rb
133
134
  - app/models/concerns/agilibox/polymorphic_id.rb
134
135
  - app/models/concerns/agilibox/search.rb