Sha256: 357e2241bdb8cb3c4b8b62c45130227f87edecf170aa74a4a784b4321e914df1
Contents?: true
Size: 774 Bytes
Versions: 1
Compression:
Stored size: 774 Bytes
Contents
require 'property_sets/property_set_model' require 'property_sets/active_record_extension' require 'property_sets/action_view_extension' module PropertySets VERSION = "0.5.8" def self.ensure_property_set_class(association, owner_class) const_name = "#{owner_class.name}#{association.to_s.singularize.capitalize}".to_sym unless Object.const_defined?(const_name) property_class = Object.const_set(const_name, Class.new(ActiveRecord::Base)) property_class.class_eval do include PropertySets::PropertySetModel::InstanceMethods extend PropertySets::PropertySetModel::ClassMethods end property_class.owner_class = owner_class property_class.owner_assoc = association end Object.const_get(const_name) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
property_sets-0.5.8 | lib/property_sets.rb |