softace / activerecord-tableless

Bringing together the different tableless model implementations into a single gem/plugin
Other
113 stars 41 forks source link

Missing support for non Rails apps. #5

Closed schinery closed 11 years ago

schinery commented 11 years ago

I'm having a stab at getting activerecord-tableless integrated in a Padrino application and initially ran into this problem:

_activerecord-tableless/lib/activerecord-tableless.rb:42:in `has_notable': uninitialized constant ActiveRecord::Tableless::ActsMethods::Rails

After forking and changing in my local version Rails::VERSION::STRING to ActiveRecord::VERSION::STRING I was able to at least get my app started but now I have the following issue.

When I try and initialize a new object (currently just in a console using u = User.new) I am getting the following error:

ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished

My user model looks like this:

class User < ActiveRecord::Base

  has_no_table

  column :name, :string
  column :email, :string

end

I currently don't have any another ActiveRecord settings in my application, do you think I would as if I was using a database to get this to work?

jarl-dk commented 11 years ago

I have changed to use ActiveRecord::VERSION::STRING (thanks for that).

What version of ActiveRecord are you using? Note the gem does currently not work with AR 3.1.x (3.2.x is OK)

Could you dump your console session that triggers this problem, I cannot reproduce it.

Jarl

jarl-dk commented 11 years ago

I have release 1.1.2 which should do it...

schinery commented 11 years ago

Hi Jarl,

I've since gone down a different route with what I was trying to achieve, but I'll certainly have another look when I get a chance and let you know what happens.

For the record I was trying with AR 3.2.X, I think it was 3.2.11.

jarl-dk commented 11 years ago

I managed to reproduce the problem in an rspec test so the problem should be solved now.

Please reopen if you find time to try it again and it doesn't work for you.

Jarl

schinery commented 11 years ago

Will do...

azurewraith commented 11 years ago

I ran into this error with an earlier version of activerecord-tableless once I moved some code into an external gem. Once I updated the gem, the problem went away. Kudos.

jarl-dk commented 11 years ago

@azurewraith Thanks for the positive feedback,very motivating...