1. 06 8月, 2014 1 次提交
  2. 05 8月, 2014 4 次提交
  3. 03 8月, 2014 1 次提交
  4. 02 8月, 2014 1 次提交
    • E
      Deprecate source_macro · 01c80a12
      eileencodes 提交于
      `source_macro` is no longer used in any ActiveRecord code. I've
      chosen to deprecate it because it was not marked as nodoc and may
      be in use outside of rails source.
      01c80a12
  5. 01 8月, 2014 10 次提交
  6. 31 7月, 2014 4 次提交
    • J
      Fix type casting to Decimal from Float with ... · 1d6a8777
      joker1007 提交于
      When I defines large precision column at RDBMS,
      I assigns float value, raise ArgumentError (precision too large).
      1d6a8777
    • E
      Refactor join_keys to remove complex conditionals · 377bece6
      eileencodes 提交于
      Pushing conditionals down to through reflection
      
      Only the through association needs the part of this conditional
      that deals with belongs to and polymorphic? so that can be pushed
      down into the ThroughReflection reducing the conditionals.
      
      Remove conditional because we can delegate join keys to source reflection
      
      Remove need for source_macro checking
      
      By adding join_id_for to the other reflections we remove the need
      to cehck against the source_macro and can reduce the conditioanl
      from the original join_id_for(owner)
      
      Using polymorphism instead of testing the source_macro
      
      This case statement in join_association is almost exactly the same
      as the original join_keys code. Testing taht theory by creating a
      new join_dependency_keys(assoc_klass) method.
      
      Refactor join_keys further to be more concise
      
      Fixed format of "#:nodoc:" to "# :nodoc:" where I added them to this
      file.
      377bece6
    • E
      Redefine macro checks for reflections · 8d7dea76
      eileencodes 提交于
      Now that we define the macro on the reflection type we no longer
      need to check `macro == :what` on each type for `belongs_to?` or
      `has_one?` etc. These now default to false unless it's defined
      in the reflection class.
      
      Reuse existing belongs_to? method to check macros
      
      We don't need to do `:belongs_to == macro` anymore becasue we
      have a `belongs_to?` method. I didn't find this being used
      anywhere for `has_one?` or `collection?` since they were already
      fixed.
      8d7dea76
    • J
      Remove redundant `self.` in class method calls · cf629889
      Jack Danger Canty 提交于
      These are the only instances of this in the whole code base.
      cf629889
  7. 29 7月, 2014 7 次提交
  8. 28 7月, 2014 4 次提交
  9. 26 7月, 2014 3 次提交
    • C
      Extract iterator method in AR::SchemaDumper · 75f3584d
      Caleb Thompson 提交于
      Gems which wish to tie into ActiveRecord::SchemaDumper need to
      duplicate this logic currently. [Foreigner] is one such example, as is a
      library I'm currently working on but which hasn't been released yet:
      
          def tables_with_foreign_keys(stream)
            tables_without_foreign_keys(stream)
            @connection.tables.sort.each do |table|
              next if ['schema_migrations', ignore_tables].flatten.any? do |ignored|
                case ignored
                when String; table == ignored
                when Regexp; table =~ ignored
                else
                  raise StandardError, 'ActiveRecord::SchemaDumper.ignore_tables accepts an array of String and / or Regexp values.'
                end
              end
              foreign_keys(table, stream)
            end
          end
      
      [Foreigner]: https://github.com/matthuhiggins/foreigner/blob/master/lib/foreigner/schema_dumper.rb#L36-L43
      
      Extract the skip logic to a method, making it much simpler to follow
      this same behavior in gems that are tying into the migration flow and
      let them dump only tables that aren't skipped without copying this block
      of code. The above code could then be simplified to:
      
          def tables_with_foreign_keys(stream)
            tables_without_foreign_keys(stream)
            @connection.tables.sort.each do |table|
              foreign_keys(table, stream) unless ignored?(table)
            end
          end
      
      It also, in my opinion, simplifies the logic on ActiveRecord's side, and
      clarifies the intent of the skip logic.
      75f3584d
    • A
      Remove references to SQLite3Column from documentation · 775cc7de
      a3gis 提交于
      775cc7de
    • A
      8f32ddba
  10. 25 7月, 2014 2 次提交
  11. 24 7月, 2014 3 次提交