Jeremy, let me ask you for help once again.

I removed the declarations below as you stated, and everything worked on my 
tests.

attr_accessor :username, :password, :points, :trial_expires_at, :role, :
fullname, :about, :status, :uuid
attr_reader :created_at, :updated_at, :trial_expires_at


so my class declaration became

class User < Sequel::Model

  set_allowed_columns :username, :password, :points

  def self.get_new_client(username, password, fullname = nil, about = nil)
      get_new_user(username, password, Constants::POINTS_INITIAL_VALUE, 
Constants::USER_TRIAL_TIME, UserRole::CLIENT, fullname, about)
  end

  def self.get_new_user(username, passwd, points, days_to_try, role=UserRole
.Client, fullname='', about='')
    ...
  end

end


The point is that it's working on Windows 7 64bits, ruby 2.0.0p481 
(2014-05-08) [i386-mingw32].

When I run the same code on Linux, I get a bunch of errors like the 
following

ERROR["test_0001_creates an user account using most complete version of 
get_new_user. All data filled.", #<Class:0x000000031aee30>, 0.001304537]
 test_0001_creates an user account using most complete version of 
get_neW_user. All data filled.#User Model (0.00s)
NoMethodError:         NoMethodError: undefined method `username=' for 
#<User @values={}>
            /home/plicatibu/RubymineProjects/a4a/models/user.rb:60:in `
get_new_user'
            
/home/plicatibu/RubymineProjects/a4a/test/models/user_test.rb:22:in `block 
(2 levels) in <top (required)>'
        /home/plicatibu/RubymineProjects/a4a/models/user.rb:60:in 
`get_new_user'
        /home/plicatibu/RubymineProjects/a4a/test/models/user_test.rb:22:in 
`block (2 levels) in <top (required)>'

We can see that Ruby doesn't recognize username as a valid for class User:
NoMethodError: NoMethodError: undefined method `username=' for #<User 
@values={}>

In case I change the code from 

u.username = 'username'

to

u[:username] = 'username'

it works on both Linux and Windows.

Is this difference in behavior because O.S are different, becuse ruby 
versions are not the same - *2.0.0p481 (2014-05-08) [i386-mingw32]* in 
windows - and *2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]* in 
Linux) or am I messing up something?

Note in Linux I use rvm.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to