activerecord-collation 0.0.1 → 0.0.2

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: b08951bb81767158f2bb2182f468a658c763879c00f03a3173f7ed7fdb82dac4
4
- data.tar.gz: 63d6d457800220ab6962bf1d201febdcdfa1f4d71128fb4ed7db2a3c28109a48
3
+ metadata.gz: a515beeae2f125a1faffb9d4826ecb4566a9482b756a7d65996b6a07981d217f
4
+ data.tar.gz: 2ed5a94b19f28dfbfc319668218afa21f26e1b348af3e197d0910830647395d3
5
5
  SHA512:
6
- metadata.gz: f0c2107d45f7d6f5878494e91716e96f4853c6403c8c423eec5b0c61f1156567609417179ec4b2a39b6ef577a18466c0f9d6414b06b893eb4086e2159493e776
7
- data.tar.gz: 85bdcf26363009c077c105eac437ee6cd0d5f8710a5f927f66c3b9e247c919278017c40dd02dd31e0d7ff246e701593ead7b93f3bcff90031c9c415447917a73
6
+ metadata.gz: bf9dd9072a26592c5574be4bcf38b4400900ca82235520a6832de7f7792e72a506e46c9385db5bf6985802527a2cc12251b702659d09ec22b73f14fa7d275e93
7
+ data.tar.gz: ae3cd929eff72e689b55bead8eb7c4f8531781a1e1e9376f577651d193eee82bff3dd4b71a85a074ada9e60db3bd6196a40b6f840070873aba9215b9bdb2513f
data/README.md CHANGED
@@ -18,17 +18,17 @@ See [Postgres collation documentation](https://www.postgresql.org/docs/current/c
18
18
 
19
19
  ## Setup
20
20
 
21
- Add `activerecord-collations` to your dependencies. If you also want the `collate` class method on your model you also include the collation module:
21
+ Add `activerecord-collations` to your dependencies. Include the collation concern into your models to get access to the `collate` class method.
22
22
 
23
23
  ```ruby
24
24
  class ApplicationRecord < ActiveRecord::Base
25
- self.abstract_class = true
25
+ primary_abstract_class
26
26
 
27
27
  include ActiveRecord::Collation
28
28
  end
29
29
  ```
30
30
 
31
- The collate method creates an ARel expression for the column with a certain collation.
31
+ The `collate` method creates an ARel expression for the column with a certain collation.
32
32
 
33
33
  ```ruby
34
34
  scope :ordered, -> { order(collate(:title, "natural_#{I18n.locale}") }
@@ -45,11 +45,13 @@ Arel::Nodes::InfixOperation.new(
45
45
  )
46
46
  ```
47
47
 
48
- ## Testing
48
+ ## Development
49
49
 
50
- The Dummy application uses the gem so you can load the schema and run migrations there:
50
+ Run tests in this repository with `rake`. Migrations are exercised by running them in the dummy application.
51
51
 
52
52
  ```
53
53
  cd test/dummy
54
- RAILS_ENV=test rake db:migrate
54
+ rm -f db/schema.rb && RAILS_ENV=test bundle exec rake db:drop db:create db:migrate
55
+ cd ../../
56
+ bundle exec rake
55
57
  ```
@@ -10,15 +10,15 @@ module ActiveRecord
10
10
  collations = @connection.collations
11
11
  return unless collations.any?
12
12
 
13
- stream.puts
14
13
  collations.each do |row|
15
14
  stream.puts(
16
15
  " create_collation(#{row['collname'].inspect}, #{row['colllocale'].inspect})"
17
16
  )
18
17
  end
18
+ stream.puts
19
19
  end
20
20
 
21
- def trailer(stream)
21
+ def tables(stream)
22
22
  collations(stream)
23
23
  super
24
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module Collation
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-collation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manfred Stienstra
@@ -24,7 +24,7 @@ dependencies:
24
24
  - !ruby/object:Gem::Version
25
25
  version: '0'
26
26
  description: " Adds methods like create_collation to manage collations in your Ruby
27
- on Rials project.\n"
27
+ on Rails project.\n"
28
28
  email:
29
29
  - manfred@fngtps.com
30
30
  executables: []
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubygems_version: 3.7.0
61
+ rubygems_version: 4.0.10
62
62
  specification_version: 4
63
63
  summary: Collation support for Active Record.
64
64
  test_files: []