Displaying 3 results from an estimated 3 matches for "some_association".
2013 May 20
0
db connection returns stale values
...em for the
''stale'' connection.
controller:
def update
#@default_model.update_attributes(params[@model_name])
@default_model.assign_attributes(params[@model_name])
Graph::Helper.save(@default_model) #custom save() for legacy version
control
debugger
@default_model.some_association.updated_field #still shows pre-update
value
@default_model.reload
@default_model.some_association.updated_field #still shows pre-update
value
@default_model.find(id).some_association.updated_field #still shows
pre-update value
ActiveRecord::Base.establish_connection(:oracledb); #T...
2008 May 12
3
Enumeration sum
Any idees why I can do this:
@sum = @selected.inject(0) { |sum, player| sum + player.value }
but not this:
@sum = @selected.sum { |player| player.value }
@sum = @selected.sum(&:value)
The last two give me following error:
wrong number of arguments (1 for 2)
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/associations/association_collection.rb:164:in
`calculate''
2011 Sep 05
8
In Rails 3.1 Model.count() ignores :include - no outer join in generated SQL
Hello!
Just upgraded to Rails 3.1, ran my test and found this issue:
class Trade < ActiveRecord::Base
has_many :transaction_trades
.....
def Trade.do_something
stale_trades = Trade.count(''transaction_trades.id'',
:include => :transaction_trades,
:group => ''trades.id'')