- 25 6月, 2012 3 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
Correct line numbers for reader and writer methods in AS configurable The line number for the reader method is off by one due to the local variable line being reassigned to the writer's line. This commit would provide correct line numbers for backtraces and method introspection (for example, method(:reader).source_location).
-
由 benolee 提交于
-
- 24 6月, 2012 5 次提交
-
-
由 Rafael Mendonça França 提交于
Stop assuming strings for grouped calculations
-
由 Ernie Miller 提交于
Execute_grouped_calculation is one of those places where ActiveRecord forgets that it has ARel underpinnings, and assumes that the values provided to group_values are strings. This artificially hobbles otherwise functional code. This patch stops assuming that incoming values respond to to_sym, stops using string interpolation for table aliases on objects that support aliasing, and stops unnecessarily joining group_values on the relation. Additionally, it calls to_sql, if available, on objects sent to column_alias_for, in order to get a more reasonable alias string than a non-string's default to_str method.
-
由 Carlos Antonio da Silva 提交于
Don't paramify ActionDispatch::Http::UploadedFile in tests
-
由 Carlos Antonio da Silva 提交于
Move Active Record rake tasks tests to under the tasks dir [ci skip]
-
由 kennyj 提交于
-
- 23 6月, 2012 15 次提交
-
-
由 Carlos Antonio da Silva 提交于
Ruby 1.9 hash syntax for generated code
-
由 Vijay Dev 提交于
-
由 Richard Huang 提交于
app/controllers/application_controller.rb app/views/layouts/application.html.erb config/application.rb config/routes.rb test/performance/browsing_test.rb
-
由 Andrew White 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Rafael Mendonça França 提交于
add :nodoc: to internal implementations [ci skip]
-
由 Francesco Rodriguez 提交于
-
由 Rafael Mendonça França 提交于
Allow precision option for postgresql datetimes
-
由 Tony Schneider 提交于
This patch addresses the difficulty of retrieving datetime fields. By default, the database holds a higher precision than the time as a String. This issue is discussed at length at the following links: - [#3519](https://github.com/rails/rails/issues/3519) - [#3520](https://github.com/rails/rails/issues/3520) Also, kudos to @mattscilipoti
-
由 Rafael Mendonça França 提交于
change param name to improve documentation
-
由 Francesco Rodriguez 提交于
The keys of the error messages are actually attribute names. It makes the documentation easier to understand: # Returns +true+ if the error messages include an error for the given # +attribute+, +false+ otherwise. # # person.errors.messages # => { :name => ["can not be nil"] } # person.errors.include?(:name) # => true # person.errors.include?(:age) # => false def include?(attribute) (v = messages[attribute]) && v.any? end
-
由 Vijay Dev 提交于
-
由 Vijay Dev 提交于
-
由 Vijay Dev 提交于
-
- 22 6月, 2012 17 次提交
-
-
由 Rafael Mendonça França 提交于
Dynamic finders for aliased attributes
-
由 Maximilian Schneider 提交于
previously dynamic finders only worked in combination with the actual column name and not its alias defined with #alias_attribute
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
Allow ActiveRecord::Relation#pluck to accept multiple columns. Returns an array of arrays containing the type casted values: Person.pluck(:id, :name) # SELECT people.id, people.name FROM people # [[1, 'David'], [2, 'Jeremy'], [3, 'Jose']] Closes #6500
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
Ensure it works with mix of symbols and strings, and with a select clause possibly containing more than one column. Also remove support for pluck with an array of columns, in favor of passing the list of attributes: Model.pluck(:a, :b) See comments: https://github.com/rails/rails/pull/6500#issuecomment-6030292
-
由 jeroeningen 提交于
-
由 Carlos Antonio da Silva 提交于
When generating xml with a custom implementation of serializable_hash, if using the :except option, it was being overriden by the default AR implementation that attempts to ignore the inheritance column from STI automatically. So, if you have an implementation like this: def serializable_hash(options={}) super({ except: %w(some_attr) }.merge!(options)) end The :except option was correctly being used for :json generation, but not for :xml, because the options hash already contained the :except key with the inheritance column, thus overriding the customization. This commit fixes this problem by removing the :except logic from the xml serializer, that happened before calling serializable_hash. Since serializable_hash also does the same check for inheritance column, this logic was duplicated in both places, thus it's safe to remove it from xml serializer (see ActiveRecord::Serialization#serializable_hash). This is an attempt to solve issue #2498, that claims for a "Single transformation API for both xml and json representations".
-
由 Carlos Antonio da Silva 提交于
ActiveRecord json/xml serialization should use as base serializable_hash, provided by ActiveModel. Add some more coverage around options :only and :except for both json and xml serialization.
-
由 Jon Leighton 提交于
-
由 Andrew White 提交于
-
由 Tim Vandecasteele 提交于
To test uploading a file without using fixture_file_upload, a posted ActionDispatch::Http::UploadedFile should not be paramified (just like Rack::Test::UploadedFile). (Rack::Test::UploadedFile and ActionDispatch::Http::UploadedFile don't share the same API, tempfile is not accessible on Rack::Test::UploadedFile as discussed in https://github.com/brynary/rack-test/issues/30)
-
由 Francesco Rodriguez 提交于
-
由 Andrew White 提交于
Improve the derivation of HABTM join table name to take account of nesting. It now takes the table names of the two models, sorts them lexically and then joins them, stripping any common prefix from the second table name. Some examples: Top level models (Category <=> Product) Old: categories_products New: categories_products Top level models with a global table_name_prefix (Category <=> Product) Old: site_categories_products New: site_categories_products Nested models in a module without a table_name_prefix method (Admin::Category <=> Admin::Product) Old: categories_products New: categories_products Nested models in a module with a table_name_prefix method (Admin::Category <=> Admin::Product) Old: categories_products New: admin_categories_products Nested models in a parent model (Catalog::Category <=> Catalog::Product) Old: categories_products New: catalog_categories_products Nested models in different parent models (Catalog::Category <=> Content::Page) Old: categories_pages New: catalog_categories_content_pages Also as part of this commit the validity checks for HABTM assocations have been moved to ActiveRecord::Reflection One side effect of this is to move when the exceptions are raised from the point of declaration to when the association is built. This is consistant with other association validity checks.
-
由 Carlos Antonio da Silva 提交于
-
由 Francesco Rodriguez 提交于
-
由 Rafael Mendonça França 提交于
add :nodoc: to AM::AttributeMethods#instance_method_already_implemented?...
-