This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raw_data = JSON.parse(response.body) | |
@data = Hash.new{|h,k| h[k]=Hash.new(&h.default_proc) } | |
raw_data.each do |u| | |
# u["id"] actually prints u itself?? | |
id = u["id"], name = u["first_name"], l = u["locality"], c = u["city"] | |
@data[id]["first_name"] = name | |
@data[id]["locality"] = l | |
@data[id]["city"] = c | |
@data[id][u["status"]] = u["count"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object @user | |
attributes *(@user.class.column_names - %w{id user_type parent_id stamp_id created_at updated_at password_digest access_token}) | |
child :stamp => :contact do |stamp| | |
glue(stamp.contact) { attributes :first_name, :last_name, :email, :contact1, :contact2 } | |
end | |
node(:status) {|user| user.stamp.status } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def readable_bool val | |
val ? "Yes" : "No" | |
end | |
end |
OlderNewer