Commit Graph

25830 Commits

Author SHA1 Message Date
José Valim a02bb72cf7 Merge pull request #3537 from dvyjones/refactor-pluralize-singularize
Refactored pluralize and singularize into a common method
2011-11-06 02:20:06 -08:00
Henrik Hodne 52fa34faee Refactored pluralize and singularize into a common method.
See diff discussion on rails/#3536.
2011-11-06 11:13:51 +01:00
Jon Leighton 62512b9fb9 Merge pull request #3535 from jmazzi/master
Update ActiveRecord#attribute_present? to work as documented
2011-11-06 01:27:29 -08:00
Justin Mazzi c7d2078596 Update ActiveRecord#attribute_present? to work as documented
"Returns true if the specified attribute has been set by the user or by
a database load and is neither nil nor empty?"

Fixes #1613
2011-11-05 22:36:19 -04:00
Xavier Noria e7b7b44123 implements AR::Relation#explain
This is a first implementation, EXPLAIN is highly
dependent on the database and I have made some
compromises.

On one hand, the method allows you to run the most
common EXPLAIN and that's it. If you want EXPLAIN
ANALYZE in PostgreSQL you need to do it by hand.

On the other hand, I've tried to construct a string
as close as possible to the ones built by the
respective shells. The rationale is that IMO the
user should feel at home with the output and
recognize it at first sight. Per database.

