Q:Is it possible to have multi level eager loading in sequelize? ie workflow has many nodes and node has many assignees. I want to retrieve everything in 1 request: worflow, nodes collection and for every node, assignees collection. Thanks.
Nested eager loading is currently not supported but will be implemented soon. You can take a look about the progress here: https://github.com/sequelize/sequelize/issues/388
eurucamp 2013 - A recap. [Part I]
Some weeks a go some colleagues of mine and me were attending the eurucamp 2013 at the lovely Müggelsee in Berlin. Besides the nice location, the European Ruby Camp did not only provide tasty coffee but also a whole bunch of interesting talks and workshops. This article will summarize the most interesting parts.
Workshop: Up & Running with Ember.js
The first course I’ve attended has been the Ember.js workshop. Also this has been the first contact with the eurucamp wifi …
To be polite: It wasn’t super optimal ;-) So while listening to the speaker (Balint Erdi) I spent about 2 hours downloading Rails 4 :-/ In the end it turned out, that using my mobile phone’s hotspot was a better option.
As it was quite hard to actually follow Balint’s workshop without running the code he was explaining, I will just reference his notes of the talk.
Workshop: Native iOS development using RubyMotion
The second workshop was about RubyMotion. First, Marin Usalj provided a temporary RubyMotion executable for every attendee. That way it was a pleasure to participate in the workshop, without getting into any hassles related to downloads. Once everyone installed the package, Marin create a first simple application:
motion create test Create test Create test/.gitignore Create test/Rakefile Create test/app Create test/app/app_delegate.rb Create test/resources Create test/resources/Defaultemail@example.com Create test/spec Create test/spec/main_spec.rb
Its now possible to launch that application just by firing this:
cd test rake
This will basically compile the RubyMotion application and open it in the simulator. You should see an iPhone with a black screen now.
We went on by adding a root controller, which gets loaded in the application’s main entry point: The file
# app/app_delegate.rb class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) @window.rootViewController = RootViewController.new @window.makeKeyAndVisible true end end
# app/controllers/root_controller.rb class RootViewController < UIViewController def loadView self.view = UIView.alloc.initWithFrame(UIScreen.mainScreen.bounds) self.view.backgroundColor = UIColor.whiteColor add_buttons end def add_buttons # button = UIButton.alloc.initWithFrame([[100, 100], [200, 40]])) button = UIButton.alloc.initWithFrame(CGRectMake(100, 100, 200, 40)) button.setBackgroundColor UIColor.grayColor button.setTitle "press me!", forState: UIControlStateNormal self.view.addSubview(button) end end
Once saved and ran (via
rake), this code spawned the most impressive and most beautiful application of all time … Feel free to take a look at the following git repository to get in touch with more advanced examples :)
Wii U: Some impressions
When I left the office on last friday evening, I was looking forward to unpacking the just arrived Wii U. On my way home it already bugged me, that I didn’t manage to order an external hard drive for the tons of games I’m going to download soon via the built-in eShop. So I arrived at home and setup the cables for the Wii U. I nicely connected everything with each other, started the console and … waited the next hour for an update of the next-generation Wii. Not super cool, but hey it was an update. Updates are good. So I waited for the progress bar to fill up.
Q:Hi Sascha, thanks for Sequelize. I've been really getting into it and was wondering whether you already added elegant helper methods to load multiple associations to Sequelize? I'm going to need to write a lot of code like this StackOverflow question "Sequelize, problem getting associations to return". And I'd prefer to use the "right" way from the get-go. Again thanks for this project! Peter
I just released sequelize v1.6.2-alpha-2. there are some reports but about issues but at least the usual find and findAll is working properly. It’s not documneted yet, but you can check the respective tests: https://github.com/sdepold/sequelize/blob/master/spec/dao-factory.spec.js#L384 and https://github.com/sdepold/sequelize/blob/master/spec/dao-factory.spec.js#L554
Cubi - details about my entry
It’s been a long time since my last post… However, I haven’t been lazy, but worked on multiple things over the last few month. The funniest project in the last weeks/months was my entry for js13kgames called Cubi. In this post I want to present the game and some nice tweaks I added for achieving the right file size.
Cubi - My entry for js13kgames
Today I submitted my entry for the coding competition js13kgames! Would be pretty cool to win that Impact game engine :) Cubi is a classic tower defense game, which comes with 13 types of monsters and 3 types of towers. You can give it a try here :) I will write a summary about some tweaks I added later.
Ever wanted to find cats in pictures? No? Fair enough ;D However, …, you might want to give this a try.
Q:In order to may Sequelize scalable, I wondered whether it would be a good idead to (optionally) provide two sets of MySQL connection credentials; one for read-only operations, and the other for write operations. The Sequelize can send its SELECT statements to the read-only connection and write operations to the read-write connection. This would allow applications with lots of read operations to scale out using MySQL slaves. What do you think?
good idea :) can you open a ticket on github?
Q:Hi, in Sequelize JS is it possible to refer to a model twice from another model? For example, if in Project I would like one User reference for the Manager, and another for the Lead Developer. How would I do that in Sequelize?
Q:Hi, I'm using the Dawanda jQuery RSS code to aggregate an RSS feed to a news website I'm building, and it runs great so long as I only run a single instance of the plugin. However, I'd like to run it twice, once for the story headline and once for the body content. This doesn't seem to work, since each new version of the code I link to overwrites the original version. Any suggestions? I'd appreciate it :)
Hmm that should actually work … Mhh can you please open an issue on github and add a link to page where this problem can be replayed? Thanks a lot :)