activerecord-attribute_converter 0.1.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 +7 -0
- data/.gitignore +24 -0
- data/.rspec +3 -0
- data/.travis.yml +13 -0
- data/Appraisals +13 -0
- data/CHANGELOG.md +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +75 -0
- data/Rakefile +30 -0
- data/activerecord-attribute_converter.gemspec +28 -0
- data/gemfiles/rails_3.2.gemfile +7 -0
- data/gemfiles/rails_4.0.gemfile +7 -0
- data/gemfiles/rails_4.1.gemfile +7 -0
- data/lib/activerecord/attribute_converter/base.rb +48 -0
- data/lib/activerecord/attribute_converter/predicate_builder.rb +26 -0
- data/lib/activerecord/attribute_converter/relation.rb +28 -0
- data/lib/activerecord/attribute_converter/version.rb +5 -0
- data/lib/activerecord/attribute_converter.rb +8 -0
- data/spec/attribute_converter_spec.rb +84 -0
- data/spec/models.rb +30 -0
- data/spec/schema.rb +7 -0
- data/spec/spec_helper.rb +32 -0
- metadata +154 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0a1107bf795acf0d0ddd42afc3cd1512760445c4
|
4
|
+
data.tar.gz: f38eae4f2d62f732acddde5b5e096caf6228cda8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 44ae86c61702a4c4ca8204b56ccb07417943d1a645d1a3b263d7a3bc2cc48872a9b9e17d982d15a72785a7320d08e0dfadd591310df4abf5f6b58c822fd690a0
|
7
|
+
data.tar.gz: 413bc326e4a9eca90aa7dbd66be9d447deb6f967be959d2db40d5151ba77e5f0078bb585cbc62b18fc36de366587009e33233eaf1e87a5d8a1534cd9af50b076
|
data/.gitignore
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
gemfiles/*.gemfile.lock
|
24
|
+
gemfiles/vendor/bundle
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Appraisals
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Kohei Suzuki
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# ActiveRecord::AttributeConverter
|
2
|
+
[](https://travis-ci.org/eagletmt/activerecord-attribute_converter)
|
3
|
+
|
4
|
+
Transparent conversion for ActiveRecord.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
gem 'activerecord-attribute_converter'
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
Or install it yourself as:
|
17
|
+
|
18
|
+
$ gem install activerecord-attribute_converter
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
class Plus
|
24
|
+
def initialize(x)
|
25
|
+
@x = x
|
26
|
+
end
|
27
|
+
|
28
|
+
def internalize(n)
|
29
|
+
n+@x
|
30
|
+
end
|
31
|
+
|
32
|
+
def externalize(n)
|
33
|
+
n-@x
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module Rot13
|
38
|
+
module_function
|
39
|
+
|
40
|
+
def internalize(str)
|
41
|
+
str.tr('A-Za-z', 'N-ZA-Mn-za-m')
|
42
|
+
end
|
43
|
+
|
44
|
+
def externalize(str)
|
45
|
+
internalize(str)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class Book < ActiveRecord::Base
|
50
|
+
apply_converter :page, Plus.new(10)
|
51
|
+
apply_converter :title, Rot13
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
book = Book.create(author: 'Author', title: 'Title', page: 24)
|
57
|
+
p book.author # => "Author"
|
58
|
+
p book.title # => "Title"
|
59
|
+
p book.page # => 24
|
60
|
+
|
61
|
+
in_db = Book.connection.execute('SELECT * FROM books').first
|
62
|
+
p in_db['author'] # => "Author"
|
63
|
+
p in_db['title'] # => "Gvgyr"
|
64
|
+
p in_db['page'] # => 34
|
65
|
+
|
66
|
+
p Book.where(title: 'Title').map(&:title) # => ["Title"]
|
67
|
+
```
|
68
|
+
|
69
|
+
## Contributing
|
70
|
+
|
71
|
+
1. Fork it ( https://github.com/eagletmt/activerecord-attribute_converter/fork )
|
72
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
73
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
74
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
75
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
task :default => :spec
|
4
|
+
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
require 'appraisal'
|
9
|
+
namespace :spec do
|
10
|
+
appraisals = Appraisal::File.each
|
11
|
+
|
12
|
+
desc 'bundle install to local directory'
|
13
|
+
task :bundle do
|
14
|
+
appraisals.each do |appraisal|
|
15
|
+
env = { 'BUNDLE_GEMFILE' => appraisal.gemfile_path }
|
16
|
+
Bundler.clean_system(env, 'bundle', 'install', '-j4', '--path', 'vendor/bundle')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'Run RSpec for each appraisal'
|
21
|
+
task :all => appraisals.map(&:name)
|
22
|
+
|
23
|
+
appraisals.each do |appraisal|
|
24
|
+
desc "Run RSpec with appraisal #{appraisal.name}"
|
25
|
+
task appraisal.name do
|
26
|
+
env = { 'BUNDLE_GEMFILE' => appraisal.gemfile_path }
|
27
|
+
Bundler.clean_system(env, 'bundle', 'exec', 'rake', 'spec')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'activerecord/attribute_converter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "activerecord-attribute_converter"
|
8
|
+
spec.version = ActiveRecord::AttributeConverter::VERSION
|
9
|
+
spec.authors = ["Kohei Suzuki"]
|
10
|
+
spec.email = ["eagletmt@gmail.com"]
|
11
|
+
spec.summary = %q{Transparent conversion for ActiveRecord}
|
12
|
+
spec.description = %q{Transparent conversion for ActiveRecord}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "activerecord", ">= 3.2"
|
22
|
+
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.0.0.beta1"
|
25
|
+
spec.add_development_dependency "appraisal", "~> 1.0.0.beta1"
|
26
|
+
|
27
|
+
spec.add_development_dependency "sqlite3"
|
28
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module AttributeConverter
|
3
|
+
module Base
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
def internalize_attributes
|
7
|
+
self.class.attribute_converters.each do |attr, converter|
|
8
|
+
if attributes.has_key?(attr)
|
9
|
+
send("#{attr}=", converter.internalize(send(attr)))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def externalize_attributes
|
15
|
+
self.class.attribute_converters.each do |attr, converter|
|
16
|
+
if attributes.has_key?(attr)
|
17
|
+
send("#{attr}=", converter.externalize(send(attr)))
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
module ClassMethods
|
23
|
+
def apply_converter(attr, converter)
|
24
|
+
unless @attribute_converters
|
25
|
+
install_attribute_converter
|
26
|
+
end
|
27
|
+
|
28
|
+
self.attribute_converters[attr.to_s] = converter
|
29
|
+
end
|
30
|
+
|
31
|
+
def install_attribute_converter
|
32
|
+
@attribute_converters = {}
|
33
|
+
|
34
|
+
before_save :internalize_attributes
|
35
|
+
|
36
|
+
after_save :externalize_attributes
|
37
|
+
after_find :externalize_attributes
|
38
|
+
end
|
39
|
+
|
40
|
+
def attribute_converters
|
41
|
+
@attribute_converters || {}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
ActiveRecord::Base.send(:include, ActiveRecord::AttributeConverter::Base)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module AttributeConverter
|
3
|
+
module PredicateBuilder
|
4
|
+
def build_from_hash_with_attribute_converter(*args)
|
5
|
+
klass = args[0]
|
6
|
+
unless klass.attribute_converters.empty?
|
7
|
+
attributes = args[1].stringify_keys
|
8
|
+
|
9
|
+
klass.attribute_converters.each do |attr, converter|
|
10
|
+
if attributes.has_key?(attr)
|
11
|
+
attributes[attr] = converter.internalize(attributes[attr])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
args[1] = attributes
|
16
|
+
end
|
17
|
+
build_from_hash_without_attribute_converter(*args)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
ActiveRecord::PredicateBuilder.singleton_class.class_eval do
|
24
|
+
include ActiveRecord::AttributeConverter::PredicateBuilder
|
25
|
+
alias_method_chain :build_from_hash, :attribute_converter
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module AttributeConverter
|
3
|
+
module Relation
|
4
|
+
def update_all_with_attribute_converter(*args)
|
5
|
+
updates = args[0]
|
6
|
+
conditions = args[1]
|
7
|
+
options = args[2] || {}
|
8
|
+
|
9
|
+
if !conditions && !options.present? && !@klass.attribute_converters.empty? && updates.is_a?(Hash)
|
10
|
+
updates = updates.stringify_keys
|
11
|
+
@klass.attribute_converters.each do |attr, converter|
|
12
|
+
if updates.has_key?(attr)
|
13
|
+
updates[attr] = converter.internalize(updates[attr])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
args[0] = updates
|
17
|
+
end
|
18
|
+
|
19
|
+
update_all_without_attribute_converter(*args)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
ActiveRecord::Relation.class_eval do
|
26
|
+
include ActiveRecord::AttributeConverter::Relation
|
27
|
+
alias_method_chain :update_all, :attribute_converter
|
28
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'active_support/lazy_load_hooks'
|
2
|
+
require 'activerecord/attribute_converter/version'
|
3
|
+
|
4
|
+
ActiveSupport.on_load(:active_record) do
|
5
|
+
require 'activerecord/attribute_converter/base'
|
6
|
+
require 'activerecord/attribute_converter/relation'
|
7
|
+
require 'activerecord/attribute_converter/predicate_builder'
|
8
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ActiveRecord::AttributeConverter do
|
4
|
+
describe '#save' do
|
5
|
+
let(:book) { Book.new(author: 'Author', title: 'Title', page: 24) }
|
6
|
+
|
7
|
+
it 'converts attributes' do
|
8
|
+
expect(book.title).to eq('Title')
|
9
|
+
expect(book.page).to eq(24)
|
10
|
+
book.save
|
11
|
+
expect(book.title).to eq('Title')
|
12
|
+
expect(book.page).to eq(24)
|
13
|
+
expect(Book.where(['title = ?', 'Title'])).to_not exist
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'query methods' do
|
18
|
+
before do
|
19
|
+
Book.create(author: 'Author', title: 'Title', page: 24)
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'find_by_*' do
|
23
|
+
it 'finds record by external value' do
|
24
|
+
expect(Book.find_by_author('Author')).to_not be_nil
|
25
|
+
expect(Book.find_by_title('Title')).to_not be_nil
|
26
|
+
expect(Book.find_by_author_and_page('Author', 24)).to_not be_nil
|
27
|
+
expect(Book.find_by_title_and_page('Title', 24)).to_not be_nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe 'find_by', version: 4 do
|
32
|
+
it 'finds record by external value' do
|
33
|
+
expect(Book.find_by(author: 'Author')).to_not be_nil
|
34
|
+
expect(Book.find_by(title: 'Title')).to_not be_nil
|
35
|
+
expect(Book.find_by(author: 'Author', page: 24)).to_not be_nil
|
36
|
+
expect(Book.find_by(title: 'Title', page: 24)).to_not be_nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'where' do
|
41
|
+
it 'finds records by Hash' do
|
42
|
+
expect(Book.where(author: 'Author')).to exist
|
43
|
+
expect(Book.where(title: 'Title')).to exist
|
44
|
+
expect(Book.where(author: 'Author', page: 24)).to exist
|
45
|
+
expect(Book.where(title: 'Title', page: 24)).to exist
|
46
|
+
end
|
47
|
+
|
48
|
+
it "doesn't support String/Array finder" do
|
49
|
+
expect(Book.where(['author = ?', 'Author'])).to exist
|
50
|
+
expect(Book.where(['title = ?', 'Title'])).to_not exist
|
51
|
+
expect(Book.where(['page = ?', 24])).to_not exist
|
52
|
+
expect(Book.where('page = 24')).to_not exist
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe 'update methods' do
|
58
|
+
let!(:book) { Book.create(author: 'Author', title: 'Title', page: 24) }
|
59
|
+
|
60
|
+
describe 'update_column' do
|
61
|
+
it 'converts attributes' do
|
62
|
+
book.update_column(:title, 'New Title')
|
63
|
+
expect(book.title).to eq('New Title')
|
64
|
+
expect(Book.where(title: 'New Title')).to exist
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe 'update_all' do
|
69
|
+
it 'converts attributes by Hash' do
|
70
|
+
Book.where(author: 'Author').update_all(page: 100)
|
71
|
+
expect(book.reload.page).to eq(100)
|
72
|
+
expect(Book.where(page: 100)).to exist
|
73
|
+
expect(Book.where('page = ?', 100)).to_not exist
|
74
|
+
end
|
75
|
+
|
76
|
+
it "doesn't support String/Array" do
|
77
|
+
Book.where(author: 'Author').update_all(['page = ?', 100])
|
78
|
+
expect(book.reload.page).to_not eq(100)
|
79
|
+
expect(Book.where(page: 100)).to_not exist
|
80
|
+
expect(Book.where('page = ?', 100)).to exist
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
data/spec/models.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
class Plus
|
2
|
+
def initialize(x)
|
3
|
+
@x = x
|
4
|
+
end
|
5
|
+
|
6
|
+
def internalize(n)
|
7
|
+
n+@x
|
8
|
+
end
|
9
|
+
|
10
|
+
def externalize(n)
|
11
|
+
n-@x
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module Rot13
|
16
|
+
module_function
|
17
|
+
|
18
|
+
def internalize(str)
|
19
|
+
str.tr('A-Za-z', 'N-ZA-Mn-za-m')
|
20
|
+
end
|
21
|
+
|
22
|
+
def externalize(str)
|
23
|
+
internalize(str)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Book < ActiveRecord::Base
|
28
|
+
apply_converter :page, Plus.new(10)
|
29
|
+
apply_converter :title, Rot13
|
30
|
+
end
|
data/spec/schema.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'activerecord/attribute_converter'
|
2
|
+
|
3
|
+
require 'active_record'
|
4
|
+
ActiveRecord::Base.configurations['test'] = {
|
5
|
+
adapter: 'sqlite3',
|
6
|
+
database: ':memory:',
|
7
|
+
}
|
8
|
+
ActiveRecord::Base.establish_connection('test')
|
9
|
+
require File.expand_path('../schema', __FILE__)
|
10
|
+
require File.expand_path('../models', __FILE__)
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.filter_run :focus
|
14
|
+
config.filter_run_excluding version: lambda { |v| v != ActiveRecord::VERSION::MAJOR }
|
15
|
+
config.run_all_when_everything_filtered = true
|
16
|
+
|
17
|
+
config.order = :random
|
18
|
+
Kernel.srand config.seed
|
19
|
+
|
20
|
+
config.expect_with :rspec do |expectations|
|
21
|
+
expectations.syntax = :expect
|
22
|
+
end
|
23
|
+
|
24
|
+
config.mock_with :rspec do |mocks|
|
25
|
+
mocks.syntax = :expect
|
26
|
+
mocks.verify_partial_doubles = true
|
27
|
+
end
|
28
|
+
|
29
|
+
config.after :each do
|
30
|
+
Book.delete_all
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activerecord-attribute_converter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kohei Suzuki
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.0.0.beta1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 3.0.0.beta1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: appraisal
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.0.beta1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.0.beta1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sqlite3
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Transparent conversion for ActiveRecord
|
98
|
+
email:
|
99
|
+
- eagletmt@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
|
+
- Appraisals
|
108
|
+
- CHANGELOG.md
|
109
|
+
- Gemfile
|
110
|
+
- LICENSE.txt
|
111
|
+
- README.md
|
112
|
+
- Rakefile
|
113
|
+
- activerecord-attribute_converter.gemspec
|
114
|
+
- gemfiles/rails_3.2.gemfile
|
115
|
+
- gemfiles/rails_4.0.gemfile
|
116
|
+
- gemfiles/rails_4.1.gemfile
|
117
|
+
- lib/activerecord/attribute_converter.rb
|
118
|
+
- lib/activerecord/attribute_converter/base.rb
|
119
|
+
- lib/activerecord/attribute_converter/predicate_builder.rb
|
120
|
+
- lib/activerecord/attribute_converter/relation.rb
|
121
|
+
- lib/activerecord/attribute_converter/version.rb
|
122
|
+
- spec/attribute_converter_spec.rb
|
123
|
+
- spec/models.rb
|
124
|
+
- spec/schema.rb
|
125
|
+
- spec/spec_helper.rb
|
126
|
+
homepage: ''
|
127
|
+
licenses:
|
128
|
+
- MIT
|
129
|
+
metadata: {}
|
130
|
+
post_install_message:
|
131
|
+
rdoc_options: []
|
132
|
+
require_paths:
|
133
|
+
- lib
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
requirements: []
|
145
|
+
rubyforge_project:
|
146
|
+
rubygems_version: 2.2.2
|
147
|
+
signing_key:
|
148
|
+
specification_version: 4
|
149
|
+
summary: Transparent conversion for ActiveRecord
|
150
|
+
test_files:
|
151
|
+
- spec/attribute_converter_spec.rb
|
152
|
+
- spec/models.rb
|
153
|
+
- spec/schema.rb
|
154
|
+
- spec/spec_helper.rb
|