From 5543e8bd6bdc29cfd2e809bdf267b720310af5ec Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Thu, 15 Jul 2010 17:42:41 +0200 Subject: Migrations guide: minor typos corrected --- railties/guides/source/migrations.textile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile index f05c0589b5..16f616a5bc 100644 --- a/railties/guides/source/migrations.textile +++ b/railties/guides/source/migrations.textile @@ -1,6 +1,6 @@ h2. Migrations -Migrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run it. You'd also have to keep track of which changes need to be run against the production machines next time you deploy. +Migrations are a convenient way for you to alter your database in a structured and organized manner. You could edit fragments of SQL by hand but you would then be responsible for telling other developers that they need to go and run them. You'd also have to keep track of which changes need to be run against the production machines next time you deploy. Active Record tracks which migrations have already been run so all you have to do is update your source and run +rake db:migrate+. Active Record will work out which migrations should be run. It will also update your +db/schema.rb+ file to match the structure of your database. @@ -234,7 +234,7 @@ end which creates a +products+ table with a column called +name+ (and as discussed below, an implicit +id+ column). -The object yielded to the block allows you create columns on the table. There are two ways of doing this: The first (traditional) form looks like +The object yielded to the block allows you to create columns on the table. There are two ways of doing this: The first (traditional) form looks like create_table :products do |t| @@ -250,7 +250,7 @@ create_table :products do |t| end -By default +create_table+ will create a primary key called +id+. You can change the name of the primary key with the +:primary_key+ option (don't forget to update the corresponding model) or if you don't want a primary key at all (for example for a HABTM join table) you can pass +:id => false+. If you need to pass database specific options you can place an SQL fragment in the +:options+ option. For example +By default +create_table+ will create a primary key called +id+. You can change the name of the primary key with the +:primary_key+ option (don't forget to update the corresponding model) or if you don't want a primary key at all (for example for a HABTM join table) you can pass +:id => false+. If you need to pass database specific options you can place a SQL fragment in the +:options+ option. For example create_table :products, :options => "ENGINE=BLACKHOLE" do |t| @@ -592,4 +592,5 @@ h3. Changelog "Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/6 +* July 15, 2010: minor typos corrected by "Jaime Iniesta":http://jaimeiniesta.com * September 14, 2008: initial version by "Frederick Cheung":credits.html#fcheung -- cgit v1.2.3 From c09cd192aa118fc8300ac787562a9c23afa93007 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 15 Jul 2010 18:41:29 -0300 Subject: Small fix in cookie docs and trailing whitespaces --- actionpack/lib/action_dispatch/middleware/cookies.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index d69ba39728..4d33cd3b0c 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -45,10 +45,10 @@ module ActionDispatch # * :value - The cookie's value or list of values (as an array). # * :path - The path for which this cookie applies. Defaults to the root # of the application. - # * :domain - The domain for which this cookie applies so you can - # restrict to the domain level. If you use a schema like www.example.com + # * :domain - The domain for which this cookie applies so you can + # restrict to the domain level. If you use a schema like www.example.com # and want to share session with user.example.com set :domain - # to :all. Make sure to specify the :domain option with + # to :all. Make sure to specify the :domain option with # :all again when deleting keys. # # :domain => nil # Does not sets cookie domain. (default) @@ -63,7 +63,7 @@ module ActionDispatch class Cookies HTTP_HEADER = "Set-Cookie".freeze TOKEN_KEY = "action_dispatch.secret_token".freeze - + # Raised when storing more than 4K of session data. class CookieOverflow < StandardError; end @@ -101,7 +101,7 @@ module ActionDispatch def handle_options(options) #:nodoc: options[:path] ||= "/" - + if options[:domain] == :all @host =~ DOMAIN_REGEXP options[:domain] = ".#{$2}.#{$3}" @@ -122,7 +122,7 @@ module ActionDispatch value = super(key.to_s, value) handle_options(options) - + @set_cookies[key] = options @delete_cookies.delete(key) value @@ -151,7 +151,7 @@ module ActionDispatch # This jar allows chaining with the signed jar as well, so you can set permanent, signed cookies. Examples: # # cookies.permanent.signed[:remember_me] = current_user.id - # # => Set-Cookie: discount=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT + # # => Set-Cookie: remember_me=BAhU--848956038e692d7046deab32b7131856ab20e14e; path=/; expires=Sun, 16-Dec-2029 03:24:16 GMT def permanent @permanent ||= PermanentCookieJar.new(self, @secret) end -- cgit v1.2.3 From c9630d9d87ad0b4a0fc732034b6a106777e257ca Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 16 Jul 2010 09:58:01 -0400 Subject: adding proper markup to comment --- activemodel/lib/active_model/serializers/json.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activemodel/lib/active_model/serializers/json.rb b/activemodel/lib/active_model/serializers/json.rb index 918cd0ab76..500b2399a3 100644 --- a/activemodel/lib/active_model/serializers/json.rb +++ b/activemodel/lib/active_model/serializers/json.rb @@ -19,8 +19,8 @@ module ActiveModel # passed through +options+. # # The option ActiveModel::Base.include_root_in_json controls the - # top-level behavior of to_json. It is true by default. When it is true, - # to_json will emit a single root node named after the object's type. For example: + # top-level behavior of to_json. It is true by default. When it is true, + # to_json will emit a single root node named after the object's type. For example: # # konata = User.find(1) # konata.to_json -- cgit v1.2.3