[Kde-bindings] KDE/kdebindings/ruby/qtruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Tue Apr 7 13:20:19 UTC 2009
SVN commit 950572 by rdale:
* The ActiveRecord based model classes were setting changed values in the
'attributes' and then saving the changed instance, like this
foo.attributes['my_att'] = value
foo.save
However, this no longer works with ActiveRecord, and the instance can
be changed more directly like this
foo['my_att'] = value
foo.save
CCMAIL: kde-bindings at kde.org
M +13 -0 ChangeLog
M +4 -3 rails_support/active_item_model.rb
M +1 -1 rails_support/active_table_model.rb
--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #950571:950572
@@ -1,3 +1,16 @@
+2009-04-07 Richard Dale <richard.j.dale at gmail.com>
+ * The ActiveRecord based model classes were setting changed values in the
+ 'attributes' and then saving the changed instance, like this
+
+ foo.attributes['my_att'] = value
+ foo.save
+
+ However, this no longer works with ActiveRecord, and the instance can
+ be changed more directly like this
+
+ foo['my_att'] = value
+ foo.save
+
2009-03-24 Richard Dale <richard.j.dale at gmail.com>
* Raised the QtRuby version to 2.0.3 for the RubyForge release
--- trunk/KDE/kdebindings/ruby/qtruby/rails_support/active_item_model.rb #950571:950572
@@ -1,8 +1,9 @@
=begin
-This table model allows an ActiveRecord or ActiveResource to be used as a
-basis for a Qt::AbstractItemModel for viewing in a Qt::TreeView. Example
-usage:
+This Qt::AbstractItemModel based model allows an ActiveRecord or ActiveResource
+data set be used for viewing in a Qt::TreeView.
+Example usage:
+
app = Qt::Application.new(ARGV)
agencies = TravelAgency.find(:all)
model = ActiveItemModel.new(agencies)
--- trunk/KDE/kdebindings/ruby/qtruby/rails_support/active_table_model.rb #950571:950572
@@ -109,7 +109,7 @@
value = Time.new(value.hour, value.min, value.sec)
end
- eval("item.attributes['%s'] = value" % att.gsub(/\./, "'].attributes['"))
+ eval("item['%s'] = value" % att.gsub(/\./, "']['"))
item.save
emit dataChanged(index, index)
return true
More information about the Kde-bindings
mailing list