I don't know whether this implementation is going
to work well. Let's see whether people like it.
2011-11-05 18:30:19 -07:00
Xavier Noria 89d7372dac Merge pull request #3534 from guilleiguaran/arel-git-gemfile
Add arel to Gemfile on apps generated in edge Rails
2011-11-05 17:28:52 -07:00
Guillermo Iguaran 44e751fdd4 Add arel to Gemfile on apps generated in edge Rails 2011-11-05 19:26:23 -05:00
Xavier Noria 4d9f779b54 bumps up sprockets 2011-11-05 15:33:36 -07:00
Xavier Noria 56f16e25e9 fixes typo 2011-11-05 12:09:18 -07:00
Xavier Noria d287e90870 implements AS::Notifications.subscribed, which provides subscriptions to events while a block runs 2011-11-05 12:02:54 -07:00
Xavier Noria b33232f1b2 expands the documentation of AS::Notifications 2011-11-05 10:29:41 -07:00
Jon Leighton f575e21025 Merge pull request #3525 from kennyj/fix_3440-1
Fixed an issue id false option is ignored on mysql/mysql2 (fix #3440)
2011-11-05 10:29:18 -07:00
Jon Leighton f140445b1d Revert "Merge pull request #2378 from cesario/remove_warnings_activemodel"
This reverts commit 6aaae3de27, reversing
changes made to fdbc4e5f4e.

Reason: build failure.
2011-11-05 17:21:58 +00:00
kennyj fb0bf3c984 Fixed an issue id false option is ignored on mysql/mysql2 (fix #3440) 2011-11-06 02:15:47 +09:00
Vijay Dev 55621504b0 make class name consistent with the filename 2011-11-05 22:31:39 +05:30
Jon Leighton 10773f94ea Skip test_default_external_works on the CI for Ruby 1.9.3.
This test is affected by a bug in Ruby 1.9.3p0 and trunk:
http://redmine.ruby-lang.org/issues/5564

Given we cannot fix it for ourselves, it is better to skip for now so
that we will easily see if further failures are introduced.

Jon Leighton is monitoring the bug report and will revert this when a
suitable solution is found (either a new Ruby release or a generic
workaround).

If you are using 1.9.3 in your app and have templates that are not in
UTF-8, you should add a workaround early on in the boot process. For
example, if your templates are Shift_JIS encoded, then add the
following in an initializer:

Encoding::Converter.new('Shift_JIS', 'UTF-8')
2011-11-05 16:42:53 +00:00
Jon Leighton 9a111c7cf9 Use uniq instead of manually putting a DISTINCT in the query 2011-11-05 16:22:18 +00:00
Jon Leighton 562583c766 Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query 2011-11-05 16:22:18 +00:00
Vijay Dev 6aaae3de27 Merge pull request #2378 from cesario/remove_warnings_activemodel
Remove warnings by calling remove_method
2011-11-05 08:44:16 -07:00
Vijay Dev fdbc4e5f4e Merge branch 'master' of github.com:lifo/docrails 2011-11-05 20:45:11 +05:30
Vijay Dev 09298e4257 Revert "outline two ways to invoke a custom active model validator"
This reverts commit d163d3bf7e.

Reason: The alternate approach can be documented in the guide and
not disrupt the existing flow in the readme.
2011-11-05 20:43:04 +05:30
Vijay Dev 53f61acdca Revert "make the inline text a comment in the code block"
This reverts commit 36a5f48f93.

Reason: Editing .gitignore in docrails is not allowed. Docrails is meant
only for documentation.
2011-11-05 20:38:07 +05:30
Jon Leighton 2751e213d8 Merge pull request #3529 from vjebelev/ar_ordered_indexes2
AR changes to support creating ordered (asc, desc) indexes
2011-11-05 08:03:19 -07:00
Florian Walch bcd25e7576 Fixed after_initialize/after_find guide
Defining after_initialize and after_find as ordinary methods like documented
in the guide doesn't work with Rails 3.1.1; now macro-style is used here, too.
2011-11-05 13:34:01 +01:00
Vlad Jebelev 69dcd45aea AR changes to support creating ordered (asc, desc) indexes 2011-11-04 15:45:24 -05:00
Vijay Dev cb06727b6c add tests for the case where size is explicitly passed to number_field helper 2011-11-04 22:32:40 +05:30
Jon Leighton 76dedf0232 Merge pull request #3517 from arunagw/test_fix_activerecord
Fix test as one more has_many added
2011-11-04 07:04:43 -07:00
Arun Agrawal 6da558660c Fix test as one more has_many added 2011-11-04 19:30:59 +05:30
Jon Leighton 0fcf8bfbe9 Merge pull request #3516 from cesario/fix_gemspec
Synchronize the gemspecs since CHANGELOG has been renamed to CHANGELOG.md
2011-11-04 06:54:32 -07:00
Franck Verrot 1679aa56f3 Synchronize the gemspecs since CHANGELOG has been renamed to CHANGELOG.md 2011-11-04 14:46:39 +01:00
Jon Leighton 281272ad36 Convert CHANGELOGs to Markdown format.
Reasons:

 * Markdown reads well as plain text, but can also be formatted.
 * It will make it easier for people to read on the web as Github
   formats the Markdown nicely.
 * It will encourage a level of consistency when people are writing
   CHANGELOG entries.

The script used to perform the conversion is at
https://gist.github.com/1339263
2011-11-04 12:55:17 +00:00
Jon Leighton e6cc2ea201 Allow the :class_name option for associations to take a symbol.
This is to avoid confusing newbies, and to be consistent with the fact
that other options like :foreign_key already allow a symbol or a string.
2011-11-04 11:17:56 +00:00
José Valim 2c67845271 Merge pull request #3514 from waseem/remove_size_attribute_from_number_field
Remove 'size' attribute from number_field form helper fixes #3454
2011-11-04 03:31:39 -07:00
Aaron Patterson 0e407a9041 Merge pull request #1163 from amatsuda/sexier_migration_31
Sexier migrations
2011-11-04 03:29:59 -07:00
Karthik Muthupalaniappan 36a5f48f93 make the inline text a comment in the code block 2011-11-04 15:22:50 +05:30
Karthik Muthupalaniappan d163d3bf7e outline two ways to invoke a custom active model validator 2011-11-04 15:18:37 +05:30
Waseem Ahmad 56207a3f01 Remove 'size' attribute from number_field form helper fixes #3454
f.number_field generates <input type="number", size="30"../> which is
invalid HTML5. See: http://dev.w3.org/html5/spec/Overview.html#number-state
2011-11-04 15:03:02 +05:30
Jeremy Kemper 533a9f84b0 Merge pull request #3507 from jmazzi/issue-3503
Preserve SELECT columns on the COUNT for finder_sql when possible
2011-11-03 21:17:15 -07:00
Henrik Hodne 8611f14caf Added bundle exec to rake test.
This is in response to rails/rails#3504.
2011-11-03 22:19:49 +01:00
Jon Leighton b5f908a7ad Stub find_template so that when handle_render_error is called in ActionView::Template, we get to see the actual underlying error rather than a NoMethodError.
This shows an encoding bug on Ruby 1.9.3.
2011-11-03 19:08:09 +00:00
Jon Leighton d486103570 Fix #3271.
Building the conditions of a nested through association could
potentially modify the conditions of the through and/or source
association.

This is a Bad Thing.
2011-11-03 15:12:08 +00:00
Jon Leighton 567d454d99 Memoize through association 2011-11-03 13:24:39 +00:00
Jon Leighton 19b2a5f2bd Remove all revelant through records.
If a record is removed from a has_many :through, all of the join records
relating to that record should also be removed from the through
association's target.

(Previously the records were removed in the database, but only one was
removed from the in-memory target array.)
2011-11-03 13:13:13 +00:00
Jon Leighton 71bc921ec8 Fix adding multiple instances of the same record to a has_many :through.
Fixes #3425.
2011-11-03 12:39:05 +00:00
Jon Leighton b4b178f7e9 Fix #3247.
Fixes creating records in a through association with a polymorphic source
type.
2011-11-03 10:23:42 +00:00
Alexey Vakhov a8468731f7 Fix javascript_include_tag examples in documentation 2011-11-03 09:02:11 +04:00
Alexey Vakhov 7463317115 Fix small typos in routing docs 2011-11-03 08:43:28 +04:00
Vijay Dev bc09a11a66 minor edit 2011-11-02 23:34:27 +05:30
Vijay Dev b3c1cfa277 minor edits in AR validations guide 2011-11-02 23:01:30 +05:30
José Valim 982a0f37f5 Merge pull request #3494 from sinisterchipmunk/usage-erb
treat USAGE as an ERB template
2011-11-02 06:41:46 -07:00