-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9000 gives private_attribute? warning #2886
Comments
I dunno if I should create a new issue or not. But I tried with this version: module AttrModel
def add_methods m
attr_accessor m
end
end
require 'active_record'
if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
require 'activerecord-jdbcsqlite3-adapter'
else
require 'sqlite3'
end
ActiveRecord::Base.establish_connection(
adapter: 'sqlite3',
database: ':memory:'
)
ActiveRecord::Schema.define do
create_table :users, force: true do |t|
t.string :username
end
end
ActiveRecord::Base.extend AttrModel
class User < ActiveRecord::Base
add_methods :password
validates :password, confirmation: true
end
attr_test = User.create password: 'Banana!', password_confirmation: 'Banana!'
puts attr_test.password On ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] :
On jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-05-23 57edf61 Java HotSpot(TM) 64-Bit Server VM 25.0-b70 on 1.8.0-b132 +jit [darwin-x86_64] :
|
I get this warning:
/.rbenv/versions/jruby-9.0.0.0-dev/lib/ruby/gems/shared/gems/sorcery-0.9.1/lib/sorcery/model.rb:71: warning: private attribute?
But I don't get it in ruby 2.2.2.
Here is the 9000 version I used:
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-04-28 a5c372d Java HotSpot(TM) 64-Bit Server VM 25.0-b70 on 1.8.0-b132 +jit [darwin-x86_64]
Should I report it to sorcery?
The problem here is that I think it's related to an error I get from sorcery:
NoMethodError: undefined method `password=' for #User:0x31dbe419
It's when I try to create a user:
The text was updated successfully, but these errors were encountered: