Commit Graph

37060 Commits

Author SHA1 Message Date
Carlos Antonio da Silva 1d95c566fb Merge pull request #10118 from vipulnsward/remove_unused_var_task
remove unused variables
2013-04-06 03:53:23 -07:00
Vipul A M 74d09060a3 remove unused variables 2013-04-06 13:20:50 +05:30
Dan Erikson f31fdce7a5 Improve some variable naming for the integration test in the testing guide. [ci skip] 2013-04-06 00:06:56 -06:00
Dan Erikson 018cc389d1 Corrected model test directory to be test/models instead of test/unit. 2013-04-06 00:01:48 -06:00
Aaron Patterson dfdc1e31a2 `fast_xs` support has been removed. Use 'String#encode(xml: :attr)`. 2013-04-05 22:31:17 -07:00
Carson McDonald b75c0bb378 Typo fix 2013-04-05 23:15:04 -04:00
Jonathan Roes 25ea7e96f3 Grammar 2013-04-05 21:18:07 -03:00
Aaron Patterson ea3a190137 updating the guide 2013-04-05 17:13:58 -07:00
Aaron Patterson cc0c392c77 add integration test for shorthand rake tests 2013-04-05 17:12:23 -07:00
Aaron Patterson 2e0e5bb1e4 rake test app/model/foo.rb and rake test models/foo works 2013-04-05 17:06:36 -07:00
Aaron Patterson 88cf64a669 extract test info from the command line and set up the test task 2013-04-05 16:38:37 -07:00
Aaron Patterson 7f698da887 add a class for splitting up rake commands 2013-04-05 16:31:19 -07:00
Aaron Patterson 32eff659bc just use ruby to run tests 2013-04-05 15:46:41 -07:00
Aaron Patterson c7a148f389 removing `rails test`, updating docs to show how to use `rake test` 2013-04-05 15:44:41 -07:00
Carlos Antonio da Silva 3844bb5ef8 Merge pull request #10111 from Agis-/patch-1
Remove extra whitespace
2013-04-05 15:15:41 -07:00
Prem Sichanugrist ba602254f7 Update Rake tasks to call `rails test` instead
Also, print out deprecation warning for other rake tasks except
`rake test` and `rake` (default)

Conflicts:
	railties/lib/rails/test_unit/testing.rake
	railties/test/application/rake_test.rb
2013-04-05 15:12:12 -07:00
Agis Anastasopoulos 3adb01ed76 Remove extra whitespace 2013-04-06 00:54:44 +03:00
Aaron Patterson 91efe3958a Merge branch 'railstest'
* railstest:
  do not blow away the test database on every run
  just check pending migrations in the current environment
  check pending migrations against the test db
  only match the default task
  test no longer makes sense after requiring all test files
  switch the testing tests to use rake
  a test file can be provided to rake, e.g.:
  switch to Rails::TestTask
  default task should also be in the test env
  ensure the schema checking is done in the dev connection
  Revert "Update Rake tasks to call `rails test` instead"
  Revert "Warning removed unused variable task_name"
  apps that depend on active record should load fixtures
2013-04-05 14:49:06 -07:00
Aaron Patterson 01034d3be0 Merge branch 'master' into railstest
* master: (44 commits)
  Improve the changelog entry [ci skip]
  Fix explicit names on multiple file fields
  Correctly parse bigint defaults in PostgreSQL
  Move changelog to the top [ci skip]
  Fix indent and remove extra white spaces
  Fix scope chaining + STI
  failing test for #9869
  Improve `belongs_to touch: true` timestamp test
  Sort modules in alphabetical order.
  Avoid an attempt to fetch old record when id was not present in touch callback
  Use the correct pk field from the reflected class to find the old record
  Refactor mail_to to not generate intermediate hashes when adding href
  Ensure mail_to helper does not modify the given html options hash
  Use inspect when writing the foreign key from the reflection
  Use a space after the comment sign when showing the result of commands
  Exclude template files for rdoc API [ci skip]
  template should have generic name
  use | to have more intent revealing code
  Revert "Merge pull request #10034 from benofsky/fix_skipping_object_callback_filters"
  stop depending on callbacks
  ...

Conflicts:
	railties/test/application/rake_test.rb
2013-04-05 14:48:49 -07:00
Aaron Patterson c037659294 do not blow away the test database on every run 2013-04-05 14:22:29 -07:00
Carlos Antonio da Silva 2ac97df552 Merge pull request #10110 from choudhuryanupam/master
Removed space and unused class
2013-04-05 14:18:24 -07:00
Anupam Choudhury 8ed04e90d2 Removed space and unused class 2013-04-06 02:35:15 +05:30
Rafael Mendonça França 3d7fd9bfe8 Merge pull request #10108 from choudhuryanupam/master
Removed unnecessary class
2013-04-05 13:59:27 -07:00
Rafael Mendonça França 08926bd06c Merge pull request #9555 from tmm1/optimize-erb
Optimize generated ERB to reduce method calls
2013-04-05 13:56:29 -07:00
Aaron Patterson 056030886c just check pending migrations in the current environment 2013-04-05 13:56:25 -07:00
Anupam Choudhury 220887eeab Removed unnecessary class 2013-04-06 02:17:38 +05:30
Rafael Mendonça França 096ee1594d Improve the changelog entry [ci skip] 2013-04-05 16:43:04 -03:00
Rafael Mendonça França 3d961abf53 Merge pull request #10106 from rmm5t/fix-explicit-name-on-multiple-fields-master
Fix explicit names on multiple file fields
2013-04-05 12:37:11 -07:00
Ryan McGeary 48dc5192ef Fix explicit names on multiple file fields
If a file field tag is passed the multiple option, it is turned into an
array field (appending "[]"), but if the file field is passed an
explicit name as an option, leave the name alone (do not append "[]").

Fixes #9830
2013-04-05 15:32:56 -04:00
Rafael Mendonça França d25e0c6f6a Merge pull request #10098 from subwindow/postgres_dump_bigint_default
Correctly parse bigint defaults in PostgreSQL

Conflicts:
	activerecord/CHANGELOG.md
2013-04-05 14:42:03 -03:00
Andrea 107d199c45 Remove deprecated attr_accessible mention 2013-04-05 19:21:52 +03:00
Zoltan Debre 9d62ebb0d0 Change deprecated validates_presence_of
In Validations section the example contained "validates_presence_of" which is deprecated. It should be "validates :name, presence: true"
2013-04-05 17:15:53 +02:00
wangjohn 8e295b04f1 Refactoring some reused code into a method (inside of the routes
mapper) and adding a constant for all the possible scopes.
2013-04-05 11:15:18 -04:00
Erik Peterson 661365e7ce Correctly parse bigint defaults in PostgreSQL 2013-04-05 09:37:08 -04:00
Carlos Antonio da Silva 877dfcbb64 Move changelog to the top [ci skip] 2013-04-05 10:01:38 -03:00
Carlos Antonio da Silva bbfddf8470 Fix indent and remove extra white spaces 2013-04-05 09:59:22 -03:00
Jon Leighton 685cf144a9 Merge pull request #9996 from mikz/master
Association with inverse_of does not set the parent in association building block
2013-04-05 05:57:27 -07:00
Jon Leighton bab0e2804d Merge pull request #10058 from jamesgolick/master
Avoid calling define_method in CollectionProxy#scope
2013-04-05 05:37:17 -07:00
Jon Leighton 8606a7fbe9 Fix scope chaining + STI
See #9869 and #9929.

The problem arises from the following example:

    class Project < ActiveRecord::Base
      scope :completed, -> { where completed: true }
    end

    class MajorProject < Project
    end

When calling:

    MajorProject.where(tasks_count: 10).completed

This expands to:

    MajorProject.where(tasks_count: 10).scoping {
      MajorProject.completed
    }

However the lambda for the `completed` scope is defined on Project. This
means that when it is called, `self` is Project rather than
MajorProject. So it expands to:

    MajorProject.where(tasks_count: 10).scoping {
      Project.where(completed: true)
    }

Since the scoping was applied on MajorProject, and not Project, this
fails to apply the tasks_count condition.

The solution is to make scoping apply across STI classes. I am slightly
concerned about the possible side-effects of this, but no tests fail and
it seems ok. I guess we'll see.
2013-04-05 13:14:28 +01:00
Neeraj Singh f029fb07c2 failing test for #9869 2013-04-05 13:14:28 +01:00
Carlos Antonio da Silva ba29581e36 Merge pull request #10102 from xxxcaqui/master
Sort modules in active_record.rb
2013-04-05 04:56:10 -07:00
Chandresh Pant 3bacddee18 Merge pull request #133 from chandresh/master
Fixed the unknown_action_create_for_posts.png image
2013-04-05 04:19:30 -07:00
Chandresh Pant 7f82aa3ac7 correct image for unknown_action_create_for_posts.png 2013-04-05 16:43:24 +05:30
Andrew White 155f86675c Improve `belongs_to touch: true` timestamp test
Round off time to a whole second value to compensate for databases
that don't support fractional timestamps. Also add a assertion to
check that the old record is touched when the association is cleared.
2013-04-05 11:34:52 +01:00
Shunsuke Osa 87543d1cd2 Sort modules in alphabetical order. 2013-04-05 15:21:48 +09:00
Francesco Rodriguez 525ffc52fb update ActiveRecord::AttributeMethods::Serialization documentation [ci skip] 2013-04-04 21:08:29 -05:00
Francesco Rodriguez 1df502e000 mark ReversibleBlockHelper as :nodoc: [ci skip] 2013-04-04 21:06:07 -05:00
Francesco Rodriguez f8dbe4c7cc fix Array#uniq_by! docs [ci skip] 2013-04-04 21:02:57 -05:00
Carlos Antonio da Silva dce398d579 Avoid an attempt to fetch old record when id was not present in touch callback 2013-04-04 22:22:44 -03:00
Carlos Antonio da Silva 034f254d59 Use the correct pk field from the reflected class to find the old record
The implementation was using the source class foreign key field instead
of the reflected primary key one to find the old record.

For instance, for this scenario

    class Bulb < ActiveRecord::Base
      belongs_to :car, :touch => true
    end

    class Car < ActiveRecord::Base
      has_many :bulbs
    end

the current implementation was trying to do this query:

    Car.where(car_id: X).first

where we should be doing this query:

    Car.where(id: X).first

This should hopefully fix the build.
2013-04-04 22:09:40 -03:00