We all know that rails models associations gets defined while class definitions are loaded and once defined can't be changed. But still you can make use of block parameter to conditions to have dynamic query conditions inside associations.
Below line explains how to define dynamic associations -
has_one :code_sequence, :class_name => 'Sequence', :conditions => 'kind = "#{self.kind}"'
Please make a note that below code won't be working -
has_one :code_sequence, :class_name => 'Sequence', :conditions => proc { |c| ['kind = ?', c.kind] }