Ticket #184: attributes_with_quotes-2_0.patch
| File attributes_with_quotes-2_0.patch, 1.5 kB (added by artemv, 8 months ago) |
|---|
-
lib/globalize/localization/db_translate.rb
old new 672 672 # an SQL statement. 673 673 # REDEFINED to include only untranslated fields. We don't want to overwrite the 674 674 # base translation with other translations. 675 def attributes_with_quotes(include_primary_key = true )675 def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true) 676 676 if Locale.base? 677 attributes.inject({}) do |quoted, (name, value)|677 quoted = attributes.inject({}) do |quoted, (name, value)| 678 678 if column = column_for_attribute(name) 679 679 quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary 680 680 end 681 681 quoted 682 682 end 683 683 else 684 attributes.inject({}) do |quoted, (name, value)|684 quoted = attributes.inject({}) do |quoted, (name, value)| 685 685 if !self.class.globalize_facets_hash.has_key?(name) && 686 686 column = column_for_attribute(name) 687 687 quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary … … 689 689 quoted 690 690 end 691 691 end 692 include_readonly_attributes ? quoted : remove_readonly_attributes(quoted) 692 693 end 693 694 694 695 def create_or_update
