vendor/rails/activerecord/README in radiant-0.6.9 vs vendor/rails/activerecord/README in radiant-0.7.0
- old
+ new
@@ -100,25 +100,18 @@
class PriorityClient < Client; end
{Learn more}[link:classes/ActiveRecord/Base.html]
-* Transaction support on both a database and object level. The latter is implemented
- by using Transaction::Simple[http://railsmanual.com/module/Transaction::Simple]
+* Transactions
- # Just database transaction
+ # Database transaction
Account.transaction do
david.withdrawal(100)
mary.deposit(100)
end
- # Database and object transaction
- Account.transaction(david, mary) do
- david.withdrawal(100)
- mary.deposit(100)
- end
-
{Learn more}[link:classes/ActiveRecord/Transactions/ClassMethods.html]
* Reflections on columns, associations, and aggregations
@@ -169,10 +162,32 @@
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
+* Database agnostic schema management with Migrations
+
+ class AddSystemSettings < ActiveRecord::Migration
+ def self.up
+ create_table :system_settings do |t|
+ t.string :name
+ t.string :label
+ t.text :value
+ t.string :type
+ t.integer :position
+ end
+
+ SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1
+ end
+
+ def self.down
+ drop_table :system_settings
+ end
+ end
+
+ {Learn more}[link:classes/ActiveRecord/Migration.html]
+
== Simple example (1/2): Defining tables and classes (using MySQL)
Data definitions are specified only in the database. Active Record queries the database for
the column names (that then serves to determine which attributes are valid) on regular
object instantiation through the new constructor and relies on the column names in the rows
@@ -272,20 +287,10 @@
Bi-directional associations thanks to the "belongs_to" macro
thirty_seven_signals.firm.nil? # true
-== Examples
-
-Active Record ships with a couple of examples that should give you a good feel for
-operating usage. Be sure to edit the <tt>examples/shared_setup.rb</tt> file for your
-own database before running the examples. Possibly also the table definition SQL in
-the examples themselves.
-
-It's also highly recommended to have a look at the unit tests. Read more in link:files/RUNNING_UNIT_TESTS.html
-
-
== Philosophy
Active Record attempts to provide a coherent wrapper as a solution for the inconvenience that is
object-relational mapping. The prime directive for this mapping has been to minimize
the amount of code needed to build a real-world domain model. This is made possible
@@ -319,11 +324,11 @@
RubyGems[http://rubygems.rubyforge.org/wiki/wiki.pl] installed for that, though. If you have,
then use:
% [sudo] gem install activerecord-1.10.0.gem
-You can also install Active Record the old-fashion way with the following command:
+You can also install Active Record the old-fashioned way with the following command:
% [sudo] ruby install.rb
from its distribution directory.
@@ -340,7 +345,7 @@
Feel free to submit commits or feature requests. If you send a patch,
remember to update the corresponding unit tests. If fact, I prefer
new feature to be submitted in the form of new unit tests.
-For other information, feel free to ask on the ruby-talk mailing list
-(which is mirrored to comp.lang.ruby) or contact mailto:david@loudthinking.com.
+For other information, feel free to ask on the rubyonrails-talk
+(http://groups.google.com/group/rubyonrails-talk) mailing list.