activesorting 0.5.0 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e9b4bfc9837667096c35fc2c9ecfeeae4311f6f
4
- data.tar.gz: 586da28b8094e55dc553aa4b7f9f3a60381840d9
3
+ metadata.gz: 7581f100b1a9767cbf2c3d518b0c2b6610c63ff1
4
+ data.tar.gz: 1a8d949fe9631719b65c4161d402c583c6930f92
5
5
  SHA512:
6
- metadata.gz: 51ae748ca7d9a1e07d01301f62e5621cfb0c79f761a4f1b84afc5c21dd261dd904e1e84e32ff012e980d7512487b8c1aeefda7e24d381f1c149dcf92c651bd2c
7
- data.tar.gz: 9a4f4fc0b353a8a02dccd706085e80e19eaedbc4622c745a6cb5a3867eff09c452438a9f2793c510f3a3ab1915ba8b4ba246acd5cf4a66efbefff2c80380b8e8
6
+ metadata.gz: b7fb853507a2ff0bfdfeab35dd7394d6ca81cc312350763b92f45938bf85f5d6fe4c517137516ccea34b493426be09b79b7a61c941301af96dfaaee5937c074b
7
+ data.tar.gz: 23aeea21e2c9fcf789d1a6814f0568ec9ef2ceb1965ef3bbc05c9d99adf7f8b1e1ec8b1f94db58f070f3a18589ce442889085d9bbe083053f0b247f5387fde7b
data/.coveralls.yml CHANGED
@@ -1 +1 @@
1
- repo_token: 96YmI1wd21NrTNm0zfHVZhn02XPI66ZRi
1
+ repo_token: lXd99dk7JUU0xk4RI63RJLYzYPqjZONgE
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  Allows sorting Rails models using a custom field.
9
9
 
10
- [Code Documentation](http://www.rubydoc.info/github/owahab/activesorting)
10
+ [Code Documentation](http://www.rubydoc.info/github/owahab/active_sorting)
11
11
 
12
12
  ## Requirements
13
13
 
@@ -2,13 +2,12 @@ module ActiveSorting
2
2
  module Model # :nodoc:
3
3
  def self.included(base)
4
4
  base.extend ClassMethods
5
+ # Track all sortable arguments
6
+ base.class_attribute :active_sorting_options
5
7
  end
6
8
 
7
9
  # Patches ActiveRecord models
8
10
  module ClassMethods
9
- # Track all sortable arguments
10
- attr_accessor :active_sorting_options
11
-
12
11
  # Sets the sortable options
13
12
  #
14
13
  # +name+ sortable field name
@@ -35,8 +34,9 @@ module ActiveSorting
35
34
 
36
35
  # Check provided options
37
36
  def active_sorting_check_options
38
- unless columns_hash[active_sorting_field.to_s].type == :integer
39
- raise ArgumentError, 'Sortable field should be of type Integer'
37
+ field_type = columns_hash[active_sorting_field.to_s].type
38
+ unless field_type == :integer
39
+ raise ArgumentError, "Sortable field should be of type Integer, #{field_type} given"
40
40
  end
41
41
  unless active_sorting_step.is_a?(Fixnum)
42
42
  raise ArgumentError, 'Sortable step should be of type Fixnum'
@@ -1,3 +1,3 @@
1
1
  module ActiveSorting
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesorting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Abdel-Wahab
@@ -181,3 +181,4 @@ signing_key:
181
181
  specification_version: 4
182
182
  summary: Adds ability to sort models using a custom field
183
183
  test_files: []
184
+ has_rdoc: