Jon Leighton
55da28dd2f
We don't need to build a set for DangerousAttributeError.
...
We can just use method_defined? and private_method_defined?
2011-09-14 00:00:37 +01:00
Santiago Pastorino
82afaa0686
Provide a way to access to assets without using the digest, useful for static files and emails
2011-09-13 15:18:21 -07:00
Jon Leighton
11870117c6
Rename first_or_new to first_or_initialize.
...
For consistency with find_or_initialize_by. Also remove first_or_build
alias.
2011-09-13 19:09:01 +01:00
Vijay Dev
d3baa92831
delete stray backup files from guides sample app
2011-09-13 18:46:34 +05:30
Vijay Dev
23fc5fe0e2
Merge branch 'master' of github.com:lifo/docrails
2011-09-13 18:39:36 +05:30
45north
7b22b01930
Fixed markup error.
2011-09-13 15:25:46 +03:00
Mike Gunderloy
317ad8cb62
Fix typo
2011-09-13 06:47:13 -05:00
Santiago Pastorino
ae04fbfee9
Fix asset_path relative_url_root method
2011-09-13 02:45:05 -07:00
Santiago Pastorino
60fd88d2f7
Merge pull request #3001 from guilleiguaran/fix-assets-precompile-host-test
...
Fix precompile asset_host test
2011-09-13 02:41:27 -07:00
Guillermo Iguaran
a65010fddb
Fix precompile asset_host test
2011-09-13 04:35:12 -05:00
Santiago Pastorino
8a005ff504
Merge pull request #3000 from guilleiguaran/fix-relative-url-root
...
Fix for relative url root in assets
2011-09-13 02:29:33 -07:00
Guillermo Iguaran
f509b6988b
Fix for relative url root in assets
2011-09-13 04:27:30 -05:00
Santiago Pastorino
536bb7b135
Merge pull request #2996 from guilleiguaran/move-assets-tests
...
Move asset tests to assets_test file
2011-09-13 01:27:58 -07:00
Guillermo Iguaran
e767cda6ea
Move asset tests to assets_test file
2011-09-13 03:19:02 -05:00
Santiago Pastorino
5bad79d930
always rewrite_relative_url_root
2011-09-13 00:27:29 -07:00
Santiago Pastorino
f1c3903f5c
Merge pull request #2993 from deepakprasanna/generator_test_fix
...
fixed the failing generators_test in railties.
2011-09-12 23:51:23 -07:00
Deepak Prasanna
73e8dd189b
fixed the failing generators_test
2011-09-13 11:59:40 +05:30
Santiago Pastorino
b0cee70354
Merge pull request #2977 from guilleiguaran/fix-relative-root-in-assets
...
Set relative url root in assets when controller isn't available for Sprockets
2011-09-12 23:25:28 -07:00
Santiago Pastorino
038e45a2b6
Merge pull request #2987 from kennyj/master
...
fix https://github.com/rails/rails/issues/2947 (with testcase)
2011-09-12 23:04:14 -07:00
Guillermo Iguaran
9279d1102c
Set relative url root in assets when controller isn't available for Sprockets. Fix #2435
...
See https://github.com/rails/sass-rails/issues/42 for details
2011-09-13 01:02:44 -05:00
Aaron Patterson
f65b2215cd
removing backwards compatibility module
2011-09-12 16:50:49 -07:00
Aaron Patterson
68ec26c70c
point rails at Journey for dev and edge
2011-09-12 16:50:49 -07:00
Aaron Patterson
ea7ef9597e
partially expand the parameters to match
2011-09-12 16:50:49 -07:00
Aaron Patterson
ad1a891649
unfactor the Route class to private factory methods
2011-09-12 16:50:49 -07:00
Aaron Patterson
943aa826a4
reduce dependencies of external objects in the Route class
2011-09-12 16:50:49 -07:00
Aaron Patterson
f5ab6805ed
delete unused code, pass path explicitly to journey
2011-09-12 16:50:49 -07:00
Aaron Patterson
d21e0e2af3
adjust route inspection to work with Journey
2011-09-12 16:50:48 -07:00
Aaron Patterson
a08bee7841
all routes can be stored in the Journey Routes object
2011-09-12 16:50:48 -07:00
Aaron Patterson
b7ccfa96d2
clear! does not need to be called from initialize
2011-09-12 16:50:48 -07:00
Aaron Patterson
59b9fe961d
reuse the route collection and formatter by clearing them
2011-09-12 16:50:48 -07:00
Aaron Patterson
4ffe667ab7
Instantiate each part of our routing system:
...
* A collection of Routes
* The Router, which consults the collection of routes
* A formatter that consults the collection of routes
2011-09-12 16:50:48 -07:00
Aaron Patterson
537ed6eb2f
stop freezing the routes
2011-09-12 16:50:47 -07:00
Aaron Patterson
a05a9ff1ca
stop using a hash for parameterizing
2011-09-12 16:50:47 -07:00
Aaron Patterson
5f0b37c486
Switching rack-mount to journey.
2011-09-12 16:50:47 -07:00
Jon Leighton
1a421ceccb
Deprecate using method_missing for attributes that are columns.
...
This shouldn't ever happen unless people are doing something
particularly weird, but adding a deprecation in case there are bugs not
caught by our tests.
2011-09-13 00:03:09 +01:00
Jon Leighton
c89e1c7bde
Add an attribute_missing method to ActiveModel::AttributeMethods.
...
This can be overloaded by implementors if necessary.
2011-09-13 00:02:33 +01:00
Jon Leighton
6d8dbeca6b
Avoid double super call in some cases.
...
If super was false earlier, it is still going to be false, so we don't
need to call it again at the end of the method.
2011-09-13 00:01:58 +01:00
Jon Leighton
ac687ed651
Let Ruby deal with method visibility.
...
Check respond_to_without_attributes? in method_missing. If there is any
method that responds (even private), let super handle it and raise
NoMethodError if necessary.
2011-09-13 00:01:58 +01:00
Jon Leighton
cf115d2f8e
Reset column info when messing with columns.
...
We are subclassing Session here, but messing with the columns will
affect the attribute methods defined on the Session superclass, and
therefore other tests, unless we properly isolate it by resetting column
info before and after the test run.
2011-09-13 00:01:58 +01:00
Jon Leighton
eecfa84a90
Always generate attribute methods on the base class.
...
This fixes a situation I encountered where a subclass would cache the
name of a generated attribute method in @_defined_class_methods. Then,
when the superclass has it's attribute methods undefined, the subclass
would always have to dispatch through method_missing, because the
presence of the attribute in @_defined_class_methods would mean that it
is never generated again, even if undefine_attribute_methods is called
on the subclass.
There various other confusing edge cases like this. STI classes share
columns, so let's just keep all the attribute method generation state
isolated to the base class.
2011-09-13 00:01:58 +01:00
Jon Leighton
50d395f96e
Raise error when using write_attribute with a non-existent attribute.
...
Previously we would just silently write the attribute. This can lead to
subtle bugs (for example, see the change in AutosaveAssociation where a
through association would wrongly gain an attribute.
Also, ensuring that we never gain any new attributes after
initialization will allow me to reduce our dependence on method_missing.
2011-09-13 00:01:58 +01:00
Jon Leighton
8667d3aeb6
Make protected method public so we avoid method_missing.
2011-09-13 00:01:58 +01:00
Jon Leighton
3386a089ef
Fix warnings.
...
Make sure we don't redefine an already-defined attribute method.
2011-09-13 00:01:57 +01:00
Jon Leighton
99bd6b53da
Add deprecation for doing attribute_method_suffix ''
2011-09-13 00:01:57 +01:00
Jon Leighton
93d574c962
refactoring
2011-09-13 00:01:57 +01:00
Jon Leighton
8b8b7143ef
Use an empty AttributeMethodMatcher by default.
...
This means that attribute methods which don't exist will get generated
when define_attribute_methods is called, so we don't have to use hacks
like `attribute_method_suffix ''`.
2011-09-13 00:01:57 +01:00
Jon Leighton
8d59e0b263
Alias id= if necessary, rather than relying on method_missing
2011-09-13 00:01:57 +01:00
dharmatech
7d235b972b
getting_started.textile: Fix typo and split up a sentence in section "Building a Multi-Model Form"
2011-09-12 15:55:01 -05:00
Santiago Pastorino
1a4ea1bc97
Merge pull request #2988 from guilleiguaran/remove-extra-line
...
Remove odd asignation
2011-09-12 11:49:43 -07:00
Guillermo Iguaran
f746927889
Remove odd asignation
2011-09-12 13:16:55 -05:00