Commit Graph

141 Commits

Author SHA1 Message Date
wycats
d916c62cfc eliminate alias_method_chain from ActiveRecord 2010-05-09 02:37:52 +03:00
Xavier Noria
6be04c4631 i18n -> AS/i18n 2010-04-14 02:30:02 -07:00
Xavier Noria
dd635ec701 adds missing requires for arel and i18n, prevents Arel constant from being autoloaded (which was still seen), though it probably hides an issue related to dependencies 2010-04-14 02:01:55 -07:00
wycats
4aded43b73 Replace the placeholder base_hook API with on_load. To specify some code that
should run during framework load do:

ActiveSupport.on_load(:action_controller) do
  # Code run in the context of AC::Base
end
2010-03-29 17:08:50 -07:00
wycats
39d6f9e112 Make many parts of Rails lazy. In order to facilitate this,
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.

With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.

TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Carlhuda
24ab5665b2 Revert "Fix test load paths for those not using bundler"
This reverts commit eec2d301d4.

This commit broke tests. You cannot have a file called "bundler" on the load path.
2010-02-23 17:31:17 -08:00
Joshua Peek
eec2d301d4 Fix test load paths for those not using bundler 2010-02-15 10:20:11 -06:00
Pratik Naik
dc3cc6c608 Move batch finders to Relation 2010-02-12 22:31:03 +00:00
Mikel Lindsaar
65ad16568c Updating copyright dates on all licenses 2010-02-01 10:10:53 +11:00
Joshua Peek
db49c706b6 Axe AM state machine
We're going do it eventually, get it done before 3.0 is final.
2010-01-30 18:38:01 -06:00
Pratik Naik
6d30002a52 Revert "Refactoring attributes/types" [#3348 state:open]
This reverts commit f936a1f100.

Conflicts:

	activerecord/lib/active_record.rb
	activerecord/lib/active_record/base.rb

Revert "Fixed: #without_typecast should only disable typecasting on the duplicated attributes" [#3387 state:open]

This reverts commit 2831996483.

Reason :

  It's not generating attribute methods properly, making object.column 5x slower.
2010-01-22 02:37:07 +05:30
Pratik Naik
9465b84b54 Rename CalculationMethods to Calculations and get rid of the old Calculations module 2010-01-19 22:17:33 +05:30
Joshua Peek
e5ed62deea Autoload AR test case 2010-01-04 16:50:01 -06:00
Pratik Naik
8edfa8f82f Move Relation#spawn and Relation#merge to a separate module 2010-01-03 18:57:57 +05:30
Pratik Naik
3c23b71a09 Move predicate building to a stand alone PredicateBuilder class 2010-01-01 04:17:55 +05:30
Jeremy Kemper
10a2638db0 Fix up AR extension by using Railties module instead of Rails and requiring ControllerRuntime at initialization time instead of boot 2009-12-30 19:24:00 -08:00
Pratik Naik
7aabaac0f5 Organize Relation methods into separate modules 2009-12-30 19:29:26 +05:30
Pratik Naik
e8ca22d129 Move Relation calculation methods to a separate module 2009-12-28 19:12:15 +05:30
José Valim
97db79ab3c Remove ActiveRecord runtime logging from ActionPack and place in ActiveRecord, adding it through config.action_controller.include hook. 2009-12-27 13:32:40 +01:00
Joshua Peek
ace20bd25e Flip deferrable autoload convention 2009-12-22 17:27:37 -06:00
Joshua Peek
7ee5843c3c Fully expand relative rails framework paths and make sure we aren't
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Carlhuda
c1304098cc Reorganize autoloads:
* A new module (ActiveSupport::Autoload) is provide that extends
    autoloading with new behavior.
  * All autoloads in modules that have extended ActiveSupport::Autoload
    will be eagerly required in threadsafe environments
  * Autoloads can optionally leave off the path if the path is the same
    as full_constant_name.underscore
  * It is possible to specify that a group of autoloads live under an
    additional path. For instance, all of ActionDispatch's middlewares
    are ActionDispatch::MiddlewareName, but they live under 
    "action_dispatch/middlewares/middleware_name"
  * It is possible to specify that a group of autoloads are all found
    at the same path. For instance, a number of exceptions might all
    be declared there.
  * One consequence of this is that testing-related constants are not
    autoloaded. To get the testing helpers for a given component,
    require "component_name/test_case". For instance, "action_controller/test_case".
  * test_help.rb, which is automatically required by a Rails application's
    test helper, requires the test_case.rb for all active components, so
    this change will not be disruptive in existing or new applications.
2009-12-02 20:01:08 -08:00
José Valim
e714b499cc Move validator, human_name and human_attribute_name to ActiveModel, remove deprecated error messages and add i18n_scope and lookup_ancestors.
Signed-off-by: Carl Lerche <carllerche@mac.com>
2009-10-20 17:52:32 -07:00
Jeremy Kemper
2767036392 Use bundled env for tests only 2009-10-19 19:00:48 -07:00
Eric Chapweske
f936a1f100 Refactoring attributes/types [#3348 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-17 12:37:15 -05:00
Jeremy Kemper
6be5f45019 Fix env path 2009-10-14 19:30:06 -07:00
Jeremy Kemper
9c52f96acb Include bundled env in toplevel require, if present 2009-10-14 19:15:33 -07:00
Jeremy Kemper
df55781458 No more toplevel arel sibling 2009-10-14 19:05:06 -07:00
Emilio Tagua
0e2fbd80e2 Merge commit 'rails/master'
Conflicts:
	activerecord/lib/active_record/calculations.rb
	activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
2009-08-10 18:07:33 -03:00
Jeff Dean
22f3398253 Introduce validates_with to encapsulate attribute validations in a class.
[#2630 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:47:56 -07:00
Emilio Tagua
ae175a5354 Merge commit 'rails/master' 2009-08-05 14:52:07 -03:00
Joshua Peek
aad5a30bf2 Add simple support for ActiveModel's StateMachine for ActiveRecord 2009-08-04 11:03:57 -05:00
Emilio Tagua
3de59e916d Merge commit 'rails/master'
Conflicts:
	activerecord/lib/active_record/associations.rb
2009-07-31 16:21:07 -03:00
Joshua Peek
62fd1d3716 Start separating primary key concerns 2009-07-30 17:54:02 -05:00
Joshua Peek
c2b075bed0 Concernify AR AttributeMethods 2009-07-30 17:53:59 -05:00
Pratik Naik
e033b5d037 Merge docrails 2009-07-25 16:03:58 +01:00
Emilio Tagua
0e0866e056 Introduced ActiveRecord::Relation, a layer between an ARel relation and an AR relation 2009-07-21 20:21:03 -03:00
Emilio Tagua
a924b2f66e Merge commit 'rails/master' 2009-06-12 16:20:27 -03:00
Joshua Peek
4d70359200 Integrate ActiveModel::Observing into ActiveRecord 2009-06-10 23:36:44 -05:00
Emilio Tagua
fd3c55f09f Merge commit 'rails/master'
Conflicts:

	activerecord/lib/active_record.rb
2009-06-02 12:36:36 -03:00
Emilio Tagua
2474fbb4d6 Set ActiveRecord as Arel engine on load. 2009-06-02 12:29:09 -03:00
Joshua Peek
69742ca8fa Merge branch 'master' into active_model
Conflicts:
	activemodel/lib/active_model/core.rb
	activemodel/test/cases/state_machine/event_test.rb
	activemodel/test/cases/state_machine/state_transition_test.rb
	activerecord/lib/active_record/validations.rb
	activerecord/test/cases/validations/i18n_validation_test.rb
	activeresource/lib/active_resource.rb
	activeresource/test/abstract_unit.rb
2009-05-29 16:06:21 -05:00
Emilio Tagua
1cc4459939 Merge commit 'rails/master'
Conflicts:

	activerecord/lib/active_record.rb

Updated:
  Arel submodule
2009-05-18 20:01:06 -03:00
Jeremy Kemper
37453e11e9 Revert "Get AR CI passing again by requiring the entire core_ext"
This reverts commit 8e6a18d867.
2009-05-18 11:55:06 -07:00
Emilio Tagua
a04dedd563 Merge commit 'rails/master'
Conflicts:

	activerecord/lib/active_record/base.rb
	activerecord/lib/active_record/migration.rb
	activerecord/test/cases/helper.rb
2009-05-18 11:18:46 -03:00
Yehuda Katz
8e6a18d867 Get AR CI passing again by requiring the entire core_ext
Note that this includes Time and Date; we should
  really figure out what parts of core_ext are really
  required for AR and require just those.
2009-05-16 12:09:25 -07:00
Jeremy Kemper
e8550ee032 Cherry-pick core extensions 2009-05-13 12:00:15 -07:00
Jeremy Kemper
a7ccc7c79f Remove support for deprecated validation message interpolation format 2009-05-13 11:43:03 -07:00
Emilio Tagua
d3042ef80c Merge commit 'rails/master' 2009-05-04 19:23:34 -03:00
Chris Kampmeier
d3ee8756c8 Don't use #tap before Active Support is available, since older versions of ruby don't have native implementations
[#2603 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-05-04 08:32:25 -07:00