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.1.0.pre67 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre66 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre65 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre64 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre63 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre62 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre61 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre60 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre59 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre58 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre57 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre56 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre55 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre54 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre53 spec/dummy/app/models/local_agent.rb
enju_flower-0.1.0.pre15 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre52 spec/dummy/app/models/local_agent.rb
enju_flower-0.1.0.pre14 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre51 spec/dummy/app/models/local_agent.rb
enju_biblio-0.1.0.pre50 spec/dummy/app/models/local_agent.rb