Sha256: ea16fe1c0bc99d045f405081b5e511219a2390ddb033401b1b0435ef32ed4c3a

Contents?: true

Size: 264 Bytes

Versions: 3

Compression:

Stored size: 264 Bytes

Contents

module ParserUtils
  def table_name_from_association_chain(association_chain)
    head = @klass

    association_chain.each do |a_name|
      head = head.reflect_on_all_associations.find{ |a| a.name.to_s == a_name }.klass
    end
    
    head.table_name
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hario-0.2.0 lib/hario/behaviours/utils.rb
hario-0.1.1 lib/hario/behaviours/utils.rb
hario-0.1.0 lib/hario/behaviours/utils.rb