Comments (9)
Hi,
First, a couple of tips. In your models you can do:
class UserInterest < MassiveRecord::ORM::Table
# default_id is called if id is nil when you try to read an id (for instance when saved if called)
def default_id
# next_id() goes via the IdFactory to figure out the
# next id for the class. You can ofc do whatever you want here :-)
next_id
end
end
This will result in next id for your class, just like you do above.
Have you tried user.interests.reload
to see if it returns something? As far as I can see you are using it correctly, so maybe there is a bug here too.
from massive_record.
I read in your issues that there was a method like next_id(), but I
couldn't find it, thanks for the tip! I'll give reload a try, I'll let
you know what happens
from massive_record.
no luck with user.interests.reload :( still returns an empty array
ruby-1.9.2-p180 :001 > u = HbaseUser.first
=> #<HbaseUser id: "10", profile_id: "10", interest_ids: [33, 34, 35, 36, 37], button_ids: [], first_name: "Test", last_name: "User", email: "[email protected]", password: nil, updated_at: "2011-05-25 22:42:46 -0400">
ruby-1.9.2-p180 :002 > u.interests
=> []
ruby-1.9.2-p180 :003 > u.interests.reload
=> []
from massive_record.
Oki, I'll see if I have the time this weekend to test it myself with a simple Rails application or something :-)
from massive_record.
awesome thanks, I'll wait for your findings :) If you don't mind sharing
the code for the sample app, it would be a big help to me :)
from massive_record.
Hi again!
I have set up a test / example application here https://github.com/thhermansen/massive_record_test_app where I did test references many. Seems to me that it's working fine. You can take a look at it to see if you spot something different from what you do.
The test application contains some comments to the examples, plus some very basic rspec tests which are all passing. Hope it helps - please tell me how it goes :-)
from massive_record.
I went through the sample app, and tried out the different ways to use references_many, and nothing was working until i decided to use the develop branch instead of the gem. Once I did that, everything started working properly. So somewhere in between the last gem release and the current develop branch, references_many wasn't working :p
Thanks for the sample app, it would be great if you could keep updating it in your free time to show off massive_record's features.
BTW, (and this should probably be a separate post) I don't suppose you have gotten devise to play nicely with massive_record? And in case you are interested, I modified a paperclip module for mongodb to work with massive_record (https://github.com/jamiltao/massive-record-paperclip)
from massive_record.
I have gotten devise to work. It was a bit hackish, but I can put up the code for it in the example app :-) Guess its time to write some wiki pages as well soon hehe. Good to see you have implemented paperclip support. I have used Carrierwave for attachments in Companybook's project.
from massive_record.
For a how-to on Devise, see: https://github.com/CompanyBook/massive_record/wiki/MassiveRecord-and-Devise. I hope that I wrote something which are possible to understand :-p
from massive_record.
Related Issues (20)
- Supporting date/time form helpers
- embedded.destroy should also remove itself from parent collection?
- Error when using embeds_many.destroy_all
- Extend proxies with module / give it a block with logic to include
- Not detecting changes in new records
- Have been reported some issues with callbacks on embedded records HOT 2
- Returning false in ex. before_save does not short circuit save if saved through parent
- Nedsted attributes
- Limit scan to a specified timeStamp
- Query HOT 6
- Hard Dependency On Older Version of ActiveSupport in 0.2.2.rc1 & 0.2.2.rc2 HOT 4
- Inheritance and table_name HOT 3
- `IOError: closed stream` after sending an invalid query HOT 4
- What type to use for binary fields? HOT 1
- Memory leak with find operation
- Rails 3.2.2 Deprecation Warnings HOT 1
- Is this correct code? HOT 1
- Is still mantained? HOT 2
- What's the correct way to create/migrate hbase tables using this gem? HOT 4
- Dead Links in wiki HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from massive_record.