Is this group still active?

28 views
Skip to first unread message

Mel Riffe

unread,
Oct 23, 2013, 12:37:19 PM10/23/13
to rub...@googlegroups.com
I ask because the last post was nearly 2 years ago.

I'm currently experiencing an issue with which I could use some help.

I'm the Rails developer on this team; the Flex developer is currently debugging the situation.

I recently upgraded our Rails app to 3.2.14 and, along with a Ruby upgrade, upgraded our RubyAMF functionality. I'm going from a plugin (version 1.6.6, according to the CHANGELOG) to a gem (latest on git, including RocketAMF). A big jump, I know.

The issue we're currently seeing is that data is getting sent to the SWF as 'Generic Objects', our Flex developer's terminology, and isn't lining up with the Value Objects defined. This results in no information getting displayed.

Any assistance will be greatly appreciated.

I thought it could be a rubyamf_config.rb issue but, according to the github project and the demo project, what we're using should work.

I know I'm asking the wrong question(s) here; I'm not a Flex developer.

What questions should I be asking? How can we determine the cause to this issue?

Thanks!

Terry Lee

unread,
Nov 7, 2013, 5:01:40 AM11/7/13
to rub...@googlegroups.com
Hi Mel,

this group is pretty much dead. But let me help you in whatever I can

1. rubyamf_config.rb
Remove it. It causes you more grief than not.

2. In place of mappings in rubyamf_config.rb, do the following... 

in every model.rb, add the line

as_class 'a.b.c.ModelName' 

where a.b.c.ModelName is the fully qualified class name of your Flex as class

And on the Flex end, add before the public class declaration
[RemoteClass(alias=''a.b.c.ModelName')]

********
Your existing Flex as classes probably already have the RemoteClass tags. You just need to add the as_class in the Ruby models. The missing as_class declaration is the cause of data being sent as Generic Objects to Flex

While you are on this upgrade, take the chance to learn about map_amf function in the latest rubyamf

*********

Lastly, publish your rubyamf_config.rb
I can tell you where the other settings should go in Rails 3.

Best regards

Terry

philmill

unread,
Nov 7, 2013, 9:48:43 AM11/7/13
to rub...@googlegroups.com
Mel, I created a Rails 3 demo a few years ago (wow has it been that long) demonstrating what was needed to get Rails3 working with RubyAMF. It doesn't use Flex but a very stripped down fla. It might be helpful to look at though inspecting the project now, I see that it only tests the WidgetsController#index action. ActionScript to look at is in flashSrc/Main.as and the results are displayed in public/test.html. I was never much of a Flex guy but the example demonstrates RubyAMF working with Rails3.

Mel Riffe

unread,
Nov 11, 2013, 1:20:06 PM11/11/13
to rub...@googlegroups.com
Thanks for the information.

I'll give this a shot, though I was hoping to not have my configuration spread out over my models. But, right now, I need a working solution rather than a centralized solution. ;-)

Here's my rubyamf_config.rb file:


require 'app/configuration'
module RubyAMF
  module Configuration
    ClassMappings.ignore_fields = ['created_at','updated_at','lock_version']
    ClassMappings.translate_case = true
    ClassMappings.assume_types = false
  
    ClassMappings.register( :actionscript => 'ApplicationException', :ruby => 'ApplicationExceptions::ApplicationException' )
    ClassMappings.register( :actionscript => 'EODError', :ruby => 'ApplicationExceptions::EODError' )
    ClassMappings.register( :actionscript => 'DataAnalysisReportInfo', :ruby => 'DataAnalysisReportInfo' )
    ClassMappings.register( :actionscript => 'Provider', :ruby => 'Provider', :type => 'active_record' )
    ClassMappings.register( :actionscript => 'ProviderInfo', :ruby => 'ProviderInfo' )
    ClassMappings.register( :actionscript => 'Submitter', :ruby => 'Submitter', :type => 'active_record' )
    ClassMappings.register( :actionscript => 'Assignment', :ruby => 'Assignment', :type => 'active_record' )
    ClassMappings.register( :actionscript => 'Role', :ruby => 'Role', :type => 'active_record' )
    user_associations = ["provider", "assignments", "roles"]
    ClassMappings.register( :actionscript => 'User', :ruby => 'User', :type => 'active_record', :associations => user_associations )
    ClassMappings.register( :actionscript => 'Batch', :ruby => 'Batch', :type => 'active_record' )
    ClassMappings.register( :actionscript => 'BatchInfo', :ruby => 'BatchInfo' )
    # These are the VOs related to actual claims.
    claim_associations = ["audit_errors", "charges", "condition_codes", "diagnosis_codes","e_codes", "flags", "occurrences", "occurrence_spans", "patient", "payers", "practitioners", "procedures", "value_codes"]
    ClassMappings.register( :actionscript => 'Claim', :ruby => 'Claim', :type => 'active_record', :associations => claim_associations )
    ClassMappings.register( :actionscript => 'ClaimInfo', :ruby => 'ClaimInfo' )
    ClassMappings.register( :actionscript => 'SearchInfo', :ruby => 'SearchInfo' )
    ClassMappings.register( :actionscript => 'EncounterSetListInfo', :ruby => 'EncounterSetListInfo' )
    ClassMappings.register( :actionscript => 'EncounterSetInfo', :ruby => 'EncounterSetInfo' )
    ClassMappings.register( :actionscript => 'EncounterInfo', :ruby => 'EncounterInfo' )
    ClassMappings.register( :actionscript => 'ReportInfo', :ruby => 'ReportInfo' )
    ClassMappings.register( :actionscript => 'Warning', :ruby => 'Warning' )
    encounter_associations = ["claim", "warnings"]
    ClassMappings.register( :actionscript => 'Encounter', :ruby => 'Encounter', :type => 'active_record', :associations => encounter_associations )
    ClassMappings.register( :actionscript => 'Patient', :ruby => 'Patient', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'Payer', :ruby => 'Payer', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'Charge', :ruby => 'Charge', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'ConditionCode', :ruby => 'ConditionCode', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'DiagnosisCode', :ruby => 'DiagnosisCode', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'ECode', :ruby => 'ECode', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'ValueCode', :ruby => 'ValueCode', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'Occurrence', :ruby => 'Occurrence', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'OccurrenceSpan', :ruby => 'OccurrenceSpan', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'Practitioner', :ruby => 'Practitioner', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'Procedure', :ruby => 'Procedure', :type => 'active_record', :associations => ["audit_errors"]  )
    ClassMappings.register( :actionscript => 'LookupDiagnosis', :ruby => 'LookupDiagnosis', :type => 'active_record'  )
    ClassMappings.register( :actionscript => 'LookupProcedure', :ruby => 'LookupProcedure', :type => 'active_record'  )
    ClassMappings.register( :actionscript => 'AuditError', :ruby => 'AuditError', :type => 'active_record' )

    ClassMappings.use_array_collection = true
  end
end

I removed all the comments and commented-out configuration settings.

Thanks!

P.S. philmill, I'll use the demo app as my guide. Thanks for the information.

Mel Riffe

unread,
Nov 11, 2013, 1:22:25 PM11/11/13
to rub...@googlegroups.com
I should have added: some of the information sent to the SWF is not done by ActiveRecord models, but plain Ruby objects. Does that matter?


On Wednesday, October 23, 2013 12:37:19 PM UTC-4, Mel Riffe wrote:
Reply all
Reply to author
Forward
0 new messages