Sha256: d5e53ab86df9386ba3f67a05a2b8273c3c1119c720860a5c28c5c7be6297240a

Contents?: true

Size: 393 Bytes

Versions: 19

Compression:

Stored size: 393 Bytes

Contents

require 'active_support'
require 'active_support/core_ext/class/attribute'

class LHS::Record

  module Relations
    extend ActiveSupport::Concern

    included do
      class_attribute :_relations
      self._relations = {}
    end

    module ClassMethods
      def has_many(name)
        _relations[name] = { record_class_name: name.to_s.singularize.classify }
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
lhs-15.2.5 lib/lhs/concerns/record/relations.rb
lhs-15.2.4 lib/lhs/concerns/record/relations.rb
lhs-15.2.3 lib/lhs/concerns/record/relations.rb
lhs-15.2.3.pre.favorites.1 lib/lhs/concerns/record/relations.rb
lhs-15.2.2.pre.favorites.1 lib/lhs/concerns/record/relations.rb
lhs-15.2.2 lib/lhs/concerns/record/relations.rb
lhs-15.2.1 lib/lhs/concerns/record/relations.rb
lhs-15.2.0 lib/lhs/concerns/record/relations.rb
lhs-15.1.1 lib/lhs/concerns/record/relations.rb
lhs-15.1.0 lib/lhs/concerns/record/relations.rb
lhs-15.0.2 lib/lhs/concerns/record/relations.rb
lhs-15.0.1 lib/lhs/concerns/record/relations.rb
lhs-15.0.0 lib/lhs/concerns/record/relations.rb
lhs-14.6.5 lib/lhs/concerns/record/relations.rb
lhs-14.6.4 lib/lhs/concerns/record/relations.rb
lhs-14.6.3 lib/lhs/concerns/record/relations.rb
lhs-14.6.2 lib/lhs/concerns/record/relations.rb
lhs-14.6.1 lib/lhs/concerns/record/relations.rb
lhs-14.6.0 lib/lhs/concerns/record/relations.rb