Module: Ix::HasIx::ClassMethods

Defined in:
lib/ix/has_ix.rb

Instance Method Summary collapse

Instance Method Details

#fill_blank_ixsObject



23
24
25
26
27
# File 'lib/ix/has_ix.rb', line 23

def fill_blank_ixs
	self.where(ix: nil).each do |record|
		record.save
	end
end

#find_ix(ix) ⇒ Object



19
20
21
# File 'lib/ix/has_ix.rb', line 19

def find_ix(ix)
	self.find_by ix: ix
end

#has_ix(options = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/ix/has_ix.rb', line 12

def has_ix(options = {})
	cattr_accessor :ix_length
	self.ix_length = (options[:length] / 2) || 4

	include Ix::HasIx::LocalInstanceMethods
end