Displaying 4 results from an estimated 4 matches for "wamr".
Did you mean:
samr
2013 Feb 25
3
ActiveRecord associations: design question
Hi guys,
In my Rails app, I have three models: A, B and C, with the following
relationships:
- B hasMany C
- C belongsTo B
I would like A to "has_one" instance of B+C. By that I mean A needs to
be linked to a specific instance of B AND a specific instance of C.
My first guess would be to create a fourth object, say B_plus_C that
would:
- belongs to B
- belongs to C
- belongs to A
Is
2009 Oct 04
3
Problem using ActiveRecord find with :joins and :select
Hi guys,
When I do:
temp = User.find(:all,
:joins => "INNER JOIN contents ON users.agent_id =
contents.id",
:select => "contents.id, users.id, users.u_date")
temp.first.inspect
It seems to work fine, but it only returns:
#<User id: 6, u_date: "2009-10-03 19:32:23">
but not the contents.id information.
I
2012 Apr 02
10
Pessimistic locking locks the entire table?
Hi guys,
I must be missing something obvious with pessimistic locking. Here is
what I do (Rails 2.3, mySQL):
In my Foo model:
def test
Foo.transaction do
lock = UpdateLockForFoo.find_by_foo_id(self.id, :lock => true)
sleep 30
end
end
For each Foo model, I have an UpdateLockForFoo. This "lock" needs to
be acquired before doing any changes to Foo.
I believe it works,
2013 Jan 03
6
How to avoid simple race conditions with Session?
Here is the situation:
- the client makes a request
- it is followed by AJAX polling
The server needs to keep track of some stuff during this process.
I have been using the Session and it "mostly" works… until the user
decides to open another tab in her browser and she makes a new,
parallel request. In this case, the data from the two requests is
merged, which leads to bugs.
This got