Sha256: 9886159d87857b7ff92000bab8f6ef2c14e7c71d054f368be464492704029ea5

Contents?: true

Size: 472 Bytes

Versions: 19

Compression:

Stored size: 472 Bytes

Contents

module Puffer
  module Extensions
    module ActiveRecord
      module Base

        def call_chain chain
          swallow_nil{instance_eval(chain.to_s)}
        end

        def to_title
          send title_method
        end

        def title_method
          self.class.column_names.detect {|c| c =~ /name|title/} || self.class.column_names[1].to_sym
        end

      end
    end
  end
end

ActiveRecord::Base.send :include, Puffer::Extensions::ActiveRecord::Base

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
puffer-0.0.26 lib/puffer/extensions/activerecord.rb
puffer-0.0.25 lib/puffer/extensions/activerecord.rb
puffer-0.0.24 lib/puffer/extensions/activerecord.rb
puffer-0.0.23 lib/puffer/extensions/activerecord.rb
puffer-0.0.22 lib/puffer/extensions/activerecord.rb
puffer-0.0.21 lib/puffer/extensions/activerecord.rb
puffer-0.0.20 lib/puffer/extensions/activerecord.rb
puffer-0.0.19 lib/puffer/extensions/activerecord.rb
puffer-0.0.18 lib/puffer/extensions/activerecord.rb
puffer-0.0.17 lib/puffer/extensions/activerecord.rb
puffer-0.0.16 lib/puffer/extensions/activerecord.rb
puffer-0.0.15 lib/puffer/extensions/activerecord.rb
puffer-0.0.14 lib/puffer/extensions/activerecord.rb
puffer-0.0.13 lib/puffer/extensions/activerecord.rb
puffer-0.0.12 lib/puffer/extensions/activerecord.rb
puffer-0.0.11 lib/puffer/extensions/activerecord.rb
puffer-0.0.10 lib/puffer/extensions/activerecord.rb
puffer-0.0.9 lib/puffer/extensions/activerecord.rb
puffer-0.0.8 lib/puffer/extensions/activerecord.rb