- 22 3月, 2012 6 次提交
-
-
由 Jon Leighton 提交于
Don't use this: scope :red, where(color: 'red') default_scope where(color: 'red') Use this: scope :red, -> { where(color: 'red') } default_scope { where(color: 'red') } The former has numerous issues. It is a common newbie gotcha to do the following: scope :recent, where(published_at: Time.now - 2.weeks) Or a more subtle variant: scope :recent, -> { where(published_at: Time.now - 2.weeks) } scope :recent_red, recent.where(color: 'red') Eager scopes are also very complex to implement within Active Record, and there are still bugs. For example, the following does not do what you expect: scope :remove_conditions, except(:where) where(...).remove_conditions # => still has conditions
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
scope is syntactic sugar for defining a class method. Ruby allows redefining methods but emits a warning when run with -w. So let's not implement our own logic for this. Users should run with -w if they want to be warned about redefined methods.
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Aaron Patterson 提交于
-
- 21 3月, 2012 8 次提交
-
-
由 José Valim 提交于
Remove blank line from generated migration
-
由 José Valim 提交于
Fix adding/removing field's index when generating migration
-
由 Travis Jeffery 提交于
When generating a migration that removes a field with an index, the down will add both the field and its index.
-
由 Marcelo Silveira 提交于
-
由 David Heinemeier Hansson 提交于
We dont need to merge in the parameters as thats all being reset by the rack headers (and its causing problems for Strong Parameters attempt of wrapping request.parameters because it will change in testing)
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
- 20 3月, 2012 7 次提交
-
-
由 Vijay Dev 提交于
-
由 Xavier Noria 提交于
Add missing require
-
由 kennyj 提交于
-
由 José Valim 提交于
Remove exclude option from ActionDispatch::SSL and fix secure cookies
-
由 Rafael Mendonça França 提交于
keyword
-
由 Rafael Mendonça França 提交于
-
由 Andrew White 提交于
Fixes issue #5222: DateTimeSelector builds invalid dates on leap days
-
- 19 3月, 2012 8 次提交
-
-
由 Vijay Dev 提交于
-
由 Sandeep 提交于
-
由 Xavier Noria 提交于
changed all.map to pluck
-
由 José Valim 提交于
Provide access to logger instance within TaggedLogging blocks
-
由 FND 提交于
this improves encapsulation, simplifying occurrences like the following: Rails.logger.tagged("DEBUG") { Rails.logger.debug(msg) } ... by removing the need to rely on (i.e. repeat) outer variables: Rails.logger.tagged("DEBUG") { |logger| logger.debug(msg) }
-
由 Sandeep 提交于
-
由 Jey Balachandran 提交于
Fixes issue #5222: DateTimeSelector builds invalid dates on leap day when discarding both day and month.
-
由 Mikel Lindsaar 提交于
Second security vulnerability found in mail file delivery method patched in version 2.4.4.
-
- 18 3月, 2012 11 次提交
-
-
由 Piotr Sarnacki 提交于
Build fix for app_generator_test.rb
-
由 José Valim 提交于
Autosave association doesn't save all records on a new record for a collection association if there are records marked for destruction
-
由 José Valim 提交于
time_tag support for blocks
-
-
由 Mark Thomson 提交于
-
由 Mark Thomson 提交于
-
由 Jared Armstrong 提交于
Fix bug with autosave collection association on new record with a marked for destroy record in autosave collection.
-
由 Arun Agrawal 提交于
-
由 Aaron Patterson 提交于
Fix GH #5435. db:structure:dump should be re-enable.
-
由 Mark Thomson 提交于
-
由 Mark Thomson 提交于
-