コミュニティの一意のコードを持つユーザーの数を表示しようとしています。
@community.uniquecodes.users.count.to_s
これがこのエラーを返すのはなぜですか?
undefined method `users'
ユニークコードは残っているのにユーザーが削除される可能性があることを考慮してください!
私の協会はこんな感じです
User has_many :communities
has_many :uniquecodes
Community belongs_to :user
has_many :uniquecodes
Uniquecode belongs_to :user
belongs_to :community
コミュニティの一意のコードを持つユーザーの数を取得するにはどうすればよいですか?