sequel-rails 0.9.6 → 0.9.7

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: e7e8c4d115890eb4b68cf24fa551a13a0d9dc1f0
4
- data.tar.gz: eebe30d28b9279cdab91af9718dbc7a655b3d3de
3
+ metadata.gz: da3053022759b50cd6a007f51516a58bc8c7f81c
4
+ data.tar.gz: 4b973b667f554d668de301170030b8038fad9ac1
5
5
  SHA512:
6
- metadata.gz: cc726e214a6c3c511ca9475a87125650c755f436053ee9b4496ddc4b13d145c2f44f23184faf2963bb7abe3363596e93a62c26bf2bc679e95d148ff2c2c1fd0c
7
- data.tar.gz: 809c17b658f92fab40398b87d079b109dbd51ab0b499f279876b59740c03d3baa9cd7970716f25946e18e586b65d0d18e89b15cbc8f941aa665cd729c0656f2e
6
+ metadata.gz: 3ff5816b3bfb73dc0e45a4332c978f134bcb51fd0fb58b3897ae6b4399f20691ec49fe202f2fb0cb685b4538605013c6c863cb53347263a85e486b4fb72442e8
7
+ data.tar.gz: c7625430e3807d77cc054da4fe6b27d408d43dc53a7bd9b619d9afe14bbfaff7e0e0a8f76485ca063d277a39f7cd30637061745929f3f098e54a03998d2023b5
data/.rubocop.yml CHANGED
@@ -8,6 +8,7 @@ AllCops:
8
8
  - '**/*.gemspec'
9
9
  Exclude:
10
10
  - 'lib/sequel-rails.rb'
11
+ - 'ci/*'
11
12
 
12
13
  HashSyntax:
13
14
  EnforcedStyle: hash_rockets
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
+ cache: bundler
3
+ sudo: false
2
4
  rvm:
3
5
  - ree
4
6
  - 1.8.7
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.9.7 (2014-12-18)
2
+ ==================
3
+
4
+ * Fix ActiveModel I18n integration (Nico Rieck) [#77](https://github.com/TalentBox/sequel-rails/pull/77)
5
+ * Improve CI speed by using docker and caching on Travis
6
+
1
7
  0.9.6 (2014-11-30)
2
8
  ==================
3
9
 
data/README.md CHANGED
@@ -348,6 +348,7 @@ Improvements has been made by those awesome contributors:
348
348
  * shelling (shelling)
349
349
  * a3gis (a3gis)
350
350
  * Andrey Chernih (andreychernih)
351
+ * Nico Rieck (gix)
351
352
 
352
353
  Credits
353
354
  =======
@@ -70,7 +70,8 @@ module SequelRails
70
70
  end
71
71
 
72
72
  def setup_i18n_support
73
- ::Sequel::Model.send :include, ::SequelRails::I18nSupport
73
+ ::Sequel::Model.send :extend, ::ActiveModel::Translation
74
+ ::Sequel::Model.send :extend, ::SequelRails::I18nSupport
74
75
  end
75
76
 
76
77
  def setup_controller_runtime
@@ -4,5 +4,11 @@ module SequelRails
4
4
  def i18n_scope #:nodoc:
5
5
  :sequel
6
6
  end
7
+
8
+ def lookup_ancestors
9
+ # ActiveModel uses the name of ancestors. Exclude unnamed classes, like
10
+ # those returned by Sequel::Model(...).
11
+ super.reject { |x| x.name.nil? }
12
+ end
7
13
  end
8
14
  end
@@ -1,3 +1,3 @@
1
1
  module SequelRails
2
- VERSION = '0.9.6'
2
+ VERSION = '0.9.7'
3
3
  end
@@ -56,7 +56,9 @@ describe SequelRails::Railtie do
56
56
  end
57
57
 
58
58
  it 'configures Sequel::Model instances for i18n' do
59
- expect(User.new.i18n_scope).to be(:sequel)
59
+ expect(User.i18n_scope).to be(:sequel)
60
+ expect(User).to respond_to(:lookup_ancestors)
61
+ expect(User.model_name.human).to eq('translated user')
60
62
  end
61
63
 
62
64
  it 'adds Sequel runtime to controller for logging' do
data/spec/spec_helper.rb CHANGED
@@ -20,6 +20,16 @@ rspec_exclusions[:sqlite] = ENV['TEST_ADAPTER'] != 'sqlite3'
20
20
 
21
21
  RSpec.configure do |config|
22
22
  config.filter_run_excluding rspec_exclusions
23
+
24
+ config.before(:all) do
25
+ I18n.backend.store_translations(
26
+ :en,
27
+ 'sequel' => {
28
+ 'models' => {
29
+ 'user' => 'translated user' }
30
+ })
31
+ end
32
+
23
33
  config.around :each do |example|
24
34
  if example.metadata[:no_transaction]
25
35
  example.run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brasten Sager (brasten)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-30 00:00:00.000000000 Z
12
+ date: 2014-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel