Module: Sqlyzer::Associate::Keys

Included in:
Many, One
Defined in:
lib/sqlyzer/associate.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



114
115
116
117
118
119
120
121
122
# File 'lib/sqlyzer/associate.rb', line 114

def     Keys.link(owner, key, klass)
  if owner.const_defined?(:SQL_ASSOCIATE_VARS)
    old = owner.const_get :SQL_ASSOCIATE_VARS
    old[key] = klass
    owner.const_set :SQL_ASSOCIATE_VARS, old
  else
    owner.const_set :SQL_ASSOCIATE_VARS, { key => klass }
  end
end

Instance Method Details

#sql_associate_each(&block) ⇒ Object



130
131
132
# File 'lib/sqlyzer/associate.rb', line 130

def     sql_associate_each(&block)
  sql_associate_keys.each(&block)
end

#sql_associate_keysObject



126
127
128
# File 'lib/sqlyzer/associate.rb', line 126

def     sql_associate_keys
  self.class::SQL_ASSOCIATE_KEYS
end