This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginController < ApplicationController | |
skip_before_filter :check_authentication, :only => :index | |
def index | |
@user = User.find_by_email(params[:email]) | |
if @user && @user.authenticate(params[:password]) | |
render 'login/index' | |
else | |
record_not_found | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginController < ApplicationController | |
skip_before_filter :check_authentication, :only => :index | |
def index | |
user = User.find_by_email(params[:email]) | |
if user && user.authenticate(params[:password]) | |
respond_with user | |
else | |
render | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginController < ApplicationController | |
skip_before_filter :check_authentication, :only => :index | |
def index | |
user = User.find_by_email(params[:email]) | |
if user and user.authenticate(params[:password]) | |
respond_with user | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginController < ApplicationController | |
skip_before_filter :check_authentication, :only => :index | |
def index | |
respond_with User.where(login_params) | |
end | |
private | |
def login_params | |
params.permit(:email, :password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateUsers < ActiveRecord::Migration | |
def change | |
enable_extension 'uuid-ossp' | |
create_table :users, id: false do |t| | |
t.primary_key :id, :uuid, :default => 'uuid_generate_v1()' | |
t.string :first_name | |
t.string :last_name | |
t.string :email | |
t.string :mobile_number | |
t.string :locality |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateUsers < ActiveRecord::Migration | |
def change | |
create_table :users, id: false do |t| | |
t.primary_key :id, :uuid, :default => 'uuid_generate_v1()' | |
t.string :first_name | |
t.string :last_name | |
t.string :email | |
t.string :mobile_number | |
t.string :locality | |
t.string :city |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Default users | |
rake aborted! | |
undefined method `push' for nil:NilClass | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/bindings/referenced/in.rb:29:in `bind_one' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/binding.rb:38:in `binding' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/threaded/lifecycle.rb:55:in `_binding' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/binding.rb:37:in `binding' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/bindings/referenced/in.rb:22:in `bind_one' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/proxy.rb:25:in `bind_one' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/referenced/in.rb:25:in `initialize' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Default users | |
rake aborted! | |
undefined method `<<' for nil:NilClass | |
/home/abhishek/mine/code/infocus/backend-ror/db/seeds.rb:10:in `(root)' | |
org/jruby/RubyKernel.java:1073:in `load' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:1:in `(root)' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load' | |
org/jruby/RubyProc.java:255:in `call' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Default users | |
rake aborted! | |
undefined method `<<' for nil:NilClass | |
/home/abhishek/mine/code/infocus/backend-ror/db/seeds.rb:10:in `(root)' | |
org/jruby/RubyKernel.java:1073:in `load' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:1:in `(root)' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load' | |
org/jruby/RubyProc.java:255:in `call' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** Invoke db:seed (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute db:seed | |
Default users | |
rake aborted! | |
undefined method `push' for nil:NilClass | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/bindings/referenced/in.rb:29:in `bind_one' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/relations/binding.rb:38:in `binding' | |
/home/abhishek/.rvm/gems/jruby-1.7.4/bundler/gems/mongoid-85e146637503/lib/mongoid/threaded/lifecycle.rb:55:in `_binding' |