ar_to_ar 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/LICENSE +1 -1
- data/README.md +10 -0
- data/ar_to_ar.gemspec +1 -1
- data/lib/ar_to_ar.rb +1 -1
- data/lib/ar_to_ar/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 052760c14f858420831f291ce9886834d02309bf
|
4
|
+
data.tar.gz: 028db699241aa280ba9422e6154926136a19f849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4bf0d7958f36c42467735c875a4b8de030aa2dccf7ec982db283973e71e4e9d70d2d60734eb762c6cd8190c0128ac5a769b795436017d3d9afd80e36637e370
|
7
|
+
data.tar.gz: 05f49ed7ed7caa5c5c07c6280b97bd74553d55de849c288318a04f7531b33f7fc22b3483bf5a03c1eed39b239fa2ea426cb2de8bd0f9bdc9274845c7f276984c
|
data/.travis.yml
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,17 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/rishijain/ar_to_ar.svg?branch=master)](https://travis-ci.org/rishijain/ar_to_ar)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/ar_to_ar.svg)](https://badge.fury.io/rb/ar_to_ar)
|
3
|
+
|
1
4
|
# ArToAr
|
2
5
|
|
3
6
|
One of the notable changes in Rails 5 is that models now inherit from ApplicationRecord instead of ActiveRecord::Base. So this gem helps you avoid the manual labour of changing each and every model in your rails project. Instead just use the command line tool available through this gem.
|
4
7
|
|
8
|
+
It also adds an application_record.rb file with content:
|
9
|
+
```ruby
|
10
|
+
class ApplicationRecord < ActiveRecord::Base
|
11
|
+
self.abstract_class = true
|
12
|
+
end
|
13
|
+
```
|
14
|
+
|
5
15
|
## Installation
|
6
16
|
|
7
17
|
Add this line to your application's Gemfile:
|
data/ar_to_ar.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.10"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
spec.add_development_dependency "minitest", '~>
|
23
|
+
spec.add_development_dependency "minitest", '~> 5.8'
|
24
24
|
|
25
25
|
spec.license = 'MIT'
|
26
26
|
end
|
data/lib/ar_to_ar.rb
CHANGED
@@ -29,7 +29,7 @@ module ArToAr
|
|
29
29
|
#class ModelName < ActiveRecord::Base
|
30
30
|
def find_matched_line(file_path)
|
31
31
|
File.open(file_path, "r++") do |file|
|
32
|
-
return file.find { |line| line.match /(class(.+)<\s*ActiveRecord::Base)/ }
|
32
|
+
return file.find { |line| line.force_encoding('UTF-8').match /(class(.+)<\s*ActiveRecord::Base)/ }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
data/lib/ar_to_ar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_to_ar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rishi Jain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '5.8'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '5.8'
|
55
55
|
description: When migrating to Rails 5, all models needs to be changed and application_record.rb
|
56
56
|
needs to be added
|
57
57
|
email:
|