Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Commit

Permalink
Support for the latest ActiveRecord versions and update styling
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry committed Oct 30, 2015
1 parent 2065a07 commit 402a34d
Show file tree
Hide file tree
Showing 16 changed files with 524 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pkg/*
test.log
test/has_translations_plugin.sqlite3.db
test/debug.log

Gemfile.lock
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ rvm:
- 2.0.0
- 2.1.7
- 2.2.3

before_install:
- "gem install bundler -v=1.3.0"
- "gem install bundler -v=1.10.6"
before_script:
- "bundle install"

script: "bundle exec rake test"

gemfile:
- gemfiles/3.1.gemfile
- gemfiles/3.2.gemfile
- gemfiles/4.0.gemfile

matrix:
exclude:
- rvm: ree
gemfile: gemfiles/4.0.gemfile
- gemfiles/4.1.gemfile
- gemfiles/4.2.gemfile
cache: bundler
18 changes: 11 additions & 7 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
appraise '3.1' do
gem 'rails', '~> 3.1.6'
end

appraise '3.2' do
gem 'rails', '~> 3.2.6'
gem 'rails', '~> 3.2.22'
end

appraise '4.0' do
gem 'rails', '4.0.0'
end
gem 'rails', '4.0.13'
end

appraise '4.1' do
gem 'rails', '4.1.13'
end

appraise '4.2' do
gem 'rails', '4.2.4'
end
66 changes: 36 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
PATH
remote: .
specs:
has_translations (1.0.0)
activerecord (>= 3.1.0)
activesupport (>= 3.1.0)
has_translations (1.1.0)
activerecord (>= 3.2.0)
activesupport (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
activerecord (4.0.0)
activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
appraisal (0.5.2)
activemodel (4.2.4)
activesupport (= 4.2.4)
builder (~> 3.1)
activerecord (4.2.4)
activemodel (= 4.2.4)
activesupport (= 4.2.4)
arel (~> 6.0)
activesupport (4.2.4)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
appraisal (2.1.0)
bundler
rake
arel (4.0.0)
atomic (1.1.10)
builder (3.1.4)
i18n (0.6.4)
minitest (4.7.5)
multi_json (1.7.7)
rake (10.1.0)
sqlite3 (1.3.7)
thread_safe (0.1.2)
atomic
tzinfo (0.3.37)
thor (>= 0.14.0)
arel (6.0.3)
builder (3.2.2)
i18n (0.7.0)
json (1.8.3)
minitest (5.8.2)
power_assert (0.2.5)
rake (10.4.2)
sqlite3 (1.3.11)
test-unit (3.1.5)
power_assert
thor (0.19.1)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby
Expand All @@ -46,3 +48,7 @@ DEPENDENCIES
has_translations!
rake
sqlite3
test-unit

BUNDLED WITH
1.10.6
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
HasTranslations
==============================

[![Build Status](https://secure.travis-ci.org/dmitry/has_translations.png?branch=master)](http://travis-ci.org/dmitry/has_translations) [![Gem Version](https://badge.fury.io/rb/has_translations.png)](http://badge.fury.io/rb/has_translations) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dmitry/has_translations/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
[![Build Status](https://secure.travis-ci.org/dmitry/has_translations.png?branch=master)](http://travis-ci.org/dmitry/has_translations)
[![Gem Version](https://badge.fury.io/rb/has_translations.png)](http://badge.fury.io/rb/has_translations)

This simple plugin creates translations for your model.
Uses delegation pattern: http://en.wikipedia.org/wiki/Delegation_pattern

Tested with ActiveRecord versions: 3.1.x, 3.2.x, 4.0.x
And tested with ruby 1.8.7 (ree), 1.9.3, 2.0.0
Tested with ActiveRecord versions: 3.2.x, 4.0.x, 4.1.x, 4.2.x
And tested with ruby 1.9.3, 2.0.0, 2.1.x, 2.2.x

Compatibility
=============

This version only support Rails 4.0.x and 3.x.x. For Rails 2.3.x support please get the 0.3.5 version of this gem.
This version only support Rails 4.x.x and 3.2.x. For Rails 2.3.x support please get the 0.3.5 version of this gem and for Rails 3.1.x get the 1.0.0 of this gem.
Plugin support is deprecated in Rails and will be removed soon so this version drop plugin support.
To prevent method shadowing between "translations" class method and "translations" relation in models the class
method has been renamed has_translations.
Expand Down Expand Up @@ -131,4 +132,4 @@ I know three of them:
* [translatable_columns](http://github.com/iain/translatable_columns) - different approach: every column have own postfix "_#{locale}" in the same table (sometimes it could be fine).


Copyright (c) 2009-2013 [Dmitry Polushkin], released under the MIT license
Copyright (c) 2009-2016 [Dmitry Polushkin], released under the MIT license
4 changes: 2 additions & 2 deletions gemfiles/3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "rails", "~> 3.2.6"
gem "rails", "~> 3.2.22"

gemspec :path=>"../"
gemspec :path => "../"
108 changes: 108 additions & 0 deletions gemfiles/3.2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
PATH
remote: ../
specs:
has_translations (1.1.0)
activerecord (>= 3.2.0)
activesupport (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.22)
actionpack (= 3.2.22)
mail (~> 2.5.4)
actionpack (3.2.22)
activemodel (= 3.2.22)
activesupport (= 3.2.22)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.22)
activesupport (= 3.2.22)
builder (~> 3.0.0)
activerecord (3.2.22)
activemodel (= 3.2.22)
activesupport (= 3.2.22)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.22)
activemodel (= 3.2.22)
activesupport (= 3.2.22)
activesupport (3.2.22)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
appraisal (2.1.0)
bundler
rake
thor (>= 0.14.0)
arel (3.0.3)
builder (3.0.4)
erubis (2.7.0)
hike (1.2.3)
i18n (0.7.0)
journey (1.0.4)
json (1.8.3)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
multi_json (1.11.2)
polyglot (0.3.5)
power_assert (0.2.5)
rack (1.4.7)
rack-cache (1.5.1)
rack (>= 0.4)
rack-ssl (1.3.4)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (3.2.22)
actionmailer (= 3.2.22)
actionpack (= 3.2.22)
activerecord (= 3.2.22)
activeresource (= 3.2.22)
activesupport (= 3.2.22)
bundler (~> 1.0)
railties (= 3.2.22)
railties (3.2.22)
actionpack (= 3.2.22)
activesupport (= 3.2.22)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.4.2)
rdoc (3.12.2)
json (~> 1.4)
sprockets (2.2.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.11)
test-unit (3.1.5)
power_assert
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.45)

PLATFORMS
ruby

DEPENDENCIES
appraisal
has_translations!
rails (~> 3.2.22)
rake
sqlite3
test-unit

BUNDLED WITH
1.10.6
4 changes: 2 additions & 2 deletions gemfiles/4.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "rails", "4.0.0"
gem "rails", "4.0.13"

gemspec :path=>"../"
gemspec :path => "../"
91 changes: 91 additions & 0 deletions gemfiles/4.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
PATH
remote: ../
specs:
has_translations (1.1.0)
activerecord (>= 3.2.0)
activesupport (>= 3.2.0)

GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.13)
actionpack (= 4.0.13)
mail (~> 2.5, >= 2.5.4)
actionpack (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
activerecord (4.0.13)
activemodel (= 4.0.13)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.13)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.4)
activesupport (4.0.13)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
appraisal (2.1.0)
bundler
rake
thor (>= 0.14.0)
arel (4.0.2)
builder (3.1.4)
erubis (2.7.0)
i18n (0.7.0)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.6.2)
minitest (4.7.5)
multi_json (1.11.2)
power_assert (0.2.5)
rack (1.5.5)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.0.13)
actionmailer (= 4.0.13)
actionpack (= 4.0.13)
activerecord (= 4.0.13)
activesupport (= 4.0.13)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.13)
sprockets-rails (~> 2.0)
railties (4.0.13)
actionpack (= 4.0.13)
activesupport (= 4.0.13)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
sprockets (3.4.0)
rack (> 1, < 3)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.11)
test-unit (3.1.5)
power_assert
thor (0.19.1)
thread_safe (0.3.5)
tzinfo (0.3.45)

PLATFORMS
ruby

DEPENDENCIES
appraisal
has_translations!
rails (= 4.0.13)
rake
sqlite3
test-unit

BUNDLED WITH
1.10.6
7 changes: 7 additions & 0 deletions gemfiles/4.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "4.1.13"

gemspec :path => "../"
Loading

0 comments on commit 402a34d

Please sign in to comment.