Sha256: 1e8e259d4166e57bd6d9cd1ea8977cc862fbf867e9818f020f2f979a2a2983ec

Contents?: true

Size: 286 Bytes

Versions: 16

Compression:

Stored size: 286 Bytes

Contents

class User < ActiveRecord::Base
  has_many :readings
  has_many :articles, :through => :readings

  has_many :comments, :as => :person
  has_one :first_comment, :as => :person, :class_name => "Comment"

  def find_custom_articles
    articles.where("name = ?", "Article One")
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
composite_primary_keys-13.0.8 test/fixtures/user.rb
composite_primary_keys-14.0.6 test/fixtures/user.rb
composite_primary_keys-13.0.7 test/fixtures/user.rb
composite_primary_keys-13.0.6 test/fixtures/user.rb
composite_primary_keys-14.0.5 test/fixtures/user.rb
composite_primary_keys-13.0.5 test/fixtures/user.rb
composite_primary_keys-13.0.4 test/fixtures/user.rb
composite_primary_keys-14.0.4 test/fixtures/user.rb
composite_primary_keys-14.0.3 test/fixtures/user.rb
composite_primary_keys-13.0.3 test/fixtures/user.rb
composite_primary_keys-14.0.2 test/fixtures/user.rb
composite_primary_keys-13.0.2 test/fixtures/user.rb
composite_primary_keys-14.0.1 test/fixtures/user.rb
composite_primary_keys-13.0.1 test/fixtures/user.rb
composite_primary_keys-13.0.0 test/fixtures/user.rb
composite_primary_keys-12.0.10 test/fixtures/user.rb