| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
There is no meaningful performance penalty in defining attribute
methods, since it only happens once.
There is also no reason *not* to define them, since they get thrown in
an included module, so they will not 'overwrite' anything. In fact, this
is desirable, since it allows us to call super.
|
| | | |
| | | |
| | | |
| | | | |
We can just use method_defined? and private_method_defined?
|
|/ / /
| | |
| | |
| | |
| | | |
For consistency with find_or_initialize_by. Also remove first_or_build
alias.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
Make sure we don't redefine an already-defined attribute method.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
db:migrate:status not looking at all migration paths
|
|\ \ \
| | | |
| | | | |
Add first_or_create family of methods to Active Record
|
| | | |
| | | |
| | | |
| | | | |
of methods.
|
| | | |
| | | |
| | | |
| | | | |
removing examples that create several users at the same time (this is confusing and not really helpful).
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Active Record.
This let's you write things like:
User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true)
Related to #2420.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* https://github.com/rails/rails:
Postgresql adapter: added current_schema check for table_exists?
Postgresql adapter: added current_schema check for table_exists?
|
| | | |
| | | |
| | | |
| | | | |
association scope.
|
|\ \ \ \
| | | | |
| | | | | |
fix exists? to return false if passed nil (which may come from a missing
|
| | | | |
| | | | |
| | | | |
| | | | | |
param)
|
| | | | |
| | | | |
| | | | |
| | | | | |
Patch for issue #2820
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Database adapters use a statement pool for limiting the number of open
prepared statments on the database. The limit defaults to 1000, but can
be adjusted in your database config by changing 'statement_limit'.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
model should not be included in the association scope. (We're already excluding includes.) Fixes #2834.
|
| | | | |
| | | | |
| | | | |
| | | | | |
HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix bad options order in AR::Migration::CommandRecorder#invert_rename_index
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
ActiveRecord::Migration::CommandRecorder#invert_rename_index
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | | |
Fixes #2832
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 0df27c98d982ec87d2fb48cfda82694eb267993e.
Reverted due to failing test, see #2845.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
link in fixture template [closes #2840]
|
|\ \ \ \ \ \ |
|
| | |_|/ / /
| |/| | | | |
|
| | | | | | |
|
| | | | | | |
|
|/ / / / /
| | | | |
| | | | | |
Replace split on comma with a regexp that will reverse all ASC/DESC specifically
|
| | | | |
| | | | |
| | | | |
| | | | | |
(and this call to super is no essential, so easiest to simply remove)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Make #extract_schema_and_table an instance method in Utils
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Also, move the utils test into its own test case.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
supported for mysql2 as well now.
|
| | | | | | |
|