old_sql 0.34.0 → 0.35.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.
@@ -43,6 +43,7 @@ module OldSql
|
|
43
43
|
puts 'User Model Does Not Have Devise Support'
|
44
44
|
invoke 'old_sql:install_devise_migrations'
|
45
45
|
create_model_class unless model_exists?
|
46
|
+
add_devise_to_routes
|
46
47
|
end
|
47
48
|
|
48
49
|
end
|
@@ -99,6 +100,14 @@ module OldSql
|
|
99
100
|
|
100
101
|
gsub_file model_path, /DeviseModel/, "#{model_name.capitalize}"
|
101
102
|
end
|
103
|
+
|
104
|
+
def add_devise_to_routes
|
105
|
+
routes_path = "#{app_path}/config/routes.rb"
|
106
|
+
if open(routes_path).grep(/devise_for :#{model_name}/).count<=0
|
107
|
+
puts "Adding devise_for :#{model_name} to #{routes_path}"
|
108
|
+
prepend_to_file routes_path, "devise_for :#{model_name}"
|
109
|
+
end
|
110
|
+
end
|
102
111
|
|
103
112
|
def parse_route_files
|
104
113
|
# check if migrations exist
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: old_sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.35.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Eddie Gonzales
|
@@ -192,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
192
|
requirements:
|
193
193
|
- - ">="
|
194
194
|
- !ruby/object:Gem::Version
|
195
|
-
hash:
|
195
|
+
hash: 713868301801354549
|
196
196
|
segments:
|
197
197
|
- 0
|
198
198
|
version: "0"
|