Sha256: c6035fabe98b6a73608f376ab78b442d164d05f0de95f177a6beaf2b4b32fae4

Contents?: true

Size: 516 Bytes

Versions: 27

Compression:

Stored size: 516 Bytes

Contents

class LocalAgent
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming

  attr_accessor :username, :full_name, :address, :email

  def initialize(attributes = {})
    if attributes[:username]
      user = User.where(username: attributes[:username]).first
      if user
        send('email=', user.email)
      end
    else
      attributes.each do |name, value|
        send("#{name}=", value)
      end
    end
  end

  def persisted?
    false
  end

  def id
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
enju_biblio-0.3.18 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.17 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.16 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.15 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.14 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.13 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.12 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.11 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.10 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.10.rc.3 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.10.rc.2 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.10.rc.1 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.9 spec/dummy/app/models/local_agent.rb
enju_biblio-0.4.0.rc.1 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.8 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.7 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.6 spec/dummy/app/models/local_agent.rb
enju_biblio-0.4.0.beta.2 spec/dummy/app/models/local_agent.rb
enju_biblio-0.4.0.beta.1 spec/dummy/app/models/local_agent.rb
enju_biblio-0.3.5 spec/dummy/app/models/local_agent.rb