Okay, It was devise issue. Once I commented out, everything worked
Full model for user was:
# encoding: utf-8
class CloudPbx::User < Sequel::Model(sequel_namespace(:users))
# plugin :devise
plugin :validation_helpers
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
#devise :database_authenticatable, :registerable,
# :recoverable, :rememberable, :trackable, :validatable
many_to_one :customer, class: 'CloudPbx::Customer'
one_to_many :owners, class: 'CloudPbx::Customer'
def validate
super
validates_presence [:email]
validates_unique :email
end
end
On Tuesday, 16 September 2014 22:52:04 UTC+2, Jeremy Evans wrote:
>
>
>
> On Tuesday, September 16, 2014 1:44:39 PM UTC-7, Andrius Kairiukstis wrote:
>>
>> Hello, I have module with sequel classes:
>>
>> module CloudPbx
>> class Customer < Sequel::Model(:cloud_pbx_customers)
>> one_to_many :users, class: 'CloudPbx::User'
>> end
>>
>> class CloudPbx::User < Sequel::Model(:cloud_pbx_users)
>>
>
> Is there a reason this isn't:
>
> class User < Sequel::Model(:cloud_pbx_users)
>
> not that it should matter.
>
> 2.1.2 (main):0 > u.customer
>> NameError: uninitialized constant User
>> from
>> /usr/local/rvm/gems/ruby-2.1.2/gems/activesupport-4.0.10/lib/active_support/inflector/methods.rb:226:in
>>
>> `const_get'
>>
>
> Can you provide the full backtrace for this? You have a namespaced
> constant, something is trying to use it without the namespace, and the
> backtrace will help to determine what that is.
>
> 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.