Sha256: 4884e8af22eb0c266cf57e2e7a7eeafd17f0bfb723ffa0f439a867b1dd6ddd51

Contents?: true

Size: 265 Bytes

Versions: 14

Compression:

Stored size: 265 Bytes

Contents

ActiveRecord::Base.class_eval do
  def self.scoped_to_account
    belongs_to :account, :class_name => "Cadenero::V1::Account"
    association_name = self.to_s.downcase.pluralize
    Cadenero::V1::Account.has_many association_name, :class_name => self.to_s
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cadenero-0.0.2.b10 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b8 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b7 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b6 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b5 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b4 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b3 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b2 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.b1 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.a3 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.a2 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.a1 lib/cadenero/active_record_extensions.rb
cadenero-0.0.2.a lib/cadenero/active_record_extensions.rb
cadenero-0.0.1 lib/cadenero/active_record_extensions.rb