arbor 0.0.7 → 0.0.8

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: 64122a62f0b9e516158b03e8b5d266f657476f10
4
- data.tar.gz: 268303a8e512a6c3c44b7a376fea5d0a34461ec9
3
+ metadata.gz: aeea62a8f7bd6868e3c0d731659a80185c0a66e4
4
+ data.tar.gz: 2cd01ee3dd0676b78a7abf5161b8d1722f9c1ac1
5
5
  SHA512:
6
- metadata.gz: 7d4bdd3df1812a5d9eef4c1d42a681f903bc40a810a008a1599872a7fb75b1c0d349ce9f59a798f6eb88aa621586f502688dad9bb8f95be2b6b9090796357d7b
7
- data.tar.gz: 645f9481964bab457316396b6371db56efae7e8a997eab376121ead4d9cced1ef6846649eb0b2cdb76bb83d28bbcf82ad9bb15a86fffbb904164fcd5af03bc5c
6
+ metadata.gz: 0fc5f1f0d7f3ac7333d6e397a48fdbb097c49f182b3dd6703b62e35d931b7941419e7e078881183c924cb76b2aa1943e164ae9d74b2e5df44b9ed31bd1ee8aaf
7
+ data.tar.gz: 34f786ce5c5ddd3760fb7e318aa2caa28bf0fc86026454331bd3dd229f4c05d9d3476f98bb45466e7a045168eafd791d3b04cb6fba285aa9e1b7f3cda4dd36eb
data/lib/arbor.rb CHANGED
@@ -78,7 +78,7 @@ module Arbor
78
78
  :next_of_kin_relationships, :notes, :notices, :operations, :pastoral_notes,
79
79
  :pay_scales, :pay_scale_grades, :pay_scale_grade_spinal_points,
80
80
  :pay_scale_spinal_points, :pay_scale_spinal_point_values,
81
- :permanent_exclusions, :people, :person_checks, :person_former_names,
81
+ :permanent_exclusions, :persons, :person_checks, :person_former_names,
82
82
  :person_identification_documents, :person_impairments,
83
83
  :person_nationalities, :person_next_of_kins,
84
84
  :person_professional_qualifications, :person_training_courses,
data/lib/arbor/filter.rb CHANGED
@@ -4,7 +4,7 @@ module Arbor
4
4
  class Filter
5
5
  include Arbor::Utils
6
6
  attr_accessor :attribute, :operator, :value
7
- OPERATORS = [:equals, :from, :to, :after, :before, :search, :in]
7
+ OPERATORS = [:equals, :from, :to, :after, :before, :search, :in, :tagged]
8
8
 
9
9
  def initialize(attribute, operator, value)
10
10
  @attribute = attribute
data/lib/arbor/utils.rb CHANGED
@@ -2,6 +2,8 @@ require 'active_support/core_ext/string'
2
2
 
3
3
  module Arbor
4
4
  module Utils
5
+ INFLECTIONS = { 'person' => 'persons' }
6
+
5
7
  def parse_resource_name(type)
6
8
  validate(get_resource_name(type), Arbor::RESOURCES)
7
9
  end
@@ -10,9 +12,9 @@ module Arbor
10
12
  case type
11
13
  when Class
12
14
  # do reverse serialiser lookup instead
13
- type.name.pluralize.underscore
15
+ pluralize(type.name).underscore
14
16
  else
15
- type.to_s.pluralize
17
+ pluralize(type.to_s)
16
18
  end
17
19
  end
18
20
 
@@ -39,5 +41,10 @@ module Arbor
39
41
  end
40
42
  raise exception
41
43
  end
44
+
45
+ private
46
+ def pluralize(string)
47
+ INFLECTIONS[string] || string.pluralize
48
+ end
42
49
  end
43
50
  end
data/lib/arbor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Arbor
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Campbell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-12 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport