There is some good code in CouchRest::Model, but I don't think it fits
the core of what CouchRest is about, which is having a technically
strong CouchDB library thats ready to support other more complex code
on top of it.
I plan to spin CouchRest::Model out into it's own project, and then
encourage people to hack it as crazy as they wanna. I have no idea
what to call the standalone project. I don't think CouchRest should be
part of the name, because CouchRest is about being solid, and Model is
an experiment in making a Rails-like DSL around Couch views.
> There is some good code in CouchRest::Model, but I don't think it fits
> the core of what CouchRest is about, which is having a technically
> strong CouchDB library thats ready to support other more complex code
> on top of it.
> I plan to spin CouchRest::Model out into it's own project, and then
> encourage people to hack it as crazy as they wanna. I have no idea
> what to call the standalone project. I don't think CouchRest should be
> part of the name, because CouchRest is about being solid, and Model is
> an experiment in making a Rails-like DSL around Couch views.
I agree, since Model takes a very much uncolored Couch API and then
(necessarily) makes all kinds of assumptions on top of it.
I'm currently making a gem to walk a CouchRest result hash, walk down
recursively, and map the values (where appropriate) to persistence-
ignorant model types.
If anyone has any input, or would like to help me out, contact me.
> There is some good code in CouchRest::Model, but I don't think it fits
> the core of what CouchRest is about, which is having a technically
> strong CouchDB library thats ready to support other more complex code
> on top of it.
> I plan to spin CouchRest::Model out into it's own project, and then
> encourage people to hack it as crazy as they wanna. I have no idea
> what to call the standalone project. I don't think CouchRest should be
> part of the name, because CouchRest is about being solid, and Model is
> an experiment in making a Rails-like DSL around Couch views.
> On Jan 14, 2:10 am, "J. Chris Anderson" <jch...@gmail.com> wrote:
>> There is some good code in CouchRest::Model, but I don't think it
>> fits
>> the core of what CouchRest is about, which is having a technically
>> strong CouchDB library thats ready to support other more complex code
>> on top of it.
>> I plan to spin CouchRest::Model out into it's own project, and then
>> encourage people to hack it as crazy as they wanna. I have no idea
>> what to call the standalone project. I don't think CouchRest should
>> be
>> part of the name, because CouchRest is about being solid, and Model
>> is
>> an experiment in making a Rails-like DSL around Couch views.
I liked it too, but at the same time I effectively forgot that there
was more to CouchRest than CouchModel. So if it was refactored into a
separate project, so that we could (not saying "should") have multiple
ORMs built on top of CouchRest, I would not be opposed :)
On Jan 14, 7:29 am, Samuel Flores <samflo...@gmail.com> wrote:
> On 14/01/2009, at 10:08, justindz <justi...@gmail.com> wrote:
> > CouchCushion?
> > On Jan 14, 2:10 am, "J. Chris Anderson" <jch...@gmail.com> wrote:
> >> There is some good code in CouchRest::Model, but I don't think it
> >> fits
> >> the core of what CouchRest is about, which is having a technically
> >> strong CouchDB library thats ready to support other more complex code
> >> on top of it.
> >> I plan to spin CouchRest::Model out into it's own project, and then
> >> encourage people to hack it as crazy as they wanna. I have no idea
> >> what to call the standalone project. I don't think CouchRest should
> >> be
> >> part of the name, because CouchRest is about being solid, and Model
> >> is
> >> an experiment in making a Rails-like DSL around Couch views.
On Jan 14, 7:50 am, Maximus <nanode...@gmail.com> wrote:
> I liked it too, but at the same time I effectively forgot that there
> was more to CouchRest than CouchModel. So if it was refactored into a
> separate project, so that we could (not saying "should") have multiple
> ORMs built on top of CouchRest, I would not be opposed :)
Yes, I'd love to see the code from CR::Model get reused and
frankensteined into lots of alternative ways to use it.
There are already a few good "model" libraries based on CouchRest. I'm
hoping to see even more, as different application have wildly
different needs.
I played with a library that apparently might or might not become public.
The lib was divided in 3 parts:
- storage (fork of CouchRest 0.9.15 without the orm side of things)
- model (because not all models are documents)
- document (uses model and storage to deal with documents)
I really like how things are split up and it makes things easier to tweak. I
hope the author will consider releasing the gems, but since he doesn't want
to support it, that might never happen.
- Matt
On Wed, Jan 14, 2009 at 12:02 PM, J. Chris Anderson <jch...@apache.org>wrote:
> On Jan 14, 7:50 am, Maximus <nanode...@gmail.com> wrote:
> > I liked it too, but at the same time I effectively forgot that there
> > was more to CouchRest than CouchModel. So if it was refactored into a
> > separate project, so that we could (not saying "should") have multiple
> > ORMs built on top of CouchRest, I would not be opposed :)
> Yes, I'd love to see the code from CR::Model get reused and
> frankensteined into lots of alternative ways to use it.
> There are already a few good "model" libraries based on CouchRest. I'm
> hoping to see even more, as different application have wildly
> different needs.
> I played with a library that apparently might or might not become public.
> The lib was divided in 3 parts:
> - storage (fork of CouchRest 0.9.15 without the orm side of things)
> - model (because not all models are documents)
> - document (uses model and storage to deal with documents)
> I really like how things are split up and it makes things easier to tweak.
> I hope the author will consider releasing the gems, but since he doesn't
> want to support it, that might never happen.
> - Matt
> On Wed, Jan 14, 2009 at 12:02 PM, J. Chris Anderson <jch...@apache.org>wrote:
>> On Jan 14, 7:50 am, Maximus <nanode...@gmail.com> wrote:
>> > I liked it too, but at the same time I effectively forgot that there
>> > was more to CouchRest than CouchModel. So if it was refactored into a
>> > separate project, so that we could (not saying "should") have multiple
>> > ORMs built on top of CouchRest, I would not be opposed :)
>> Yes, I'd love to see the code from CR::Model get reused and
>> frankensteined into lots of alternative ways to use it.
>> There are already a few good "model" libraries based on CouchRest. I'm
>> hoping to see even more, as different application have wildly
>> different needs.
I'm getting a strange error with couchrest-0.12.2:
Try this out:
%w(rubygems couchrest).each {|g| require g}
class Foo < CouchRest::Model
use_database CouchRest.database!('http://127.0.0.1:5984/my- database')
end
Foo.all
p Foo.design_doc.database
Running this code the first time returns an CouchRest::Database
instance, running it the second time (after the design doc has been
added) I get:
NoMethodError: undefined method `view' for nil:NilClass
from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
couchrest/core/design.rb:84:in `fetch_view'
from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
couchrest/core/design.rb:42:in `view'
from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
couchrest/core/model.rb:392:in `fetch_view'
from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
couchrest/core/model.rb:383:in `fetch_view_with_docs'
from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
couchrest/core/model.rb:346:in `view'
from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
couchrest/core/model.rb:121:in `all'
from (irb):5
from :0
The second time around, saved returns true, saved gets saved (line 363
in model.rb) but it doesn't seem like the design_doc's database value
get's updated.
Cheers
Adam
On Jan 14, 8:10 am, "J. Chris Anderson" <jch...@gmail.com> wrote:
> There is some good code in CouchRest::Model, but I don't think it fits
> the core of what CouchRest is about, which is having a technically
> strong CouchDB library thats ready to support other more complex code
> on top of it.
> I plan to spin CouchRest::Model out into it's own project, and then
> encourage people to hack it as crazy as they wanna. I have no idea
> what to call the standalone project. I don't think CouchRest should be
> part of the name, because CouchRest is about being solid, and Model is
> an experiment in making a Rails-like DSL around Couch views.
I was getting the same error and solved the problem, but my notebook
crashed before I push the correction to Github.
The error is on the 'design.rb' file. The 'refresh_design_doc' method
does not assigns a value for the 'database' field and for self['_id']
when the view is already saved.
It's an easy correction, but I don't have access to code now. Hope
that you can see it ;)
Samuel Flores
On 18/01/2009, at 20:05, Adam Groves <adam.gro...@gmail.com> wrote:
> I'm getting a strange error with couchrest-0.12.2:
> Try this out:
> %w(rubygems couchrest).each {|g| require g}
> class Foo < CouchRest::Model
> use_database CouchRest.database!('http://127.0.0.1:5984/my- > database')
> end
> Foo.all
> p Foo.design_doc.database
> Running this code the first time returns an CouchRest::Database
> instance, running it the second time (after the design doc has been
> added) I get:
> NoMethodError: undefined method `view' for nil:NilClass
> from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
> couchrest/core/design.rb:84:in `fetch_view'
> from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
> couchrest/core/design.rb:42:in `view'
> from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
> couchrest/core/model.rb:392:in `fetch_view'
> from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
> couchrest/core/model.rb:383:in `fetch_view_with_docs'
> from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
> couchrest/core/model.rb:346:in `view'
> from /Library/Ruby/Gems/1.8/gems/jchris-couchrest-0.12.2/lib/
> couchrest/core/model.rb:121:in `all'
> from (irb):5
> from :0
> The second time around, saved returns true, saved gets saved (line 363
> in model.rb) but it doesn't seem like the design_doc's database value
> get's updated.
> Cheers
> Adam
> On Jan 14, 8:10 am, "J. Chris Anderson" <jch...@gmail.com> wrote:
>> There is some good code in CouchRest::Model, but I don't think it
>> fits
>> the core of what CouchRest is about, which is having a technically
>> strong CouchDB library thats ready to support other more complex code
>> on top of it.
>> I plan to spin CouchRest::Model out into it's own project, and then
>> encourage people to hack it as crazy as they wanna. I have no idea
>> what to call the standalone project. I don't think CouchRest should
>> be
>> part of the name, because CouchRest is about being solid, and Model
>> is
>> an experiment in making a Rails-like DSL around Couch views.
I switched over from dm-couch-adapter to couchrest about a month ago
for a project of mine and I then added some basic associations and
validations. I've since extracted the 2 libraries and bundled them
together with CouchRest::Model (implemented as a mixin) as CouchSurfer
which can be found here: http://github.com/addywaddy/couchsurfer.
I'd appreciate any comments, feedback etc.
On Jan 14, 8:10 am, "J. Chris Anderson" <jch...@gmail.com> wrote:
> There is some good code in CouchRest::Model, but I don't think it fits
> the core of what CouchRest is about, which is having a technically
> strong CouchDB library thats ready to support other more complex code
> on top of it.
> I plan to spin CouchRest::Model out into it's own project, and then
> encourage people to hack it as crazy as they wanna. I have no idea
> what to call the standalone project. I don't think CouchRest should be
> part of the name, because CouchRest is about being solid, and Model is
> an experiment in making a Rails-like DSL around Couch views.
I've been wracking my brains on how to create literally this exact
thing, but you're obviously way better at this stuff than me... I may
likely start to use and contribute to your code immediately!
I actually just started last week, but if you'd like to see my meager
efforts, take a look here:
http://github.com/zdzolton
Please email me back directly, as I'm interested in learning the
inspirations behind your very concise code.
On Tue, Jan 20, 2009 at 6:12 PM, Adam Groves <adam.gro...@gmail.com> wrote:
> I switched over from dm-couch-adapter to couchrest about a month ago
> for a project of mine and I then added some basic associations and
> validations. I've since extracted the 2 libraries and bundled them
> together with CouchRest::Model (implemented as a mixin) as CouchSurfer
> which can be found here: http://github.com/addywaddy/couchsurfer.
> I'd appreciate any comments, feedback etc.
> On Jan 14, 8:10 am, "J. Chris Anderson" <jch...@gmail.com> wrote:
>> There is some good code in CouchRest::Model, but I don't think it fits
>> the core of what CouchRest is about, which is having a technically
>> strong CouchDB library thats ready to support other more complex code
>> on top of it.
>> I plan to spin CouchRest::Model out into it's own project, and then
>> encourage people to hack it as crazy as they wanna. I have no idea
>> what to call the standalone project. I don't think CouchRest should be
>> part of the name, because CouchRest is about being solid, and Model is
>> an experiment in making a Rails-like DSL around Couch views.