Sha256: b9ffe832d699d064e0370432b9dcb28d3e08702cf093bc4328d17e3dc25c538b

Contents?: true

Size: 595 Bytes

Versions: 18

Compression:

Stored size: 595 Bytes

Contents

class Topic < ActiveRecord::Base
  has_many :replies, :dependent => :destroy, :order => 'replies.created_at DESC'
  belongs_to :project

  # pretend find and count were extended and accept an extra option
  # if there is a :foo option, prepend its value to collection
  def self.find(*args)
    more = []
    more << args.last.delete(:foo) if args.last.is_a?(Hash) and args.last[:foo]
    res = super
    more.empty?? res : more + res
  end

  # if there is a :foo option, always return 100
  def self.count(*args)
    return 100 if args.last.is_a?(Hash) and args.last[:foo]
    super
  end
end

Version data entries

18 entries across 18 versions & 5 rubygems

Version Path
cehoffman-acts_as_ferret-0.4.4 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
jkraemer-acts_as_ferret-0.4.4 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
watson-acts_as_ferret-0.4.8.2 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.5.2 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.8.2 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.8.1 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.5.1 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.5 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.8.rails3 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.8 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.7 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.6 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
acts_as_ferret-0.4.4 doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
ambition-0.2.1 ./test/databases/fixtures/topic.rb
ambition-0.1.6 ./test/databases/fixtures/topic.rb
ambition-0.2.0 ./test/databases/fixtures/topic.rb
ambition-0.2.2 ./test/databases/fixtures/topic.rb
ambition-0.3.1 ./test/databases/fixtures/topic.rb