On Monday, September 15, 2014 1:05:54 PM UTC-7, Marcio Andrey Oliveira 
wrote:
>
> 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={}>
>

The cause of this type of error is that the User#username= method was not 
automatically created by Sequel, most likely because it couldn't parse the 
schema information for the table.  Did the table exist at the time of the 
model's creation on Linux?  If not, make sure the table is created before 
the model class.  Otherwise, run

  Sequel::Model.db.schema(:users)

and let me know the results.

Thanks,
Jeremy

-- 
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