Comments (10)
Using authlogic with STI User models
I’m not sure, but I dont think it would be difficult to support. What are the specific errors?
by Ben Johnson
from authlogic.
Using authlogic with STI User models
I’m using authlogic with STI right now and everything seems to work fine under development, but when I run it in production mode and attempt to update a model, this is what I get:
NoMethodError (undefined method `=’ for #<Patient:0xb34032c>):
authlogic (2.1.1) [v] lib/authlogic/acts_as_authentic/password.rb:229:in `send’
authlogic (2.1.1) [v] lib/authlogic/acts_as_authentic/password.rb:229:in `password=’
Here’s the current setup for the models:
class User < ActiveRecord::Base
acts_as_authentic
end
class Patient < User;end
class Doctor < User;end
I looked at the password method, but I’m not sure what is happening or what to look for, is authlogic actually passing the whole model to the password method. Any help would be much appreciated.
Thanks!
-
Vann
by Vann
from authlogic.
Using authlogic with STI User models
It looks like:
Patient.crypted_password_field
Is returning nil. What does Patient.column_names return for you?
by Ben Johnson
from authlogic.
Using authlogic with STI User models
Here’s what it returns:
Patient.column_names
Patient Columns (3.2ms) SHOW FIELDS FROMusers
=> ["id", "login", "name", "email", "crypted_password", "salt", "created_at", "updated_at", "remember_token", "remember_token_expires_at", "first_name", "last_name", "ssn", "address", "city", "state", "zip", "drivers_license", "home_phone", "cell_phone", "fax", "employer", "insurance_co", "insurance_type", "insurance_id", "allergies", "medications", "operations", "chronic_conditions", "family_history", "immunizations", "visits_count", "appointments_count", "login_count", "getting_started", "type"]
by Vann
from authlogic.
I was about to use STI user models too, but don't really looking for trouble right now. What's the status on this? 8)
from authlogic.
@binarylogic what version of rails are you using? I am using authlogic with STI and it works beautifully on rails 2.3.2.
from authlogic.
Actually there is one thing that I am having trouble with and that is the password reset feature when using STI. It wants the param user. However my params for :user are nil. If I change to the appropriate STI class name it works fine but I have multiple STI sub class names. Any idea how I would fix that?
from authlogic.
Thanks to rsl, he showed me http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002334. In the form_for rather than using @user use @user.becomes(User) and it works beautifully again. Thanks again rsl.
from authlogic.
I too am using an app that uses authlogic and STI on User and it all works fine for me. I'm using authlogic 2.1.6 and rails 2.3.10
from authlogic.
Closing after six years with no activity. If this is still a problem in the latest version (currently 3.5.0), please let us know.
from authlogic.
Related Issues (20)
- Hashing ascii values vs bytes with SHA512 HOT 3
- Support for SameSite: "None" cookies HOT 1
- No changelog for 6.1.0 HOT 4
- Ruby 2.7 warnings HOT 2
- Inconsistent credentials cookie behaviour HOT 6
- Password#password_changed? returns true when transitioning crypto providers HOT 4
- Raise an error if database connection is not established before using acts_as_authentic
- Thread Safety HOT 1
- Ruby 2.7 warnings even in 6.1.0 (but not in master) HOT 2
- There isn't Git tag for v5.2.0. HOT 1
- Rubydoc for Authlogic is broken HOT 1
- When logging out from inside an iframe the `user_credentials` cookie doesn't get deleted in chromium based browsers. HOT 1
- Upgrade dependencies to accept Rails 7 HOT 10
- Eliminating a deprecation warning in Rails 7.0 HOT 3
- Wrong error message when valid email format of not existing user and fake password provided HOT 1
- NameError - wrong constant name Object.const_get(camel_cased_word) HOT 1
- Reference documentation (rubydoc) is broken
- NameError: `@' is not allowed as an instance variable name HOT 4
- Authlogic is incompatible with Minitest v5.19.0 and later HOT 3
- Incompatible with Rails 7.1 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from authlogic.