old_sql 1.60.0 → 1.61.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,7 +63,7 @@ module OldSql
63
63
 
64
64
  def configure_initializer
65
65
  initializer_path = "#{app_path}/config/initializers/old_sql.rb"
66
- gsub_file initializer_path, /DeviseModel/, "#{model_name.singularize.downcase}"
66
+ gsub_file initializer_path, /DeviseModel/, "#{model_name.pluralize.downcase}"
67
67
  end
68
68
 
69
69
  ################ PRIVATE ################
@@ -129,20 +129,20 @@ module OldSql
129
129
  app_path.delete_at(-1)
130
130
  app_path = app_path.join("/")
131
131
 
132
- File.exists?("#{app_path}/app/models/#{model_name}.rb")
132
+ File.exists?("#{app_path}/app/models/#{model_name.pluralize}.rb")
133
133
  end
134
134
 
135
135
  def create_model_class
136
- model_path = "#{app_path}/app/models/#{model_name.singularize}.rb"
136
+ model_path = "#{app_path}/app/models/#{model_name.pluralize}.rb"
137
137
  copy_file "devise_model.rb.template", model_path
138
- gsub_file model_path, /DeviseModel/, "#{model_name.singularize.capitalize}"
138
+ gsub_file model_path, /DeviseModel/, "#{model_name.pluralize.capitalize}"
139
139
  end
140
140
 
141
141
  def add_devise_to_routes
142
142
  routes_path = "#{app_path}/config/routes.rb"
143
143
  if open(routes_path).grep(/devise_for :#{model_name}/).count<=0
144
- puts "Adding devise_for :#{model_name.singularize} to #{routes_path}"
145
- insert_into_file routes_path, " devise_for :#{model_name.singularize}\n\n", :after => "Application.routes.draw do\n"
144
+ puts "Adding devise_for :#{model_name.pluralize} to #{routes_path}"
145
+ insert_into_file routes_path, " devise_for :#{model_name.pluralize}\n\n", :after => "Application.routes.draw do\n"
146
146
  end
147
147
  end
148
148
 
@@ -5,5 +5,5 @@ class DeviseModel < ActiveRecord::Base
5
5
  :recoverable, :rememberable, :trackable, :validatable
6
6
 
7
7
  # Setup accessible (or protected) attributes for your model
8
- #attr_accessible :email, :password, :password_confirmation, :remember_me
8
+ attr_accessible :email, :password, :password_confirmation, :remember_me
9
9
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: old_sql
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.60.0
5
+ version: 1.61.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Eddie Gonzales
@@ -198,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- hash: 4485726066099420865
201
+ hash: -1322869717026448676
202
202
  segments:
203
203
  - 0
204
204
  version: "0"