Displaying 20 results from an estimated 2000 matches similar to: "when use mongoid , Model.count can't work."
2011 Nov 09
3
Mongo adapter
I have setup mongo database and want to know which one would be best
adapter ( mongo_mapper , mongoid, dm-mongo-adapter ) in terms of
Associations, include option for eager-loading .
--
Regards
Mukesh Paras Singh
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2012 Jan 22
3
Using Mongoid with ActiveRecord
I''m trying to use mongodb and postgresql simultaneously with Rails
3.1. I believe I have everything set up correctly.
What I''m interested in knowing is how to get rails to flip-flop back-
and-forth between mongoid and activerecord.
For example, if I want to generate an ActiveRecord model after using
mongoid, rails automatically defaults to the Mongoid gem.
> rails g model
2013 Oct 23
2
how is mongoid syntax implemented ?
In mongoid, a ORM mapped database object is like below. The part "type:
String" seems to me to not fit into any standard ruby syntax and I was
curious how does mongoid implement that ?
class Step
include Mongoid::Document
field :Label, type: String
field :Descript, type: String
field :ErrorText, type: String
embedded_in :step_data
end
--
You received this message
2014 Mar 10
0
Mongoid : bson namespace error
Hello All,
I had been trying to work on Rails 4 and Mongoid gem.
The following are the versions I had installed:
bson-2.2.1
mongoid-3.1.6
After installing and trying to run "rails generate" command. It is failing
with NameSpace error for BSON::ByteBuffer.
It is trying to connect to mongodb server initially and getting successful.
Post that it is failing with the following
2011 Aug 05
5
Best Mongo Framework to work with Rails
Hi all,
Wanted to hear your opinions about the currently best option for mongo
with Rails.
Thank you all in advance,
Vasco Andrade e Silva
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 May 04
5
rails mongoid
I have a strange problem. Suppose I have a user model with only name
field.
I can add a field with value by creating an instance in mongodb rails
environment.
Example:
class User
include Mongoid::Document
field :name
end
Now in rails console, If you do
user = User.new
user[:name] = "xxxx"
user[:firstname] = "yyyy"
user.save
The record gets created with name and
2011 Jun 09
2
nginx + passenger + mongoid
When I set the rails_env to production in nginx.conf I get:
Error message:
db_name must be a string or symbol
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2010 Sep 23
0
rspec problems mocking classes based on mongoid
I am getting errors when running my rspecs.
My project uses rails 3, mongoid, factory_girl, rspec 2.0.0.beta.22,
rspec-mocs, etc
http://pastebin.com/raw.php?i=WkaGiFag
Getting: Failure/Error: @product = assign(:product,
stub_model(Product, undefined method `to_sym'' for nil:NilClass
I''m pretty sure stub_model has no clue on how to handle objects based
on mongoid.
Any ideas?
2011 May 08
0
Mongoid rails 3
Hi,
I am using mongoid, rails, mongohq.
I have to tables Category and SubCategory
Category references_many :subcategories
SubCategory referenced_in :category
Now I have a form in view. In view, when user chooses a category, an
ajax request is made to get dependent subcategories. But problem is, it
is returning empty array in response(this is using mongohq). It is
working normally as expected
2011 May 14
1
RSpec stub question
Hi
I am using Mongoid. In Mongoid while saving a record we typically give
like in the controller
@post.safely.save
For a model class Post
I am writing rspecs for my controller and want to mock the model. So
what I am doing is
let(:post) { mock_model(Post).as_null_object }
before(:each) do
Post.stub(:new).and_return(post)
end
it "creates new post"
2012 Jun 14
1
Cucumber/RSpec ::: Capybara? Webrat What am I using??
Hey everybody
I''m currently reading through the Pragmatic Programmers RSpec book, and
I really enjoy it.
But I’m facing some problems because of the fact that the book is
already some years old, I guess. I have installed rvm and use Ruby
1.9.3, and I didn’t really get some Rails code examples to work
properly, so I tried it with a 1.8.7 installation, but there I had some
other problems
2011 Mar 02
6
calbacks on models
Hi, I''m having some strange behavior on callbacks when testing with
RSpec2. On my test, when I create a resource using the #create method
the callbacks related to #before_create are not called. If I go to the
console and I try to type the command Resource.create(client_uri:
"http://example.com") all works fine.
There are no mocks around, and I can''t understand if this
2011 Dec 06
1
mongodb topic in rails
Hi
I use mongoid for rails application
and I try to do
@users = User.where("first_name = ? OR last_name = ? OR type = ?",
firstname, lastname, usertype)
but I am getting error
but when i put:
@users = User.where(:first_name => firstname, :last_name => lastname,
:type => usertype).all
the program run successfully
but i need OR to execute in mongodb
Also I need sql LIKE to
2010 May 27
4
[PATCH] Rails 3: fields_for helper doesn't work with association proxy objects
Request for eyeballs. :-)
Mongoid uses association proxy objects. It overrides #nil? => false
when the association is missing. However since it uses proxy
objects, !!assocation is always true.
I have created a ticket with a patch that changes the association nil
test to call assocation.nil? rather than use implicit coercion of the
variable.
See:
2011 Nov 09
0
beginner question: how do I figure out why an app won't start? (RubyMine)
I''m building a new Ruby app with RubyMine. I built a basic app (just a
homepage) and it is running fine. Next step is to get the app talking
to MongoDb. I''m using this tutorial:
http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started
also tried this one: https://github.com/RailsApps/rails3-mongoid-devise
The problem is, after running through the tutorial and starting my
2011 Mar 16
19
Uninitialized constant Files::Magick -still around
Hi there,
I''m solving the problem about the plugin Magick. In my app in Gemfile
I''ve follwoing:
require ''rubygems''
require ''mongo''
require ''RMagick''
include Magick
and in a model Files:
class Files
def self.save(upload)
...
img = Magick::Image.read(''public/data/nature6.jpg'').first
end
end
2011 Jul 05
4
Problem of "rake spec"
Hi all,
I am a bit confused when i type rake spec and it gives me this
message,
No examples matching ./spec/**/*_spec.rb could be found
what is that mean that something is not found.
and where i can input my the test code because i did have a tiny
sample code in user_controller_test.rb.
is that the right place to test functional..
plz give me a help
thanks
--
You received this message
2012 Dec 05
3
Fwd: Issue starting unicorn with non-ActiveRecord Rails app
Hi,
I''m trying to use unicorn in a test deployment of a Rails app that
uses Mongoid, so Activerecord isn''t included in the app. When I start
unicorn through Capistrano though, the stderr log fills up endlessly
with identical ActiveRecord-related errors:
I, [2012-12-05T04:19:25.375952 #5096] INFO -- : Refreshing Gem list
I, [2012-12-05T04:19:32.941249 #5096] INFO -- :
2010 Dec 17
1
flash[;notice] not display after redirection
I read all previous posts about the same subject in Devise group but
couldn''t find any answer, so iy may not be related to Devise , so
I debugged it ..
.
class Users::RegistrationsController <
Devise::RegistrationsController
..
# POST /resource/sign_up
def create
build_resource
if resource.save
if resource.active?
set_flash_message :notice, :signed_up
2012 Jun 12
2
how to connect rails app using monodb
hi all
i ve installed monodb this is the first time ive installed it and don''t
have any idea how to use it. previously ive used MYSQL for my apps. now i
want to use monodb . can any one help me out how to use monodb . does it
have any interface just as MYSQL. as there is no yml file needed how do i
connect my app
thanks in advance
--
You received this message because you