Sha256: ce44e7bec7d884b7b5fc8a881ad547e04a2eaa42ff239f15c87d4ce21e449f65

Contents?: true

Size: 519 Bytes

Versions: 49

Compression:

Stored size: 519 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

49 entries across 48 versions & 3 rubygems

Version Path
enju_biblio-0.2.5 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.4 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.3 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.2 spec/dummy/app/models/local_agent.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_biblio-0.2.1/spec/dummy/app/models/local_agent.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_biblio-0.2.0/spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.1 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.0 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.0.beta.4 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.0.beta.3 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.0.beta.2 spec/dummy/app/models/local_agent.rb
enju_biblio-0.2.0.beta.1 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.3 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.2 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.1 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre71 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre70 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre69 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre68 spec/dummy/app/models/local_agent.rb