Sha256: fe64ff78198bd13d1066f4f44a4db47a4cedef26985e05806be9c7f27f6442cb

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

module LazyModelSupport
	extend ActiveSupport::Concern
	
	included do
		attr_accessor :attribute, :enumerables, :custom_finders, :column, :model
	end
	
	def initialize(model, attribute, enumerables = nil, custom_finders = {})
		self.model 			= model
		self.attribute 		= attribute
		self.enumerables 	= format_enumerables(enumerables)
		self.custom_finders = custom_finders
	end

	private

	def format_enumerables(enumerables)
		Array(enumerables).map{|enumerable| enumerable.underscore}
	end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_model-0.0.5 lib/lazy_model/lazy_model_support.rb